Re: [O] adding "wrap=off" option to textarea for HTML export

2016-09-09 Thread Eric S Fraga
On Thursday,  8 Sep 2016 at 17:54, Nick Dokos wrote:
> Can you add a post-processing hook? A simple text replacement might be enough.

This worked very well:

#+begin_src emacs-lisp :exports results :results none
  (defun add-wrap-to-textarea (text backend info)
(when (org-export-derived-backend-p backend 'html)
  (replace-regexp-in-string "

Re: [O] How to add a label in LaTeX export

2016-09-09 Thread Florian Lindner
Am 06.09.2016 um 10:59 schrieb Nicolas Goaziou:
> Hello,
> 
> Florian Lindner  writes:
> 
>> I have this org mode document:
>>
>> #+BEGIN_SRC python :exports results :results file
>>   import matplotlib.pyplot as plt, numpy as np
>>   x = np.linspace(-2, 2, 1000)
>>   plt.plot(x, np.exp(-np.power(4*x, 2)), label="shape-parameter=4")
>>   plt.plot(x, np.exp(-np.power(2*x, 2)), label="shape-parameter=2")
>>   for i in range(-6, 7): plt.axvline(1/6 * i, ymax = 0.1, ls = "-.", 
>> color="r")
>>   plt.grid()
>>   plt.legend()
>>   plt.savefig('rbf-gaussian-4.pdf')
>>   return "rbf-gaussian-4.pdf"
>> #+END_SRC
>> #+NAME: fig:GaussianExample
>> #+CAPTION: Gaussian Basis functions with vertex distances marked at $n \cdot 
>> \frac{1}{6}$.
>> #+RESULTS:
>> [[file:rbf-gaussian-4.pdf]]
>>
>>
>> which exports to:
>>
>>
>> \begin{document}
>>
>> \tableofcontents
>>
>> \begin{figure}[htb]
>> \centering
>> \includegraphics[width=.9\linewidth]{rbf-gaussian-4.pdf}
>> \caption{\label{fig:orgparagraph1}
>> Gaussian Basis functions with vertex distances marked at \(n \cdot 
>> \frac{1}{6}\).}
>> \end{figure}
>> \end{document}
>>
>>
>> The #+NAME which I expect to translate to a label is ignored.
> 
> It isn't. It is changed into
> 
>  \label{fig:orgparagraph1}
> 
> See also `org-latex-prefer-user-labels'.

Thanks, see related issue for org-ref: 
https://github.com/jkitchin/org-ref/issues/285

Florian




Re: [O] fill paragraph: break after sentence.

2016-09-09 Thread Andreas Röhler



On 06.09.2016 10:23, Uwe Brauer wrote:

Hello

I would like to modify the auto-fill function such that after every
sentence a new line starts like this

In order to prove our nonlinear instability result, we want to use the
linear growing mode in Proposition to construct small initial data for
the nonlinear problem.
Since we are involved in the higher-order regularity context, we
cannot simply set the initial data for the nonlinear problem to be a
small constant times the linear growing modes.

I know about functions doing that for auctex, but does anybody know
about a  similar functionality for orgmode?

Uwe Brauer



In use here is ar-forward-sentence-atpt as part of thing-at-point-utils 
toolkit


https://github.com/andreas-roehler/werkstatt/tree/master/thing-at-point-utils




[O] Embedded LaTeX fontification

2016-09-09 Thread Kai von Fintel
When I embed LaTeX code in a `#+BEGIN_SRC latex` block and 
`org-src-fontify-natively` is set to `t`, the code is fontified as LaTeX 
code. But when the code is embedded in a `#+BEGIN_LaTeX` block, there's 
no fontification. Is that as intended? Am I missing some setting? Or 
could that functionality be added?


-- Kai.

Re: [O] adding "wrap=off" option to textarea for HTML export

2016-09-09 Thread Clément Pit--Claudel
On 2016-09-08 11:49, Eric S Fraga wrote:
> To turn wrapping off, I would need to add 'wrap="off"' to the textarea
> form as this option cannot be controlled using CSS unfortunately.  I
> don't see any way to do this from org.

Hm. Doesn't the following work?

textarea {
  white-space: pre;
}



signature.asc
Description: OpenPGP digital signature


Re: [O] Embedded LaTeX fontification

2016-09-09 Thread Charles C. Berry

On Fri, 9 Sep 2016, Kai von Fintel wrote:

When I embed LaTeX code in a `#+BEGIN_SRC latex` block and 
`org-src-fontify-natively` is set to `t`, the code is fontified as LaTeX 
code. But when the code is embedded in a `#+BEGIN_LaTeX` block, there's no 
fontification. Is that as intended? Am I missing some setting?


See ORG-NEWS

* Version 9.0
** Incompatible changes
*** New syntax for export blocks
[...]

and use the function provided there to update your *.org files.


Or could that functionality be added?


It is already there in the new export blocks.

HTH,

Chuck



Re: [O] adding "wrap=off" option to textarea for HTML export

2016-09-09 Thread Eric S Fraga
On Friday,  9 Sep 2016 at 15:32, Clément Pit--Claudel wrote:
> On 2016-09-08 11:49, Eric S Fraga wrote:
>> To turn wrapping off, I would need to add 'wrap="off"' to the textarea
>> form as this option cannot be controlled using CSS unfortunately.  I
>> don't see any way to do this from org.
>
> Hm. Doesn't the following work?
>
> textarea {
>   white-space: pre;
> }

Ah, it does!  That'll teach me to believe what I read on the
Interweb... which told me that CSS could not achieve this.  I've just
tested it and it works just fine, at least on Firefox.

Thanks,
eric

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.90.1, Org release_8.3.3-535-g7213aa



Re: [O] Embedded LaTeX fontification

2016-09-09 Thread Eric S Fraga
On Friday,  9 Sep 2016 at 12:06, Kai von Fintel wrote:
> When I embed LaTeX code in a #+BEGIN_SRC latex block and
> org-src-fontify-natively is set to t, the code is fontified as LaTeX
> code. But when the code is embedded in a #+BEGIN_LaTeX block, there's
> no fontification. Is that as intended? Am I missing some setting? Or
> could that functionality be added?

What version of org are you using?  In latest versions, begin_latex is
now
#+begin_export latex
...
#+end_export
and this does fontify correctly for me.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.90.1, Org release_8.3.3-535-g7213aa



Re: [O] Embedded LaTeX fontification

2016-09-09 Thread s j
I am using the org-plus-contrib package in org ELPA.

  

The export block

  

#+begin_export latex

...

#+end_export

  

does not work properly.

It produces

  

\begin{export}

...

\end{export}

  

in the .tex file and causes error.

  

Instead, I still need to use

  

#+begin_latex

...

#+end_latex

.

  

Is the version in org EPLA an out-dated one?

  

Jiang

  

  
On Sep 9 2016, at 12:23 pm, Eric S Fraga  wrote:  

> On Friday, 9 Sep 2016 at 12:06, Kai von Fintel wrote:  
> When I embed LaTeX code in a #+BEGIN_SRC latex block and  
> org-src-fontify-natively is set to t, the code is fontified as LaTeX  
> code. But when the code is embedded in a #+BEGIN_LaTeX block, there's  
> no fontification. Is that as intended? Am I missing some setting? Or  
> could that functionality be added?

>

> What version of org are you using? In latest versions, begin_latex is  
now  
#+begin_export latex  
...  
#+end_export  
and this does fontify correctly for me.

>

> \--  
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.90.1, Org release_8.3.3-535-g7213aa



Re: [O] Embedded LaTeX fontification

2016-09-09 Thread Nick Dokos
s j  writes:

> I am using the org-plus-contrib package in org ELPA. 
>
> The export block
>
> #+begin_export latex
> ...
> #+end_export
>
> does not work properly. 
> It produces
>
> \begin{export}
> ...
> \end{export}
>
> in the .tex file and causes error.
>
> Instead, I still need to use
>
> #+begin_latex
> ...
> #+end_latex
> .
>
> Is the version in org EPLA an out-dated one?
>

No: it is the stable version. No new features, only bug fixes, are
applied to it.

You are right that it does not recognize #+begin_export
latex...#+end_export.  That is a feature that has been introduced in
the master branch (which will become the stable version at some point
in the future).

-- 
Nick




Re: [O] Multiple bibliography files with ox-bibtex and html export

2016-09-09 Thread Thibault Marin


Do you mean:
1) Using `call-process' for cases where a single bibliography file is
passed and `process-send-string' when multiple files are used?
2) Using `process-send-string' regardless of the number of bibliography
files?  In this case, can we still unify the code between single and
multiple files?
3) Something else?

In my opinion 1) makes the code more error-prone and harder to
maintain. If there are other reasons to replace the existing behavior
(for single bibliography files) by `process-send-string', then 2) may
make sense, otherwise it sounds to me that it may not be worth it: the
existing code is apparently working fine for single files, I would feel
a little uncomfortable changing it based only on my test case,
especially since there isn't (as far as I know) a battery of tests for
it.

- Is having a temporary file unacceptable?

The first patch creates and keeps the combined bibliography around, but
this created file could easily be deleted if preferred.  If the problem
is just the extra file, the first patch can fix it and seems less
intrusive to me.

- Is the main concern performance?

I think that the main argument for using standard input may be to skip
the disk access required by the temporary file.  I do not know if the
potential savings for files of size around a few MB (or more?) justify
the more intrusive change in the code.  Maybe others would have a better
feel for this than I do.

Thanks for the comments on this.  Once a consensus is reached, I can
work towards an updated patch.

thibault

> I'd suggest starting the process and then using process-send-string.
> 
> Clément.
> 
> On 2016-09-08 23:55, Thibault Marin wrote:
> > 
> > Clément Pit--Claudel writes:
> > 
> >> On 2016-09-06 23:46, Thibault Marin wrote:
> > I am attaching a patch which allows me to use multiple files with html
> > export.  It creates a combined bibliography file and call bibtex2html on
> > it.  I am not sure this is the best way to address this, so any
> > suggestion would be welcome.
> >>
> >> Sorry for the late comment.  bibtex2html can read from standard input; 
> >> maybe that would be cleaner?
> >>
> >> Clément.
> > 
> > That may be a good idea, it would prevent potential name clashing with
> > the created bib file.  Currently, the function creates a
> > -combined.bib file with the content of all
> > bibliography files, then bibtex2html creates
> > -combined.html and
> > -combined_bib.html.  Passing the contents via stdin
> > would skip the -combined.bib.  We could achieve the
> > same by simply deleting -combined.bib after calling
> > bibtex2html.  I personally don't mind leaving the .bib file after
> > processing, but if there is a consensus to limit the side effect, we can
> > do that.
> > 
> > As far as the implementation goes, I am not sure what is the best way to
> > get this to work with stdin.  In the attached patch (which does *not*
> > work) I tried to use `call-process-region' and dump the bibliography
> > files into a temporary buffer.  This complicates the code a little.
> > Alternatively, we could use the `INFILE' parameter from `call-process',
> > but it looks that this would require a file, so it would not change much
> > from the previous patch.
> > 
> > Any thoughts?
> > 



[O] Writing equations in org mode

2016-09-09 Thread s j
Hi,

  

When one writes latex displayed equations in an org file, is it possible to
achieve the following two points at the same time?

  

  1. In the org buffer, the latex codes have syntax highlighting according to 
auctex (auctex installed).
  2. The equation can be exported as a displayed equation using BOTH latex and 
html backend.
I tried the export block and the source code block. Both give nice
fontification, but I cannot get the exportation right.

  

On the other hand, directly putting in latex fragments exports well for both
html and latex, but the fragments have no fontification, only a highlight
background.

  

Thanks!

  

Jiang



Re: [O] Embedded LaTeX fontification

2016-09-09 Thread s j
Thanks for the clarification!

  

Jiang

  
On Sep 9 2016, at 8:41 pm, Nick Dokos  wrote:  

> s j  writes:

>

> > I am using the org-plus-contrib package in org ELPA.  
>  
> The export block  
>  
> #+begin_export latex  
> ...  
> #+end_export  
>  
> does not work properly.  
> It produces  
>  
> \begin{export}  
> ...  
> \end{export}  
>  
> in the .tex file and causes error.  
>  
> Instead, I still need to use  
>  
> #+begin_latex  
> ...  
> #+end_latex  
> .  
>  
> Is the version in org EPLA an out-dated one?  
>

>

> No: it is the stable version. No new features, only bug fixes, are  
applied to it.

>

> You are right that it does not recognize #+begin_export  
latex...#+end_export. That is a feature that has been introduced in  
the master branch (which will become the stable version at some point  
in the future).

>

> \--  
Nick