Re: [O] LaTeX export section level cutoff?

2019-05-06 Thread Christian Lynbech
Thanks a lot!

  -- Christian


---
On Mon, May 06 2019, William Denton wrote:

On 6 May 2019, Christian Lynbech wrote:

> What determines at what level LaTeX export goes from sections to
> enumerations?

According to this, by default it's three levels of sections, then it
turns into lists:

https://orgmode.org/org.html#LaTeX-header-and-sectioning

But H in the export settings (or org-export-headline-levels) can change that:

https://orgmode.org/org.html#Export-Settings


Bill
--
William Denton :: Toronto, Canada   ---   Listening to Art: 
https://listeningtoart.org/
https://www.miskatonic.org/ ---   GHG.EARTH: https://ghg.earth/
Caveat lector.  ---   STAPLR: http://staplr.org/



Re: [O] LaTeX export section level cutoff?

2019-05-06 Thread William Denton

On 6 May 2019, Christian Lynbech wrote:


What determines at what level LaTeX export goes from sections to
enumerations?


According to this, by default it's three levels of sections, then it turns into 
lists:


https://orgmode.org/org.html#LaTeX-header-and-sectioning

But H in the export settings (or org-export-headline-levels) can change that:

https://orgmode.org/org.html#Export-Settings


Bill
--
William Denton :: Toronto, Canada   ---   Listening to Art: 
https://listeningtoart.org/
https://www.miskatonic.org/ ---   GHG.EARTH: https://ghg.earth/
Caveat lector.  ---   STAPLR: http://staplr.org/



[O] LaTeX export section level cutoff?

2019-05-06 Thread Christian Lynbech
What determines at what level LaTeX export goes from sections to
enumerations?

I am using `report', the definition of which looks like this:

("report" "\\documentclass[11pt]{report}"
   ("\\part{%s}" . "\\part*{%s}")
   ("\\chapter{%s}" . "\\chapter*{%s}")
   ("\\section{%s}" . "\\section*{%s}")
   ("\\subsection{%s}" . "\\subsection*{%s}")
   ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))

and my top-level (*) becomes parts, the next (**) becomes chapters and
so on, but when I get down to level 4 and 5, as in

 Testing

* Mailbox creation


the code exported looks like this:

\item Testing
\label{sec:orgf672eb5}

\begin{enumerate}
\item Mailbox creation
\label{sec:orgca67a92}



I have set a `toc' option of 2, but changing that does not seem to
affect the sectioning cutoff and there clearly are options available in
the "report" definition for levels 4 and 5.


--

+-
Christian Lynbech   | christian #\@ defun #\. dk
+-
Hit the philistines three times over the head with the Elisp reference manual.
- peto...@hal.com (Michael A. Petonic)




Re: [O] [latex export/babel] pass arguments to \includegraphics from code blocks

2019-04-22 Thread Jakob Schöttl

Am 22.04.19 um 21:13 schrieb Nick Dokos:

Jakob Schöttl  writes:

Hi, I want to use code blocks to generate and include images of sheet music:

#+BEGIN_SRC lilypond :file test.png :exports results
\header{tagline=""}
{ a b c }
#+END_SRC


When doing a latex export the result is:

\begin{center}
\includegraphics[width=.9\linewidth]{test.png}
\end{center}

Is there a way to specify the arguments for \includegraphics? For
example I want to change the display width.

Putting these lines above the code block have no effect:

#+ATTR_LATEX: :width 4cm

#+CAPTION: xxx

Maybe this requires a change in ob-lilypond.el to introduce new header
arguments for the source block?


What I do in such cases is evaluate the block and then add the caption and
attribute line above the #+RESULTS line:

--8<---cut here---start->8---
#+BEGIN_SRC lilypond :file test.png :exports results
\header{tagline=""}
{ a b c }
#+END_SRC


#+ATTR_LATEX: :width 4cm
#+CAPTION: xxx
#+RESULTS:
[[file:test.png]]
--8<---cut here---end--->8---



Thank you, Nick! That's perfect.




Re: [O] [latex export/babel] pass arguments to \includegraphics from code blocks

2019-04-22 Thread Nick Dokos
Jakob Schöttl  writes:

> Hi, I want to use code blocks to generate and include images of sheet music:
>
> #+BEGIN_SRC lilypond :file test.png :exports results
> \header{tagline=""}
> { a b c }
> #+END_SRC
>
>
> When doing a latex export the result is:
>
> \begin{center}
> \includegraphics[width=.9\linewidth]{test.png}
> \end{center}
>
> Is there a way to specify the arguments for \includegraphics? For 
> example I want to change the display width.
>
> Putting these lines above the code block have no effect:
>
> #+ATTR_LATEX: :width 4cm
>
> #+CAPTION: xxx
>
> Maybe this requires a change in ob-lilypond.el to introduce new header 
> arguments for the source block?
>

What I do in such cases is evaluate the block and then add the caption and
attribute line above the #+RESULTS line:

--8<---cut here---start->8---
#+BEGIN_SRC lilypond :file test.png :exports results
\header{tagline=""}
{ a b c }
#+END_SRC


#+ATTR_LATEX: :width 4cm
#+CAPTION: xxx
#+RESULTS:
[[file:test.png]]
--8<---cut here---end--->8---

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




[O] [latex export/babel] pass arguments to \includegraphics from code blocks

2019-04-22 Thread Jakob Schöttl

Hi, I want to use code blocks to generate and include images of sheet music:

#+BEGIN_SRC lilypond :file test.png :exports results
\header{tagline=""}
{ a b c }
#+END_SRC

When doing a latex export the result is:

\begin{center}
\includegraphics[width=.9\linewidth]{test.png}
\end{center}

Is there a way to specify the arguments for \includegraphics? For 
example I want to change the display width.


Putting these lines above the code block have no effect:

#+ATTR_LATEX: :width 4cm
#+CAPTION: xxx

Maybe this requires a change in ob-lilypond.el to introduce new header 
arguments for the source block?


Regards, Jakob




[O] Latex export from org-download images with spaces fails

2018-11-12 Thread Moritz Schäfer
Hello mailing list,

when I use org-download to take a screenshot and automatically import the
image into my org document it often contains spaces (because the overlying
headline contains spaces and the image gets saved in a folder with the same
name).
org-download seems to use URL encoding when storing the link in the org
file so these spaces get converted to "%20". Org-mode seems to be fine with
this and calling org-toggle-inline-images the image as shown as expected.

However, when exporting to LaTex, the images are not shown in the resulting
PDF file (which can recovered by changing the URL encoded spaces to real
spaces).

I now wonder which module is the problem here:
- Should LaTex be able to understand URL encoded paths?
- Are URL encoded links normal/encourged in org-mode?
- Should org-download use normal spaces instead of URL encoding?

I'm happy for any suggestion you have on how to workarround this and on
where I should file a bug report. I started at org-download (
https://github.com/abo-abo/org-download/issues/84)

Thanks for your help


Re: [O] Latex export with \begin{equation}

2018-09-19 Thread Nicolas Goaziou
Hello,

Dominik Schrempf  writes:

> I tried to follow your suggestions. Please let me know, if the patch
> is OK like this.

Applied, with some changes to the commit message. Thank you.

> The patch only adds one footnote. It is unfortunate, that all
> subsequent footnotes are changed too.

This is a design choice. It keeps footnote numbers ordered. I find
having footnote numbers unordered confusing. Of course, as any design
choice, this is debatable.

Regards,

-- 
Nicolas Goaziou0x80A93738



Re: [O] Latex export with \begin{equation}

2018-09-18 Thread Dominik Schrempf

Hello,

I tried to follow your suggestions. Please let me know, if the patch is OK like
this.

The patch only adds one footnote. It is unfortunate, that all subsequent
footnotes are changed too.

Best,
Dominik

>From 4b97952b0d6d218de7d7cab6f7017f87b68b966c Mon Sep 17 00:00:00 2001
From: Dominik Schrempf 
Date: Tue, 18 Sep 2018 15:04:47 +0200
Subject: [PATCH] Mention peculiarities of Math in HTML code. TINYCHANGE.

---
 doc/org-manual.org | 132 +++--
 1 file changed, 68 insertions(+), 64 deletions(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 0732c1d97..90b2dbd12 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -12638,7 +12638,7 @@ is.
 #+vindex: org-html-mathjax-options~
 LaTeX math snippets (see [[*LaTeX fragments]]) can be displayed in two
 different ways on HTML pages.  The default is to use the [[http://www.mathjax.org][MathJax]],
-which should work out of the box with Org[fn:123].  Some MathJax
+which should work out of the box with Org[fn:123][fn:124].  Some MathJax
 display options can be configured via ~org-html-mathjax-options~, or
 in the buffer.  For example, with the following settings,
 
@@ -12650,7 +12650,7 @@ in the buffer.  For example, with the following settings,
 #+texinfo: @noindent
 equation labels are displayed on the left margin and equations are
 five em from the left margin.  In addition, it loads the two MathJax
-extensions =cancel.js= and =noErrors.js=[fn:124].
+extensions =cancel.js= and =noErrors.js=[fn:125].
 
 #+vindex: org-html-mathjax-template
 See the docstring of ~org-html-mathjax-options~ for all supported
@@ -12713,7 +12713,7 @@ line.
 #+vindex: org-export-html-todo-kwd-class-prefix
 #+vindex: org-export-html-tag-class-prefix
 You can modify the CSS style definitions for the exported file.  The
-HTML exporter assigns the following special CSS classes[fn:125] to
+HTML exporter assigns the following special CSS classes[fn:126] to
 appropriate parts of the document---your style specifications may
 change these, in addition to any of the standard classes like for
 headlines, tables, etc.
@@ -12953,7 +12953,7 @@ LaTeX export back-end finds the compiler version to use from
 Org file.  See the docstring for the
 ~org-latex-default-packages-alist~ for loading packages with certain
 compilers.  Also see ~org-latex-bibtex-compiler~ to set the
-bibliography compiler[fn:126].
+bibliography compiler[fn:127].
 
 *** LaTeX specific export settings
 :PROPERTIES:
@@ -13564,7 +13564,7 @@ a limit to a level before the absolute limit (see [[*Export Settings]]).
 
 The ODT export back-end handles creating of OpenDocument Text (ODT)
 format.  Documents created by this exporter use the
-{{{cite(OpenDocument-v1.2 specification)}}}[fn:127] and are compatible
+{{{cite(OpenDocument-v1.2 specification)}}}[fn:128] and are compatible
 with LibreOffice 3.4.
 
 *** Pre-requisites for ODT export
@@ -13965,7 +13965,7 @@ document in one of the following ways:
  variables ~org-latex-to-mathml-convert-command~ and
  ~org-latex-to-mathml-jar-file~.
 
- If you prefer to use MathToWeb[fn:128] as your converter, you can
+ If you prefer to use MathToWeb[fn:129] as your converter, you can
  configure the above variables as shown below.
 
  #+begin_src emacs-lisp
@@ -13975,7 +13975,7 @@ document in one of the following ways:
"/path/to/mathtoweb.jar")
  #+end_src
 
- To use LaTeX​ML[fn:129] use
+ To use LaTeX​ML[fn:130] use
 
  #+begin_src emacs-lisp
  (setq org-latex-to-mathml-convert-command
@@ -14295,7 +14295,7 @@ with the =#+ATTR_ODT= line.  For a discussion on default formatting of
 tables, see [[*Tables in ODT export]].
 
 This feature closely mimics the way table templates are defined in the
-OpenDocument-v1.2 specification.[fn:130]
+OpenDocument-v1.2 specification.[fn:131]
 
 #+vindex: org-odt-table-styles
 For quick preview of this feature, install the settings below and export the
@@ -14329,7 +14329,7 @@ templates, define new styles there.
 
 To use this feature proceed as follows:
 
-1. Create a table template[fn:131].
+1. Create a table template[fn:132].
 
A table template is set of =table-cell= and =paragraph= styles for
each of the following table cell categories:
@@ -14368,7 +14368,7 @@ To use this feature proceed as follows:
== element of the content template file
(see [[x-orgodtcontenttemplate-xml][Factory styles]]).
 
-2. Define a table style[fn:132].
+2. Define a table style[fn:133].
 
#+vindex: org-odt-table-styles
To define a table style, create an entry for the style in the
@@ -15395,7 +15395,7 @@ If you want to publish the Org file as an =.org= file but with
 ~org-publish-org-to-org~.  This produces =file.org= and put it in the
 publishing directory.  If you want a htmlized version of this file,
 set the parameter ~:htmlized-source~ to ~t~.  It produces
-=file.org.html= in the publishing directory[fn:133].
+=file.org.html= in the publishing 

Re: [O] Latex export with \begin{equation}

2018-09-17 Thread Nicolas Goaziou
Hello,

Dominik Schrempf  writes:

> Oh thanks,
>
> I thought it would be good to add a comment to the Org mode manual although it
> is of course not really Org mode related.
>
> I decided that a good location would be
> https://orgmode.org/manual/Math-formatting-in-HTML-export.html#Math-formatting-in-HTML-export
>
> A proposed patch is attached, please let me know what you think.

Thank you.

Please use a proper commit message and add TINYCHANGE if you haven't
signed FSF papers.

> --- org-manual.org2018-09-17 18:48:17.868785307 +0200
> +++ org-manual.org.new2018-09-17 18:48:09.708751068 +0200
> @@ -12655,7 +12655,9 @@
>  #+vindex: org-html-mathjax-template
>  See the docstring of ~org-html-mathjax-options~ for all supported
>  variables.  The MathJax template can be configure via
> -~org-html-mathjax-template~.
> +~org-html-mathjax-template~.  Please note that formulas will be part

I suggest to use the present tense instead of the future, per (info
"(elisp) Documentation Tips") and put this in a footnote since this is
not directly Org-related, as you point out.

> +of an HTML document, and that signs such as =<=, =>=, or =&= have
> +special meanings (see 
> [[http://docs.mathjax.org/en/latest/tex.html#tex-and-latex-in-html-documents][MathJax
>  TeX and LaTeX support]]).
>  

Regards,

-- 
Nicolas Goaziou



Re: [O] Latex export with \begin{equation}

2018-09-17 Thread Dominik Schrempf

Oh thanks,

I thought it would be good to add a comment to the Org mode manual although it
is of course not really Org mode related.

I decided that a good location would be
https://orgmode.org/manual/Math-formatting-in-HTML-export.html#Math-formatting-in-HTML-export

A proposed patch is attached, please let me know what you think.

Best,
Dominik

--- org-manual.org	2018-09-17 18:48:17.868785307 +0200
+++ org-manual.org.new	2018-09-17 18:48:09.708751068 +0200
@@ -12655,7 +12655,9 @@
 #+vindex: org-html-mathjax-template
 See the docstring of ~org-html-mathjax-options~ for all supported
 variables.  The MathJax template can be configure via
-~org-html-mathjax-template~.
+~org-html-mathjax-template~.  Please note that formulas will be part
+of an HTML document, and that signs such as =<=, =>=, or =&= have
+special meanings (see [[http://docs.mathjax.org/en/latest/tex.html#tex-and-latex-in-html-documents][MathJax TeX and LaTeX support]]).
 
 If you prefer, you can also request that LaTeX fragments are processed
 into small images that will be inserted into the browser page.  Before


Nick Dokos  writes:


Dominik Schrempf  writes:



so I found the reason. Both Org versions behave the same, sorry for the
confusion. The original equation that does not get exported correctly 
contained

angles:

\begin{equation}
  = \frac{\sum_i w_i k_{eff}(i)}{\sum_i w_i}.
\end{equation}

This equation is correctly rendered when using a .tex file and native LaTeX.
If the angles are removed, the Org Mode HTML export works:

\begin{equation}
 k_{eff} = \frac{\sum_i w_i k_{eff}(i)}{\sum_i w_i}.
\end{equation}

Does anybody know why? Is this expected behavior? Can this be changed?



Maybe this explains it:

"...Also, since the mathematics is initially given as text on the
page, you need to be careful that your mathematics doesn’t look like
HTML tags to the browser (which parses the page before MathJax gets to
see it). In particular, that means that you have to be careful about
things like less-than and greater-than signs (< and >), and ampersands
(&), which have special meaning to the browsers. For example,

... when $xhttp://docs.mathjax.org/en/latest/tex.html

the section entitled "TeX and LaTeX in HTML documents":


Re: [O] Latex export with \begin{equation}

2018-09-13 Thread Nick Dokos
Dominik Schrempf  writes:


> so I found the reason. Both Org versions behave the same, sorry for the
> confusion. The original equation that does not get exported correctly 
> contained
> angles:
>
> \begin{equation}
>   = \frac{\sum_i w_i k_{eff}(i)}{\sum_i w_i}.
> \end{equation}
>
> This equation is correctly rendered when using a .tex file and native LaTeX.
> If the angles are removed, the Org Mode HTML export works:
>
> \begin{equation}
>  k_{eff} = \frac{\sum_i w_i k_{eff}(i)}{\sum_i w_i}.
> \end{equation}
>
> Does anybody know why? Is this expected behavior? Can this be changed?
>

Maybe this explains it:

"...Also, since the mathematics is initially given as text on the
page, you need to be careful that your mathematics doesn’t look like
HTML tags to the browser (which parses the page before MathJax gets to
see it). In particular, that means that you have to be careful about
things like less-than and greater-than signs (< and >), and ampersands
(&), which have special meaning to the browsers. For example,

... when $xhttp://docs.mathjax.org/en/latest/tex.html
   
the section entitled "TeX and LaTeX in HTML documents":

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: [O] Latex export with \begin{equation}

2018-09-13 Thread Julius Dittmar
Am 13.09.18 um 15:31 schrieb Dominik Schrempf:
> so I found the reason. Both Org versions behave the same, sorry for the
> confusion. The original equation that does not get exported correctly
> contained
> angles:
> 
> \begin{equation}
>   = \frac{\sum_i w_i k_{eff}(i)}{\sum_i w_i}.
> \end{equation}
> 
> This equation is correctly rendered when using a .tex file and native
> LaTeX.
> If the angles are removed, the Org Mode HTML export works:
> 
> \begin{equation}
>  k_{eff} = \frac{\sum_i w_i k_{eff}(i)}{\sum_i w_i}.
> \end{equation}
> 
> Does anybody know why? Is this expected behavior? Can this be changed?

I can't answer any of those questions, but you as a work-around you
could use \langle and \rangle instead of < and >. That's propably more
what you want anyways, as < and > are rendered as the less operator and
the greater operator, including the appropriate spacing, whereas \langle
and \rangle behave like parenthesis.

HTH,
Julius



Re: [O] Latex export with \begin{equation}

2018-09-13 Thread Dominik Schrempf

Hi,

so I found the reason. Both Org versions behave the same, sorry for the
confusion. The original equation that does not get exported correctly contained
angles:

\begin{equation}
  = \frac{\sum_i w_i k_{eff}(i)}{\sum_i w_i}.
\end{equation}

This equation is correctly rendered when using a .tex file and native LaTeX.
If the angles are removed, the Org Mode HTML export works:

\begin{equation}
 k_{eff} = \frac{\sum_i w_i k_{eff}(i)}{\sum_i w_i}.
\end{equation}

Does anybody know why? Is this expected behavior? Can this be changed?

Dominik Schrempf  writes:


Hi,

I have the following document:

\begin{equation}
foobar
\end{equation}

I perform an HTML export.

The equation is not rendered with MathJax when using Org Mode 9.1.14
(Spacemacs).

The equation is correctly rendered with =emacs -Q=; then, Org Mode 9.1.9 is
used.

I am sure that Spacemacs sets other variables that may influence the HTML
export, but even then LaTeX export works perfectly when using dollar signs to
mark the equation.

Help much appreciated!

Thanks,
Dominik




[O] Latex export with \begin{equation}

2018-09-13 Thread Dominik Schrempf

Hi,

I have the following document:

\begin{equation}
foobar
\end{equation}

I perform an HTML export.

The equation is not rendered with MathJax when using Org Mode 9.1.14
(Spacemacs).

The equation is correctly rendered with =emacs -Q=; then, Org Mode 9.1.9 is 
used.


I am sure that Spacemacs sets other variables that may influence the HTML
export, but even then LaTeX export works perfectly when using dollar signs to
mark the equation.

Help much appreciated!

Thanks,
Dominik



Re: [O] Latex export of figure with multiline caption and label results in additional space

2018-09-06 Thread Max Beutelspacher

Hello,

I'm very sorry I hope this version is parsed correctly:

When I use a multiline caption without a label everythings is 
correct, the two lines are both indented by the same amount 
#+BEGIN_SRC org #+LATEX_HEADER: \usepackage{caption} 
#+LATEX_HEADER: \captionsetup{format=hang} #+CAPTION:Cras placerat 
accumsan nulla.  Aliquam posuere.  Etiam laoreet quam sed arcu. 
Phasellus purus.  [[file:test.png]] #+END_SRC


results in this latex code  #+BEGIN_SRC latex \begin{figure}[htbp] 
\centering \includegraphics[width=.9\linewidth]{test.jpg} 
\caption{Cras placerat accumsan nulla.  Aliquam posuere.  Etiam 
laoreet quam sed arcu. Phasellus purus.}  \end{figure} #+END_SRC 
Unfortunately when I add the label then the first line of the 
caption is  indented by one space due to the label within the 
caption in the latex output:   #+BEGIN_SRC org #+LATEX_HEADER: 
\usepackage{caption} #+LATEX_HEADER: \captionsetup{format=hang} 
#+NAME: test #+CAPTION:Cras placerat accumsan nulla.  Aliquam 
posuere.  Etiam laoreet quam sed arcu. Phasellus purus. 
[[file:test.png]] #+END_SRC


results in 

#+BEGIN_SRC latex  \begin{figure}[htbp] \centering 
\includegraphics[width=.9\linewidth]{test.png} 
\caption{\label{test} Cras placerat accumsan nulla.  Aliquam 
posuere.  Etiam laoreet quam sed arcu.  Phasellus purus.} 
\end{figure} #+END_SRC  



Best regards,






Nicolas Goaziou  writes:


Hello,

Max Beutelspacher  writes:

I have a problem when I'm exporting a figure with a multiline 
caption and a label to pdf via latex.


Here is an example #+BEGIN_SRC org +LATEX_HEADER: 
\usepackage{caption} +LATEX_HEADER: #\captionsetup{format=hang} 
+NAME: test +CAPTION:Cras placerat #accumsan nulla.  Aliquam 
posuere.  Etiam laoreet quam sed arcu.  #Phasellus purus. 
[[file:test.png]] +END_SRC


I cannot parse your example. Could you send it again?

Regards,





Re: [O] Latex export of figure with multiline caption and label results in additional space

2018-09-06 Thread Nicolas Goaziou
Hello,

Max Beutelspacher  writes:

> I have a problem when I'm exporting a figure with a multiline caption
> and a label to pdf via latex.
>
> Here is an example
> #+BEGIN_SRC org +LATEX_HEADER: \usepackage{caption} +LATEX_HEADER:
> #\captionsetup{format=hang}  +NAME: test +CAPTION:Cras placerat
> #accumsan nulla.  Aliquam posuere.  Etiam laoreet quam sed arcu.
> #Phasellus purus.[[file:test.png]] +END_SRC

I cannot parse your example. Could you send it again?

Regards,

-- 
Nicolas Goaziou



[O] Latex export of figure with multiline caption and label results in additional space

2018-09-03 Thread Max Beutelspacher

Hi,

I have a problem when I'm exporting a figure with a multiline 
caption and a label to pdf via latex.


Here is an example
#+BEGIN_SRC org +LATEX_HEADER: \usepackage{caption} +LATEX_HEADER: 
#\captionsetup{format=hang}  +NAME: test +CAPTION:Cras placerat 
#accumsan nulla.  Aliquam posuere.  Etiam laoreet quam sed arcu. 
#Phasellus purus.[[file:test.png]] +END_SRC


The headers are to ensure that the caption is indented.
Unfortunately now the latex export is

#+BEGIN_SRC latex \begin{figure}[htbp] \centering 
\includegraphics[width=.9\linewidth]{test.png} 
\caption{\label{test} Cras placerat accumsan nulla.  Aliquam 
posuere.  Etiam laoreet quam sed arcu.  Phasellus purus.} 
\end{figure} #+END_SRC 


so the label is inserted before the caption separated by a space.
In the resulting pdf the first line of the caption is then 
indented by one additional space compared to the other lines of 
the caption.


This does not happen if I omit the label/name.

Is this a bug? Is there any way around this behavior?




Re: [O] LaTeX export filter

2018-03-27 Thread Vikas Rawal
> 
> 
> 
>> 
>>> (while (string-match
>>> "\\(<\\([0-9]+\\)cid\\([0-9]+\\)?>[[:blank:]]*\\([^&]+\\)\\)" row)
>> 
>> Could it be that you need to change the last + to *?
>> Haven't tried it, mind you.
>> -- 
> 
> That does not change the result. Still pick only two.
> 
> Vikas
> 




Re: [O] LaTeX export filter

2018-03-27 Thread Vikas Rawal
> 
>> 
>> 
>>> 
 (while (string-match
"\\(<\\([0-9]+\\)cid\\([0-9]+\\)?>[[:blank:]]*\\([^&]+\\)\\)" row)
>>> 
>>> Could it be that you need to change the last + to *?
>>> Haven't tried it, mind you.
>>> -- 
>> 
> 
> The problem is in this part of the code:
> 
> (while (string-match "& \\| " row 0)
>   (setq row (replace-match "" nil nil row))
>   (decf start))
> 
> If I comment it, I get three \cmidrule latex commands, but with  and \\
> 
> Somehow, the above lines replace more than just  and \\.
> 
> Vikas
> 




Re: [O] LaTeX export filter

2018-03-24 Thread Eric S Fraga
On Saturday, 24 Mar 2018 at 22:24, Vikas Rawal wrote:
> I am trying to write a LaTeX export filter that should replace all
> table rows with cells having entries such as <3cid4> by
> \cmidrule{lr}{3-4}

[...]

>   (while (string-match
>   "\\(<\\([0-9]+\\)cid\\([0-9]+\\)?>[[:blank:]]*\\([^&]+\\)\\)" row)

Could it be that you need to change the last + to *?
Haven't tried it, mind you.
-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.6-341-g3a4fd3


signature.asc
Description: PGP signature


[O] LaTeX export filter

2018-03-24 Thread Vikas Rawal
Let me start by confessing my limited knowledge of lisp.

I am trying to write a LaTeX export filter that should replace all table rows 
with cells having entries such as <3cid4> by \cmidrule{lr}{3-4}

The idea is to have a table row of this kind

| <2cid3> |   <4cid5> |<6cid7> |   
|   |   |   
|

Which should be exported to 

\cmidrule(lr){2-3} \cmidrule(lr){4-5} \cmidrule(lr){6-7}

This is as far as I have gone.

--

(defun org-export-cmidrule-filter-latex (row backend info)
  (while (string-match
  "\\(<\\([0-9]+\\)cid\\([0-9]+\\)?>[[:blank:]]*\\([^&]+\\)\\)" row)
(let ((start (string-to-number (match-string 2 row)))
  (end (or (match-string 3 row) "l")))
  (setq row (replace-match
 (format "cmidrule(lr){%s-%s}" start end)
 nil nil row 1))
  (while (string-match "& \\| " row 0)
(setq row (replace-match "" nil nil row))
(decf start))
  )
)
  row)

--

The above filter works if I have only one or two <[0-9]cid[0-9]> strings in a 
row. It does not pick up the third <[0-9]cid[0-9]> string.

I would greatly appreciate if anyone could help improve this filter.

Vikas




Re: [O] LaTeX Export

2017-08-10 Thread Scott Randby
On 08/10/2017 11:35 AM, Richard Lawrence wrote:> Hi Scott,
> 
> Scott Randby  writes:
> 
>> I tried this in the properties associated with a subtree: 
>> :export_latex_header: 
>> \hypersetup{pdfauthor={foo},pdftitle={foo},pdfsubject={foo},pdfkeywords={foo},pdfproducer={foo},pdfcreator={foo}}
>>  Unfortunately, all the other LaTeX headers are unrecognized when I do this.
> 
> If you put the subtree-specific hypersetup in each subtree's 
> EXPORT_LATEX_HEADER_EXTRA property, and the common stuff in #+LATEX_HEADER 
> lines, I think it should do what you want.  Org should combine these 
> properties rather than using the subtree property to override the global 
> ones.  Hope that helps!

Works perfectly. Thanks.

Scott



Re: [O] LaTeX Export

2017-08-10 Thread Richard Lawrence

Hi Scott,

Scott Randby  writes:

I tried this in the properties associated with a subtree:  

:export_latex_header: 
\hypersetup{pdfauthor={foo},pdftitle={foo},pdfsubject={foo},pdfkeywords={foo},pdfproducer={foo},pdfcreator={foo}} 

Unfortunately, all the other LaTeX headers are unrecognized when 
I do this.  


If you put the subtree-specific hypersetup in each subtree's 
EXPORT_LATEX_HEADER_EXTRA property, and the common stuff in 
#+LATEX_HEADER lines, I think it should do what you want.  Org 
should combine these properties rather than using the subtree 
property to override the global ones. 


Hope that helps!

--
Best,
Richard



[O] LaTeX Export

2017-08-09 Thread Scott Randby
I have a file with a large number of top-level headlines. Each subtree 
corresponding to a top-level headline is exported to its own PDF file. The 
subtrees all use the same LaTeX headers except for \hypersetup. Right now, I 
have to uncomment the \hypersetup manually whenever I export a subtree. I would 
like to have the export engine automatically recognize which \hypersetup to use 
instead.

I tried this in the properties associated with a subtree: 

:export_latex_header: 
\hypersetup{pdfauthor={foo},pdftitle={foo},pdfsubject={foo},pdfkeywords={foo},pdfproducer={foo},pdfcreator={foo}}

Unfortunately, all the other LaTeX headers are unrecognized when I do this. I 
could put all of the LaTeX headers in the properties of each subtree, but that 
would make it difficult to make universal changes to the overall style.

Is there some way to do what I want? Something like this?

:export_add_latex_header: 
\hypersetup{pdfauthor={foo},pdftitle={foo},pdfsubject={foo},pdfkeywords={foo},pdfproducer={foo},pdfcreator={foo}}

Scott Randby

-- 
Scott Randby

sran...@gmail.com

http://srandby.org/

PGP key ID: 0xF2D38A63

Key server: http://pool.sks-keyservers.net/

Key fingerprint: 5418 123E DCD3 7DA0 1770  0BDE 301E E657 F2D3 8A63



[O] LaTeX export of org file uses listings instead of minted, why?

2017-04-23 Thread vendo.li...@libero.it
Does this code from the backed-up .emacs interfere with TeX not working with 
MINTED in the body of the .tex file? Should I eliminate it? 
I'm thinking of posting all the bits of code where `minted' is mentioned, in 
the hopes that some of you experts can tell me whether I could eliminate/edit 
it. Please help me out!
Again, I'm using Org 8.2, Emacs 24 on a Win 7 32-bit machine (have no intention 
of upgrading, for now). Thank you in advance.

---(custom-set-variables
 ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you 
could mess it up, so be careful. ;; Your init file should contain only one such 
instance. ;; If there is more than one, they won't work right. 
'(ansi-color-faces-vector   [default default default italic underline success 
warning error]) '(cdlatex-math-symbol-prefix 64) '(custom-enabled-themes (quote 
(tango-dark))) '(org-format-latex-options   (quote(:foreground default 
:background default :scale 1.2 :html-foreground "Black" :html-background 
"Transparent" :html-scale 1.0 :matchers("begin" "$1" "$" "$$" "\\(" 
"\\[" '(org-latex-listings (quote minted)) '(org-latex-minted-langs   
(quote((emacs-lisp "common-lisp") (cc "c++") (cperl "perl") 
(shell-script "bash") (caml "ocaml") (latex "tex" 
'(org-latex-minted-options   (quote(("fontsize" "\\footnotesize") 
("bgcolor" "white") ("obeytabs" "true" '(org-startup-with-latex-preview 
nil) '(preview-default-document-pt 10) '(show-paren-mode t) 
'(transient-mark-mode (quote (only . 
t-


Re: [O] LaTeX export of org file uses listings instead of minted, why?

2017-04-23 Thread Kaushal Modi
Not an answer to the issue you are seeing, but I noticed that you are using
Emacs 24.x and Org-mode 8.2.x. The Org-mode version especially is too old.

I can only suggest that you update to the latest version of Org-mode mode
(9.0.5) (and also that of Emacs (25.2) if you get a chance), so that the
debug time is not spent on old versions.
-- 

Kaushal Modi


[O] LaTeX export of org file uses listings instead of minted, why?

2017-04-23 Thread vendo.li...@libero.it
Hello again, I'm still trying to find out why emacs doesn't pick up MINTED 
instead of LISTINGS to handle code blocks when exporting files from .org to 
.pdf, via .tex.
I backed-up my previous .emacs file (which had a lot of customization for 
Beamer, AUCTeX etc.), loaded Nick Dokos' minimal init file, restarted emacs 
then tried exporting a minimal working example (MWE) of an Org file. IT 
WORKS!!! (Even though the background color is Black and I'd like it to be 
White!)
I've tried exporting a more complicated Org file and it works too! (Albeit with 
a dark background that makes it hard to read some lines).
Now the question is how do I integrate these lines in my old .emacs file so 
that I can keep all other modes' settings AND export code flawlessly from Org 
mode?
This is the result of `C-h v org-latex-listings' variable given while .emacs 
file was open. In truth, this was its value also a couple of days ago, with my 
old .emacs file active.

--org-latex-listings
 is a variable defined in `ox-latex.el'.Its value is mintedOriginal value was 
nil--
Here's the very simple MWE of an Org 
file:#+TITLE: My 
Minted Experiment#+AUTHOR: me#+DATE: #+STARTUP: nolatexpreview#+OPTIONS: 
toc:nil#+LATEX_CLASS: article#+LATEX_CLASS_OPTIONS: [a4paper,10pt]#+ATTR_LATEX: 
:mode table :booktabs#+LATEX_HEADER: \usepackage{esdiff}#+LATEX_HEADER: 
\usepackage[version=4]{mhchem}#+LATEX_HEADER: 
\usepackage{amssymb}#+LATEX_HEADER: \usepackage{siunitx}#+LATEX_HEADER: 
\usepackage{booktabs}#+LATEX_HEADER: \setcounter{secnumdepth}{0}#+LATEX_HEADER: 
\usepackage[margin=1in]{geometry}#+LATEX_HEADER: \frenchspacing 
\allowdisplaybreaks#+LATEX_HEADER: \usepackage{fancyhdr}#+LATEX_HEADER: 
\pagestyle{fancy} % choose page-style#+LATEX_HEADER: \fancyhf{}  % erase and 
clean up#+LATEX_HEADER: \fancyhf[HLE,HRO]{\thepage} % H or F=Header or Footer, 
LCR=Left, Centre, Right#+LATEX_HEADER: \fancyhf[HC]{My minted experiment}
* SECTION#+BEGIN_SRC python print "there's some code here"; a= 
True;#+END_SRC---

Here's the TeX file generated with the Export command (C-c C-e l 
o)---% Created 
2017-04-23 Sun 
13:23\documentclass[a4paper,10pt]{article}\usepackage[utf8]{inputenc}\usepackage[T1]{fontenc}\usepackage{fixltx2e}\usepackage{graphicx}\usepackage{longtable}\usepackage{float}\usepackage{wrapfig}\usepackage{rotating}\usepackage[normalem]{ulem}\usepackage{amsmath}\usepackage{textcomp}\usepackage{marvosym}\usepackage{wasysym}\usepackage{amssymb}\usepackage{hyperref}\tolerance=1000\usepackage{minted}\usepackage{esdiff}\usepackage[version=4]{mhchem}\usepackage{amssymb}\usepackage{siunitx}\usepackage{booktabs}\setcounter{secnumdepth}{0}\usepackage[margin=1in]{geometry}\frenchspacing
 \allowdisplaybreaks\usepackage{fancyhdr}\pagestyle{fancy} % choose 
page-style\fancyhf{}  % erase and clean up\fancyhf[HLE,HRO]{\thepage} % H or 
F=Header or Footer, LCR=Left, Centre, Right\fancyhf[HC]{My minted 
experiment}\author{me}\date{}\title{My Minted Experiment}\hypersetup{  
pdfkeywords={},  pdfsubject={},  pdfcreator={Emacs 24.4.1 (Org mode 
8.2.10)}}\begin{document}
\maketitle
\section{SECTION}\label{sec-1}\begin{minted}[fontsize=\footnotesize,bgcolor=black,obeytabs=true]{python}
 print "there's some code here"; a= True;\end{minted}% Emacs 24.4.1 (Org mode 
8.2.10)\end{document}---
This is how the .emacs file looks now: 
- (server-start)
; (add-hook 'LaTeX-mode-hook 'turn-on-reftex) (setq reftex-plug-into-AUCTeX t)
;;; a key for tilde symbol(define-key key-translation-map (kbd "M-2") (kbd 
"~"));;; a key for backquote symbol(define-key key-translation-map (kbd "M-6") 
"")(define-key key-translation-map (kbd "M-9") (kbd "`"));;this one's only for 
CDLaTeX math insertion(define-key key-translation-map (kbd "C-1") (kbd "`"))
;; visual line word wrapping(global-visual-line-mode t)
;;automatically recognize org files(add-to-list 'auto-mode-alist '("\\.org\\'" 
. org-mode))
;; MINIMAL init FILE. HERE'S WHERE NICK'S INIT FILE STARTS
(add-to-list 'load-path "~/src/emacs/org/org-mode/lisp")
(require 'org-loaddefs)(require 'org)
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
(global-set-key "\C-cl" 'org-store-link)(global-set-key "\C-cc" 
'org-capture)(global-set-key "\C-ca" 'org-agenda)
;;; 
(setq org-latex-listings 'minted  org-latex-packages-alist '(("" "minted"))  
org-latex-pdf-process  '("pdflatex -shell-escape -interaction nonstopmode 
-output-directory %o %f""pdflatex -shell-escape -interaction nonstopmode 
-output-directory %o %f"))-


Re: [O] LaTeX export of org file uses listings instead of minted, why?

2017-04-19 Thread Nick Dokos
"vendo.li...@libero.it"  writes:

> Hello there!
> I'm having a bit of a problem telling emacs to use MINTED instead of LISTINGS 
> to handle code blocks
> enclosed within #+BEGIN_SRC and #+END_SRC when exporting from an org file. 
>
> I've had to Customize Org Groups using the GUI menu `Org' but as soon as I 
> close and restart emacs, it
> goes back to LISTINGS. I know this because when I export a minimum working 
> example org file, the
> resulting pdf does not recognize code. If I manually change the .tex file and 
> run it, it works
> perfectly.
>
> I've added a few lines into my .emac file (please find it attached to this 
> mail) but because it's
> uneven, often repetitive and scrappy, I suspect there's some conflict going 
> on which I, as a simple user
> of orgmode, am not able to detect.
>
> Can someone please check the file and tell me why emacs/orgmode keeps 
> reverting to LISTINGS every time I
> shut down and restart emacs?
>
> I'm running org mode 8.2, emacs 24 on a Windows 7 machine. I also have a 
> working TeX Live 2015 distro
> with MINTED pkg properly working in AUCTeX and I have python's pygmentize.exe 
> in my C:\Python27\Scrips\
>  directory. What am I missing? Can you help me fix this?
>
>

Is your .emacs read at all? From the SE exchange, I have my doubts, but a 
Windows user
might be able to steer you in the right direction.

I would use a minimal init file and invoke emacs with (the Windows equivalent 
of)

emacs -q -l /path/to/minimal/init/file

and then evaluate the variable

   C-h v org-latex-listings RET

and try to export your org file. The minimal init file should do the minimum 
possible.
Mine looks like this:

--8<---cut here---start->8---
(add-to-list 'load-path "~/src/emacs/org/org-mode/lisp")

(require 'org-loaddefs)
(require 'org)

(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))

(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-cc" 'org-capture)
(global-set-key "\C-ca" 'org-agenda)

;;; 
https://emacs.stackexchange.com/questions/32225/latex-export-uses-lstlisting-instead-of-minted-why#comment49631_32225

(setq org-latex-listings 'minted
  org-latex-packages-alist '(("" "minted"))
  org-latex-pdf-process
  '("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
"pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"))
--8<---cut here---end--->8---

and as I said on SE it works fine on Fedora 24 with emacs 26.0.50 and org-mode 
9.0.5.
That's more recent than yours but I tried it with org-mode 8.2.10 as well and 
it works
there too.

Can you post the org file and the resulting TeX file after this
experiment?

-- 
Nick




[O] LaTeX export of org file uses listings instead of minted, why?

2017-04-19 Thread vendo.li...@libero.it
Hello there!I'm having a bit of a problem telling emacs to use MINTED instead 
of LISTINGS to handle code blocks enclosed within #+BEGIN_SRC and #+END_SRC 
when exporting from an org file. 
I've had to Customize Org Groups using the GUI menu `Org' but as soon as I 
close and restart emacs, it goes back to LISTINGS. I know this because when I 
export a minimum working example org file, the resulting pdf does not recognize 
code. If I manually change the .tex file and run it, it works perfectly.
I've added a few lines into my .emac file (please find it attached to this 
mail) but because it's uneven, often repetitive and scrappy, I suspect there's 
some conflict going on which I, as a simple user of orgmode, am not able to 
detect.
Can someone please check the file and tell me why emacs/orgmode keeps reverting 
to LISTINGS every time I shut down and restart emacs?
I'm running org mode 8.2, emacs 24 on a Windows 7 machine. I also have a 
working TeX Live 2015 distro with MINTED pkg properly working in AUCTeX and I 
have python's pygmentize.exe in my C:\Python27\Scrips\  directory. What am I 
missing? Can you help me fix this?

.emacs
Description: Binary data


Re: [O] LaTeX export hline

2017-04-16 Thread Nicolas Goaziou
Hello,

Justen Rickert  writes:

> LaTeX export for five dashes - exports from org as
> \rule{\linewidth}{0.5pt}
> which then produces a pdf with a horizontal line having the width of the
> paragraph but indented. This means the line extends into the margin by the
> width
> of the indent.
>
> If I do \noindent\rule{\linewidth}{0.5pt} in org directly (the same in the
> tex
> file) it looks how I want in the pdf, not extending into the margin. I
> wonder if
> this is desired behavior somehow or a bug?

I don't think this is desired. It is now fixed.

Thank you.

Regards,

-- 
Nicolas Goaziou



[O] LaTeX export hline

2017-04-15 Thread Justen Rickert
Hello,

LaTeX export for five dashes - exports from org as
\rule{\linewidth}{0.5pt}
which then produces a pdf with a horizontal line having the width of the
paragraph but indented. This means the line extends into the margin by the
width
of the indent.

If I do \noindent\rule{\linewidth}{0.5pt} in org directly (the same in the
tex
file) it looks how I want in the pdf, not extending into the margin. I
wonder if
this is desired behavior somehow or a bug?

Thanks,
Justen


Re: [O] latex export creates "auto" directory

2017-03-03 Thread Colin Baxter
Hello Takeshi,

On Sat, Mar 04 2017, Takeshi Teshima wrote:

> I have a question regarding latex export.
>
> When I export an org-mode to a latex file, a directory named "auto" is
> created in the same folder as the tex file.
>
> However, I couldn't find what line in the source code of org-mode
> creates this directory.
>
> Does anyone know what causes this, or what variables can be used to
> control where the directory is created?

It allows AUCTeX to be aware of style files and multi-files. The default
is "auto/" in the working directory. However you set the directory
yourself. I have the settings:

(setq TeX-auto-local "/path/to/auto/dir") ;; Sets /auto/ directory.
(setq TeX-auto-save t) ;; Also sets lisp files to save in /auto/.

If you want to switch it off then try (setq TeX-auto-save nil). I have
never used that myself, so I don't know how successful it might be.

Best wishes

Colin.



Re: [O] latex export creates "auto" directory

2017-03-03 Thread George Kettleborough (EI)

On 03/03/17 15:55, Takeshi Teshima wrote:

I have a question regarding latex export.

When I export an org-mode to a latex file, a directory named "auto" is
created in the same folder as the tex file.

However, I couldn't find what line in the source code of org-mode
creates this directory.

Does anyone know what causes this, or what variables can be used to
control where the directory is created?



This is actually created by AucTeX. I guess if you open the latex source  
file in emacs then it gets created automatically if you have AucTeX  
installed.


It is documented here:  
https://www.gnu.org/software/auctex/manual/auctex/Parsing-Files.html




Re: [O] latex export creates "auto" directory

2017-03-03 Thread Takeshi Teshima

Dear Colin,

Thank you for that detailed information!

I'll try them.

Best regards,

Takeshi

On 2017/03/04 1:37, Colin Baxter wrote:

Hello Takeshi,

On Sat, Mar 04 2017, Takeshi Teshima wrote:


I have a question regarding latex export.

When I export an org-mode to a latex file, a directory named "auto" is
created in the same folder as the tex file.

However, I couldn't find what line in the source code of org-mode
creates this directory.

Does anyone know what causes this, or what variables can be used to
control where the directory is created?

It allows AUCTeX to be aware of style files and multi-files. The default
is "auto/" in the working directory. However you set the directory
yourself. I have the settings:

(setq TeX-auto-local "/path/to/auto/dir") ;; Sets /auto/ directory.
(setq TeX-auto-save t) ;; Also sets lisp files to save in /auto/.

If you want to switch it off then try (setq TeX-auto-save nil). I have
never used that myself, so I don't know how successful it might be.

Best wishes

Colin.





Re: [O] latex export creates "auto" directory

2017-03-03 Thread Takeshi Teshima

Hi Tom,
Thank you for the immediate and useful answer!
You've saved me a lot of time. Thank you!
Best regards,
Takeshi

On 2017/03/04 1:06, Thomas S. Dye wrote:

Aloha Takeshi Teshima,

Takeshi Teshima writes:


I have a question regarding latex export.

When I export an org-mode to a latex file, a directory named "auto" is
created in the same folder as the tex file.

However, I couldn't find what line in the source code of org-mode
creates this directory.

Does anyone know what causes this, or what variables can be used to
control where the directory is created?

The "auto" directory contains files used by AucTeX, independently of Org
mode.  I don't know how to tell AucTeX where to put the directory.

All the best,
Tom

--
Thomas S. Dye
http://www.tsdye.com





Re: [O] latex export creates "auto" directory

2017-03-03 Thread Thomas S. Dye
Aloha Takeshi Teshima,

Takeshi Teshima writes:

> I have a question regarding latex export.
>
> When I export an org-mode to a latex file, a directory named "auto" is
> created in the same folder as the tex file.
>
> However, I couldn't find what line in the source code of org-mode
> creates this directory.
>
> Does anyone know what causes this, or what variables can be used to
> control where the directory is created?

The "auto" directory contains files used by AucTeX, independently of Org
mode.  I don't know how to tell AucTeX where to put the directory.

All the best,
Tom

--
Thomas S. Dye
http://www.tsdye.com



[O] latex export creates "auto" directory

2017-03-03 Thread Takeshi Teshima

I have a question regarding latex export.

When I export an org-mode to a latex file, a directory named "auto" is  
created in the same folder as the tex file.


However, I couldn't find what line in the source code of org-mode  
creates this directory.


Does anyone know what causes this, or what variables can be used to  
control where the directory is created?




Re: [O] Latex export error: There's no line here to end, with an image with a caption

2017-01-18 Thread Takeshi Teshima

Hello Mr. Goaziou,
Thank you for the reply!

Wow, thank you. It worked. The problem seems to stem from my own config. 
It worked as I turned my personal settings off.


Best,
Takeshi

On 2017/01/19 7:38, Nicolas Goaziou wrote:

Hello,

Takeshi Teshima  writes:


When I try to export an org-mode file **that contains a figure with
a caption** with `#+OPTIONS: \n:t`, (See minimal example files)

to a pdf via latex-export, the exported latex file doesn't compile and
I get the following error:

```

LaTeX Error: There's no line here to end.

```

in the `*Org PDF LaTeX Output*` buffer. Thus this is an error from the
command line.

## [2]

So I go to the line of the .tex file that's specified in the error,
and the line always says:

``` latex

\end{figure}\\

```

It is fixed. Could you confirm it behaves as expected in non-trivial
cases?

Regards,






Re: [O] Latex export error: There's no line here to end, with an image with a caption

2017-01-18 Thread Nicolas Goaziou
Hello,

Takeshi Teshima  writes:

> When I try to export an org-mode file **that contains a figure with
> a caption** with `#+OPTIONS: \n:t`, (See minimal example files)
>
> to a pdf via latex-export, the exported latex file doesn't compile and
> I get the following error:
>
> ```
>
> LaTeX Error: There's no line here to end.
>
> ```
>
> in the `*Org PDF LaTeX Output*` buffer. Thus this is an error from the
> command line.
>
> ## [2]
>
> So I go to the line of the .tex file that's specified in the error,
> and the line always says:
>
> ``` latex
>
> \end{figure}\\
>
> ```

It is fixed. Could you confirm it behaves as expected in non-trivial
cases?

Regards,

-- 
Nicolas Goaziou



[O] Latex export error: There's no line here to end, with an image with a caption

2017-01-09 Thread Takeshi Teshima

Hi all,

A happy new year!

I have a problem with org-export-to-latex.

# What happens

## [1]

When I try to export an org-mode file **that contains a figure with a  
caption** with `#+OPTIONS: \n:t`, (See minimal example files)


to a pdf via latex-export, the exported latex file doesn't compile and I  
get the following error:


```

LaTeX Error: There's no line here to end.

```

in the `*Org PDF LaTeX Output*` buffer. Thus this is an error from the  
command line.


## [2]

So I go to the line of the .tex file that's specified in the error, and  
the line always says:


``` latex

\end{figure}\\

```


## [3]

If I remove the double backslashes by hand, and compile the generated  
.tex file from the command line, it produces a pdf correctly.



# My environment

I've checked this with:

[1] Org-mode version 8.3.6 (8.3.6-7-g4d7d52-elpa @ ~~~)

[2] Org-mode version 8.2.10 (release_8.2.10 @ ~~~)

[3] Org-mode version 9.0.3 (9.0.3-elpa @ ~~~)

, but the same errors occur.

(I normally use version 8. I know this is an old version. However, v9  
has another problem with #+TITLE: lines. See  
https://github.com/syl20bnr/spacemacs/issues/3246 for more details)



# Reproducing the error

## Files

Attached, please find the files for a minimum example.

- test.org

- test-2017-01-06-17-05-09.jpeg


## Procedure to reproduce:

1. Place the files in the same directory

2. $ emacs -q test.org

3. M-x org-latex-export-to-pdf

(Or instead of 2., your own emacs config will do)


# What I already found

- The caption is necessary to reproduce the error.

- The problem occurs with a single image.

- If I remove the double backslashes by hand, and compile the generated  
.tex file, it compiles correctly.


- The problem doesn't occur with `#+OPTIONS: \n:nil` (which is kind of  
trivial)



# Reference

A relevant thread can be found here:

https://lists.gnu.org/archive/html/emacs-orgmode/2016-09/msg2.html

but I couldn't find a solution there.


Anyone has any ideas? Any idea to bypass this problem may be a lifesaver  
for me.


#+OPTIONS: \n:t

#+CAPTION: test
[[./test-2017-01-06-17-05-09.jpeg]]


Re: [O] Latex export fails for plain lists deeper than four, works for html

2016-12-07 Thread Nicolas Goaziou
Hello,

Scott Otterson  writes:

> Hi Nicolas, thanks for trying to replicate this on Linux.  What happens for
> you if it doesn't crash?  Does the latex export just work and produce a pdf
> with a set of properly nested lists?

It produces a pdf with improperly nested lists (deeper levers are just
treated as level 4).

> Would you be willing to sent me .tex your latex export produces?  It seems
> unlikely, but maybe org use a different/additional latex library on Linux
> than it does in Windows.  Or alternatively, TexLive installs different/more
> libraries on Windows.  Anyway, it would be nice to figure it out.

Here it is.

Regards,

-- 
Nicolas Goaziou
% Created 2016-12-07 Wed 12:24
% Intended LaTeX compiler: pdflatex
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{grffile}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{textcomp}
\usepackage{amssymb}
\usepackage{capt-of}
\usepackage{hyperref}
\author{Nicolas Goaziou}
\date{\today}
\title{}
\hypersetup{
 pdfauthor={Nicolas Goaziou},
 pdftitle={},
 pdfkeywords={},
 pdfsubject={},
 pdfcreator={Emacs 25.1.1 (Org mode 9.0.1)}, 
 pdflang={English}}
\begin{document}

\tableofcontents

\begin{enumerate}
\item level 1.1
\begin{enumerate}
\item level 2.1
\begin{enumerate}
\item level 3.1
\begin{enumerate}
\item level 4.1
\begin{enumerate}
\item level 5.1 (works if this level is deleted)
\item level 5.2 (works if this level is deleted)
\end{enumerate}
\item level 4.2
\end{enumerate}
\item level 3.2
\end{enumerate}
\item level 2.2
\end{enumerate}
\item level 1.2
\end{enumerate}
\end{document}


Re: [O] Latex export fails for plain lists deeper than four, works for html

2016-12-05 Thread Scott Otterson
Hi Nicolas, thanks for trying to replicate this on Linux.  What happens for
you if it doesn't crash?  Does the latex export just work and produce a pdf
with a set of properly nested lists?

Would you be willing to sent me .tex your latex export produces?  It seems
unlikely, but maybe org use a different/additional latex library on Linux
than it does in Windows.  Or alternatively, TexLive installs different/more
libraries on Windows.  Anyway, it would be nice to figure it out.

I googled quickly for the hint you mentioned but couldn't find it.

On Sat, Dec 3, 2016 at 10:10 PM, Nicolas Goaziou 
wrote:

> Hello,
>
> Scott Otterson  writes:
>
> > If a plain list has more than four levels, org-mode will produce latex
> that
> > crashes.  See attached.  On the other hand, html export works fine, even
> > for much deeper lists.
> >
> > In a large org file, this export error is pretty time consuming for a
> naive
> > user (me) to isolate, so I'd like to suggest that, before crashing
> latexmk,
> > org-mode should at least print a human-readable warning -- especially
> since
> > deep list export works for other export types.
> >
> > Better yet, would be deeper latex lists.  There are ways:
> >
> > http://tex.stackexchange.com/questions/41408/a-five-level-deep-list
> > 1. level 1.1
> >1. level 2.1
> >   1. level 3.1
> >  1. level 4.1
> > 1. level 5.1 (works if this level is deleted)
> > 2. level 5.2 (works if this level is deleted)
> >  2. level 4.2
> >   2. level 3.2
> >2. level 2.2
> > 2. level 1.2
>
> Again, this doesn't crash here.
>
> Also, the manual already gives hint about how to support more than four
> levels of nesting for lists.
>
> Regards,
>
> --
> Nicolas Goaziou
>


Re: [O] Latex export fails for plain lists deeper than four, works for html

2016-12-03 Thread Nicolas Goaziou
Hello,

Scott Otterson  writes:

> If a plain list has more than four levels, org-mode will produce latex that
> crashes.  See attached.  On the other hand, html export works fine, even
> for much deeper lists.
>
> In a large org file, this export error is pretty time consuming for a naive
> user (me) to isolate, so I'd like to suggest that, before crashing latexmk,
> org-mode should at least print a human-readable warning -- especially since
> deep list export works for other export types.
>
> Better yet, would be deeper latex lists.  There are ways:
>
> http://tex.stackexchange.com/questions/41408/a-five-level-deep-list
> 1. level 1.1
>1. level 2.1
>   1. level 3.1
>  1. level 4.1
> 1. level 5.1 (works if this level is deleted)
> 2. level 5.2 (works if this level is deleted)
>  2. level 4.2
>   2. level 3.2
>2. level 2.2
> 2. level 1.2

Again, this doesn't crash here. 

Also, the manual already gives hint about how to support more than four
levels of nesting for lists.

Regards,

-- 
Nicolas Goaziou



[O] Latex export fails for plain lists deeper than four, works for html

2016-12-03 Thread Scott Otterson
If a plain list has more than four levels, org-mode will produce latex that
crashes.  See attached.  On the other hand, html export works fine, even
for much deeper lists.

In a large org file, this export error is pretty time consuming for a naive
user (me) to isolate, so I'd like to suggest that, before crashing latexmk,
org-mode should at least print a human-readable warning -- especially since
deep list export works for other export types.

Better yet, would be deeper latex lists.  There are ways:

http://tex.stackexchange.com/questions/41408/a-five-level-deep-list


only4plainListLevels.org
Description: Binary data


Re: [O] latex export: can I add an optional argument to an item?

2016-12-02 Thread Eric S Fraga
On Friday,  2 Dec 2016 at 10:35, Alan Schmitt wrote:
> Thank you for the suggestion. With macros that makes for a quite elegant
> solution.

You're welcome.  And, yes, with macros, many LaTeX aspects can be
incorporated easily without making everything look a mess.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 26.0.50.1, Org release_9.0.1-83-g305ff7


signature.asc
Description: PGP signature


Re: [O] latex export: can I add an optional argument to an item?

2016-12-02 Thread Alan Schmitt
Hi Eric,

On 2016-12-02 09:52, Eric S Fraga  writes:

> I know you've had some answers but if you want exactly what you
> specified in LaTeX, the following will do it:
>
> * intro
> This is a list
> - @@latex:[\(\checkmark\)]@@ and so on
> - normal item

Thank you for the suggestion. With macros that makes for a quite elegant
solution.

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2016-10: 401.57, 2015-10: 398.29


signature.asc
Description: PGP signature


Re: [O] latex export: can I add an optional argument to an item?

2016-12-02 Thread Eric S Fraga
On Thursday,  1 Dec 2016 at 09:04, Alan Schmitt wrote:
> Hello,
>
> I would like to generate the following latex export:
>
> \begin{itemize}
> \item[\Checkmark] foo
> \end{itemize}
>
> I tried both
>
> -[\Checkmark]
>
> and
>
> - [\Checkmark]
>
> but neither works.
>
> Is this possible with org-mode?

I know you've had some answers but if you want exactly what you
specified in LaTeX, the following will do it:

--8<---cut here---start->8---
* intro
This is a list
- @@latex:[\(\checkmark\)]@@ and so on
- normal item
--8<---cut here---end--->8---


(I don't have Checkmark defined so used checkmark instead)

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 26.0.50.1, Org release_9.0.1-83-g305ff7


signature.asc
Description: PGP signature


Re: [O] latex export: can I add an optional argument to an item?

2016-12-02 Thread Alan Schmitt
Hello Richard,

On 2016-12-01 11:36, Richard Lawrence  writes:

>> I would like to generate the following latex export:
>>
>> \begin{itemize}
>> \item[\Checkmark] foo
>> \end{itemize}
>
> It's not exactly pretty, but you can use a description list while
> resetting it to the itemize environment, like:
>
> #+ATTR_LATEX: :environment itemize  
>   - \Checkmark :: foo
>
> That produces:
>
> \begin{itemize}
> \item[{\Checkmark}] foo
> \end{itemize}
>
> At least, that works for me (I have not yet upgraded to Org 9.0;
> so I don't know if this will continue to work, though I don't know of
> any reason why it shouldn't). 

It works great (on current org), thanks a lot!

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2016-10: 401.57, 2015-10: 398.29


signature.asc
Description: PGP signature


Re: [O] latex export: can I add an optional argument to an item?

2016-12-01 Thread Richard Lawrence
Hi Alan,

Alan Schmitt  writes:

> I would like to generate the following latex export:
>
> \begin{itemize}
> \item[\Checkmark] foo
> \end{itemize}

It's not exactly pretty, but you can use a description list while
resetting it to the itemize environment, like:

#+ATTR_LATEX: :environment itemize  
  - \Checkmark :: foo

That produces:

\begin{itemize}
\item[{\Checkmark}] foo
\end{itemize}

At least, that works for me (I have not yet upgraded to Org 9.0;
so I don't know if this will continue to work, though I don't know of
any reason why it shouldn't). 

Hope that helps!

Best,
Richard



[O] latex export: can I add an optional argument to an item?

2016-12-01 Thread Alan Schmitt
Hello,

I would like to generate the following latex export:

\begin{itemize}
\item[\Checkmark] foo
\end{itemize}

I tried both

-[\Checkmark]

and

- [\Checkmark]

but neither works.

Is this possible with org-mode?

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2016-10: 401.57, 2015-10: 398.29


signature.asc
Description: PGP signature


Re: [O] latex-export + columnview: misinterpretation of section prefixes as emphasis

2016-06-24 Thread Lele Gaifax
Nicolas Goaziou  writes:

> All your "Effort" values are expressed as HH:MM so Org does its best to
> produce a HH:MM summary. If you write at least one value as a duration,
> e.g., "10 h", the summary will also be expressed as a duration.

I see, thank you!
ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
l...@metapensiero.it  | -- Fortunato Depero, 1929.




Re: [O] latex-export + columnview: misinterpretation of section prefixes as emphasis

2016-06-24 Thread Nicolas Goaziou
Lele Gaifax  writes:

> This is the equivalent, made with current master development org-mode:
>
> # -*- coding: utf-8 -*-
>
> #+TITLE: Test with current master revision of org-mode
> #+COLUMNS: %40ITEM(Item) %13Effort(Effort){:} %CLOCKSUM(Work)
>
>
> * This is a test
>   :LOGBOOK:
>   CLOCK: [2016-06-21 mar 13:40]--[2016-06-24 ven 13:43] => 72:03
>   :END:
>
>
> #+BEGIN: columnview :hlines 1 :id global
> | Item   | Effort | Work |
>
> |++--|
> | This is a test |  30:00 | 3gg 0:03 |
> | Task A |  10:00 |  |
> | Task B |  10:00 |  |
> | Task C |  10:00 |  |
> #+END:
>
> ** Task A
>:PROPERTIES:
>:Effort:   10:00
>:END:
>
> ** Task B
>:PROPERTIES:
>:Effort:   10:00
>:END:
>
> ** Task C
>:PROPERTIES:
>:Effort:   10:00
>:END:

All your "Effort" values are expressed as HH:MM so Org does its best to
produce a HH:MM summary. If you write at least one value as a duration,
e.g., "10 h", the summary will also be expressed as a duration.


Regards,



Re: [O] latex-export + columnview: misinterpretation of section prefixes as emphasis

2016-06-24 Thread Lele Gaifax
Nicolas Goaziou  writes:

> Lele Gaifax  writes:
>
>> One minor issue: previously I used a custom setting for the variable
>> `org-time-clocksum-format`, to print something like "2gg 03:10" instead of 
>> "2d
>> 03:10". With the version currently distributed with Emacs 25.1 it was used 
>> for
>> both the "effort" and "clocksum" columns, now only on the latter (matching
>> name and documentation). Is there an equivalent setting for the "effort"
>> sum, to get a table with the two columns sharing the same style?
>
> I don't think so, but I may be wrong. Anyway, you can define your own
> summary function (and formatter) in Org colums. See
> `org-columns-summary-types' for details.

This is a simple file, made with the version of org-mode that comes from
current Emacs 25 branch:

# -*- coding: utf-8 -*-
#+TITLE: Test with Emacs 25.0.95 org-mode
#+COLUMNS: %40ITEM(Item) %13Effort(Effort){:} %CLOCKSUM(Work)

* This is a test
  CLOCK: [2016-06-21 mar 13:40]--[2016-06-24 ven 13:43] => 72:03

#+BEGIN: columnview :hlines 1 :id global
| Item |   Effort | Work |
|--+--+--|
| * This is a test | 1gg 6:00 | 3gg 0:03 |
| ** Task A|10:00 |  |
| ** Task B|10:00 |  |
| ** Task C|10:00 |  |
#+END:

** Task A
   :PROPERTIES:
   :Effort:   10:00
   :END:

** Task B
   :PROPERTIES:
   :Effort:   10:00
   :END:

** Task C
   :PROPERTIES:
   :Effort:   10:00
   :END:

# Local Variables:
# org-time-clocksum-format: (:days "%dgg " :hours "%d" :require-hours t 
:minutes ":%02d" :require-minutes t)
# End:

This is the equivalent, made with current master development org-mode:

# -*- coding: utf-8 -*-
#+TITLE: Test with current master revision of org-mode
#+COLUMNS: %40ITEM(Item) %13Effort(Effort){:} %CLOCKSUM(Work)

* This is a test
  :LOGBOOK:
  CLOCK: [2016-06-21 mar 13:40]--[2016-06-24 ven 13:43] => 72:03
  :END:

#+BEGIN: columnview :hlines 1 :id global
| Item   | Effort | Work |
|++--|
| This is a test |  30:00 | 3gg 0:03 |
| Task A |  10:00 |  |
| Task B |  10:00 |  |
| Task C |  10:00 |  |
#+END:

** Task A
   :PROPERTIES:
   :Effort:   10:00
   :END:

** Task B
   :PROPERTIES:
   :Effort:   10:00
   :END:

** Task C
   :PROPERTIES:
   :Effort:   10:00
   :END:

# Local Variables:
# org-time-clocksum-format: (:days "%dgg " :hours "%d" :require-hours t 
:minutes ":%02d" :require-minutes t)
# End:

Can you reproduce the case?

>> BTW, in lisp/org-colview.el there is what seems a typo in the name of the
>> function `org-columns-hscoll-title`: since accordingly with "git grep" it is
>> referenced in two places and only in that source, is the following
>> acceptable?
>
> Sure. Could you provide a proper commit message and send the patch using
> "git format-patch" command? See
>  for details.

Sure, I will do that ASAP!

Thank you,
ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
l...@metapensiero.it  | -- Fortunato Depero, 1929.




Re: [O] latex-export + columnview: misinterpretation of section prefixes as emphasis

2016-06-24 Thread Nicolas Goaziou
Hello,

Lele Gaifax  writes:

> One minor issue: previously I used a custom setting for the variable
> `org-time-clocksum-format`, to print something like "2gg 03:10" instead of "2d
> 03:10". With the version currently distributed with Emacs 25.1 it was used for
> both the "effort" and "clocksum" columns, now only on the latter (matching
> name and documentation). Is there an equivalent setting for the "effort"
> sum, to get a table with the two columns sharing the same style?

I don't think so, but I may be wrong. Anyway, you can define your own
summary function (and formatter) in Org colums. See
`org-columns-summary-types' for details.

> BTW, in lisp/org-colview.el there is what seems a typo in the name of the
> function `org-columns-hscoll-title`: since accordingly with "git grep" it is
> referenced in two places and only in that source, is the following
> acceptable?

Sure. Could you provide a proper commit message and send the patch using
"git format-patch" command? See
 for details.

Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] latex-export + columnview: misinterpretation of section prefixes as emphasis

2016-06-23 Thread Lele Gaifax
Nicolas Goaziou  writes:

>> Do you know if/when it will be merged into Emacs?
>
> I don't know, but that will not happen before Emacs 25.1 release.

Thanks anyway, I installed latest development sources and I appreciate the
work that has been done in this (and many other) areas: the new colview
produces a much nicer LaTeX!

One minor issue: previously I used a custom setting for the variable
`org-time-clocksum-format`, to print something like "2gg 03:10" instead of "2d
03:10". With the version currently distributed with Emacs 25.1 it was used for
both the "effort" and "clocksum" columns, now only on the latter (matching
name and documentation). Is there an equivalent setting for the "effort"
sum, to get a table with the two columns sharing the same style? I tried to
look around in the sources and in the doc but I missed it...

BTW, in lisp/org-colview.el there is what seems a typo in the name of the
function `org-columns-hscoll-title`: since accordingly with "git grep" it is
referenced in two places and only in that source, is the following acceptable?

diff --git a/lisp/org-colview.el b/lisp/org-colview.el
index e29f88a..6809305 100644
--- a/lisp/org-colview.el
+++ b/lisp/org-colview.el
@@ -438,9 +438,9 @@ for the duration of the command.")
   (org-add-props " " nil 'display '(space :align-to 0))
   (org-add-props (substring title 0 -1) nil 'face 
'org-column-title)))
 (setq org-columns-previous-hscroll -1)
-(add-hook 'post-command-hook 'org-columns-hscoll-title nil 'local)))
+(add-hook 'post-command-hook 'org-columns-hscroll-title nil 'local)))

-(defun org-columns-hscoll-title ()
+(defun org-columns-hscroll-title ()
   "Set the `header-line-format' so that it scrolls along with the table."
   (sit-for .0001) ; need to force a redisplay to update window-hscroll
   (when (not (= (window-hscroll) org-columns-previous-hscroll))
@@ -463,7 +463,7 @@ for the duration of the command.")
   (when (local-variable-p 'org-previous-header-line-format)
(setq header-line-format org-previous-header-line-format)
(kill-local-variable 'org-previous-header-line-format)
-   (remove-hook 'post-command-hook 'org-columns-hscoll-title 'local))
+   (remove-hook 'post-command-hook 'org-columns-hscroll-title 'local))
   (move-marker org-columns-begin-marker nil)
   (move-marker org-columns-top-level-marker nil)
   (org-with-silent-modifications

Thanks a lot,
bye, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
l...@metapensiero.it  | -- Fortunato Depero, 1929.




Re: [O] latex-export + columnview: misinterpretation of section prefixes as emphasis

2016-06-22 Thread Nicolas Goaziou
Hello,

Lele Gaifax  writes:

> Do you know if/when it will be merged into Emacs?

I don't know, but that will not happen before Emacs 25.1 release.

Regards,

-- 
Nicolas Goaziou



Re: [O] latex-export + columnview: misinterpretation of section prefixes as emphasis

2016-06-22 Thread Lele Gaifax
Nicolas Goaziou  writes:

> Lele Gaifax  writes:
>
>> I know this is an ancient thread, but it seems the problem is still there, in
>> Emacs 25.
>
> "org-colview" was rewritten recently. IIRC, this is fixed in development
> version of Org.

Great, thank you!

Do you know if/when it will be merged into Emacs? I will probably try it out
on my own machine, but I guess a few coworkers won't be going to install it
from upstream repos...

bye, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
l...@metapensiero.it  | -- Fortunato Depero, 1929.




Re: [O] latex-export + columnview: misinterpretation of section prefixes as emphasis

2016-06-22 Thread Nicolas Goaziou
Hello,

Lele Gaifax  writes:

> I know this is an ancient thread, but it seems the problem is still there, in
> Emacs 25.

"org-colview" was rewritten recently. IIRC, this is fixed in development
version of Org.

Regards,

-- 
Nicolas Goaziou



Re: [O] latex-export + columnview: misinterpretation of section prefixes as emphasis

2016-06-22 Thread Lele Gaifax
Hi all,

I know this is an ancient thread, but it seems the problem is still there, in
Emacs 25.

FWIW, this is my quick and dirty fix, that at least produce a readable output,
in Emacs as well as in the PDF output.

(require 'org-colview)

;; Quick workaround to 
http://article.gmane.org/gmane.emacs.orgmode/25821: replace
;; asterisks with some other character in the table automatically built by 
org-colview, because
;; when the table is exported to LaTeX they are misinterpreted as emphasis 
markup, resulting in
;; an unreadable hierarchy.

(defun esk/org-replace-section-prefix (s)
  "Replace asterisks in  Org heading with em-dashes."
  (when (string-match org-outline-regexp-bol s)
(setq s (replace-match
 (concat (make-string (- (match-end 0) (match-beginning 0) 1) 
?—)
 " ")
 t t s)))
  s)

(defun org-listtable-to-string (tbl)
  "Convert a listtable TBL to a string that contains the Org-mode table.
The table still need to be aligned.  The resulting string has no leading
and trailing newline characters."
  (mapconcat
   (lambda (x)
 (cond
  ((listp x)
   (concat "|" (esk/org-replace-section-prefix (mapconcat 'identity x 
"|")) "|"))
  ((eq x 'hline) "|-|")
  (t (error "Garbage in listtable: %s" x
   tbl "\n"))

Of course I'll be happy to hear about any better way to do it!

ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
l...@metapensiero.it  | -- Fortunato Depero, 1929.




[O] LaTeX export with listings: unknown language "calc"

2016-02-13 Thread Axel Kielhorn
Hello!

I use some calc in my org document:

#+begin_SRC calc :var x=5 :var y=2 :exports both
  2 + a * x ** y
#+end_SRC 

When I export this to LaTeX the listings package complains about an unknown 
language calc.

To fix this I simply define a language:

#+LATEX_HEADER: \usepackage{listings}
#+LATEX_HEADER: \lstdefinelanguage{calc}{morekeywords={}}

Is this the correct way to do this?
Should this be added to the documentation?

Regards Axel


Re: [O] LaTeX export with listings: unknown language "calc"

2016-02-13 Thread Eric S Fraga
On Saturday, 13 Feb 2016 at 16:35, Axel Kielhorn wrote:
> Hello!
>
> I use some calc in my org document:
>
> #+begin_SRC calc :var x=5 :var y=2 :exports both
>   2 + a * x ** y
> #+end_SRC 
>
> When I export this to LaTeX the listings package complains about an
> unknown language calc.
>
> To fix this I simply define a language:
>
> #+LATEX_HEADER: \usepackage{listings}
> #+LATEX_HEADER: \lstdefinelanguage{calc}{morekeywords={}}

Basically, yes.  I have

#+latex_header: \lstdefinelanguage{calc}{}

for the second line.

> Is this the correct way to do this?
> Should this be added to the documentation?

Probably...
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.90.1, Org release_8.3.3-565-g4f499f



Re: [O] LaTeX export with section number, name and page in internal links

2015-12-09 Thread Richard Lawrence
John Kitchin  writes:

>> I do something like this with custom link types.
> Aha! I am not the only one ;)
>
>>
>> First of all, have a look at the variable
>>
>> org-latex-prefer-user-labels
>
> Is this a new 8.3 variable? It doesn't seem to be in my 8.2.10 MELPA
> version.

Yes, I believe it is new in 8.3, although it originated in a patch I
wrote quite a while ago (February 2014?) when I needed this behavior.

> I like your idea. I think you could simplify it to just:
>
> (org-add-link-type
>  "sec"
>  (lambda (path)
>(org-open-link-from-string (format "[[#%s]]" path)))
>  ...

Ah, nice, that is way simpler.  Thanks!

Best,
Richard



Re: [O] LaTeX export with section number, name and page in internal links

2015-12-08 Thread Ken Mankoff

> 03.12.2015, 16:31, "John Kitchin" :
>
> Try this.
> 
> * Chapter 1
> ** Section 1.1 \label{manual-section-1}
> :PROPERTIES:
> :CUSTOM_ID: section-1
> :END:
> * Chapter 2
> ** Section 2.1
> I want reference to Section 1.1 from here (See Section \ref
> {manual-section-1} on page \pageref{manual-section-1})

This, and its limitations (what if the pageref is on the same page?) is why 
fancyref was created. I think the solution here is to have a

#+LATEX_HEADER: \renewcommand{\fref}{\ref}

or something like that, but I'm not sure of the exact syntax.

  -k.



Re: [O] LaTeX export with section number, name and page in internal links

2015-12-08 Thread Richard Lawrence
Hi Ilya,

Ilya  writes:

> I export my Org-Mode notes with internal links to LaTeX and I want it to
> look like this ''Section 1.1 [Section name], page 99'' (Like in the Org
> Manual). I use this construction:
>
> #+BEGIN_EXAMPLE
>  * Chapter 1
>  ** Section 1.1
> :PROPERTIES:
> :CUSTOM_ID: section-1
> :END:
>  * Chapter 2
>  ** Section 2.1
> I want reference to Section 1.1 from here (See #section-1)
> #+END_EXAMPLE
>
> But as a result I get only the number of the section ''1.1'', not the
> ''Section 1.1 [Section name], page 99''.
> What options I need to use?

I do something like this with custom link types.

First of all, have a look at the variable

org-latex-prefer-user-labels

if you haven't already.  Setting it will cause Org to use CUSTOM_ID
properties to generate labels, so you don't need to manually insert your
own.

I use the following bit of Elisp to define some link types for referring
to sections this way.  You could modify this to insert the LaTeX command
you're interested in (as opposed to just \ref{}).  With your example
above, you'd write something like

#+BEGIN_EXAMPLE
I want reference to Section 1.1 from here (See [[sec:section-1]]).
#+END_EXAMPLE

Here's the code:
#+BEGIN_SRC elisp
;; Link types for targeting sections, tables, etc.
;; These assume that headlines with CUSTOM_ID defined will export using
;; that value as their \label keys.
(defun org-find-headline-by-custom-id (prefix path)
  "Find a headline in the current buffer by CUSTOM_ID value PREFIX:PATH."
  (save-excursion
(goto-char (point-min))
 (and
  ; borrowed from org.el; there doesn't seem to be a function that searches
  ; for a headline with a specific property value
  (re-search-forward
   (concat "^[ \t]*:CUSTOM_ID:[ \t]+" prefix ":" path "[ \t]*$") nil t)
  (setq pos (match-beginning 0
   (if pos
   (progn
 (goto-char pos)
 (org-back-to-heading t))
 (message (format "Headline with CUSTOM_ID %s:%s not found." prefix path

(defun org-export-dissertation-link (prefix path desc format)
  "Export a link to a dissertation section, etc.

In LaTeX, the exported link will look like:
  DESC~\\ref{PREFIX:PATH}
"
(when (member format '(latex linguistics))
  (format "%s~\\ref{%s:%s}" desc prefix path)))

; Sections:
(org-add-link-type
 "sec"
 (lambda (path)
   (org-find-headline-by-custom-id "sec" path))
 (lambda (path desc format)
   (org-export-dissertation-link "sec" path (or desc "Section") format)))

; etc. etc.
#+END_SRC elisp

Best,
Richard

OpenPGP Key ID: CF6FA646
Fingerprint: 9969 43E1 CF6F A646

(See http://www.ocf.berkeley.edu/~rwl/encryption.html for more information.)



Re: [O] LaTeX export with section number, name and page in internal links

2015-12-08 Thread John Kitchin

> I do something like this with custom link types.
Aha! I am not the only one ;)

>
> First of all, have a look at the variable
>
> org-latex-prefer-user-labels

Is this a new 8.3 variable? It doesn't seem to be in my 8.2.10 MELPA
version.

>
> if you haven't already.  Setting it will cause Org to use CUSTOM_ID
> properties to generate labels, so you don't need to manually insert your
> own.
>
> I use the following bit of Elisp to define some link types for referring
> to sections this way.  You could modify this to insert the LaTeX command
> you're interested in (as opposed to just \ref{}).  With your example
> above, you'd write something like

I like your idea. I think you could simplify it to just:

(org-add-link-type
 "sec"
 (lambda (path)
   (org-open-link-from-string (format "[[#%s]]" path)))
 (lambda (path desc format)
   (cond
((eq format 'latex)
 (format "%s~\\ref{%s}" (or desc "Section") path)

and refer to [[sec:section-1]] that looks like this below.

** some title
   :PROPERTIES:
   :CUSTOM_ID: section-1
   :END:
>
> #+BEGIN_EXAMPLE
> I want reference to Section 1.1 from here (See [[sec:section-1]]).
> #+END_EXAMPLE
>
> Here's the code:
> #+BEGIN_SRC elisp
> ;; Link types for targeting sections, tables, etc.
> ;; These assume that headlines with CUSTOM_ID defined will export using
> ;; that value as their \label keys.
> (defun org-find-headline-by-custom-id (prefix path)
>   "Find a headline in the current buffer by CUSTOM_ID value PREFIX:PATH."
>   (save-excursion
> (goto-char (point-min))
>  (and
>   ; borrowed from org.el; there doesn't seem to be a function that 
> searches
>   ; for a headline with a specific property value
>   (re-search-forward
>(concat "^[ \t]*:CUSTOM_ID:[ \t]+" prefix ":" path "[ \t]*$") nil t)
>   (setq pos (match-beginning 0
>(if pos
>(progn
>(goto-char pos)
>(org-back-to-heading t))
>  (message (format "Headline with CUSTOM_ID %s:%s not found." prefix 
> path
>
> (defun org-export-dissertation-link (prefix path desc format)
>   "Export a link to a dissertation section, etc.
>
> In LaTeX, the exported link will look like:
>   DESC~\\ref{PREFIX:PATH}
> "
> (when (member format '(latex linguistics))
>   (format "%s~\\ref{%s:%s}" desc prefix path)))
>
> ; Sections:
> (org-add-link-type
>  "sec"
>  (lambda (path)
>(org-find-headline-by-custom-id "sec" path))
>  (lambda (path desc format)
>(org-export-dissertation-link "sec" path (or desc "Section") format)))
>
> ; etc. etc.
> #+END_SRC elisp
>
> Best,
> Richard
>
> OpenPGP Key ID: CF6FA646
> Fingerprint: 9969 43E1 CF6F A646
>
> (See http://www.ocf.berkeley.edu/~rwl/encryption.html for more information.)

--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



Re: [O] LaTeX export with section number, name and page in internal links

2015-12-07 Thread Ilya Filippov
Thank you, it is work, but I hope to use something like (setq org-export-latex-hyperref-format "\\ref{%s}") for hyperref customization. (I want join \\ref{%s} and \\pageref{%s} for org-export-latex-hyperref-format). If it will be work we may simple use [[#section-1]] to different templates for internal references, also like ''Section 1.1 [Section name], page 99''.03.12.2015, 16:31, "John Kitchin" :Try this.* Chapter 1** Section 1.1  \label{manual-section-1}    :PROPERTIES:    :CUSTOM_ID: section-1    :END:* Chapter 2** Section 2.1I want reference to Section 1.1 from here (See Section \ref{manual-section-1} on page \pageref{manual-section-1})John---Professor John Kitchin Doherty Hall A207FDepartment of Chemical EngineeringCarnegie Mellon UniversityPittsburgh, PA 15213412-268-7803@johnkitchinhttp://kitchingroup.cheme.cmu.edu
On Thu, Dec 3, 2015 at 6:08 AM, Ilya  wrote:I export my Org-Mode notes with internal links to LaTeX and I want it to
look like this ''Section 1.1 [Section name], page 99'' (Like in the Org
Manual). I use this construction:

#+BEGIN_EXAMPLE
 * Chapter 1
 ** Section 1.1
    :PROPERTIES:
    :CUSTOM_ID: section-1
    :END:
 * Chapter 2
 ** Section 2.1
I want reference to Section 1.1 from here (See #section-1)
#+END_EXAMPLE

But as a result I get only the number of the section ''1.1'', not the
''Section 1.1 [Section name], page 99''.
What options I need to use?

Here
(http://emacs.stackexchange.com/questions/18547/org-mode-latex-export-with-section-number-name-and-page-in-internal-links),
I was advised to use a Fancyref, but I have no idea how I may use it with
Org-Mode syntax.



- - - - - - - - - - -Ilya FilippovYugra State University (Chekhova str. 16, Khanty-Mansiysk, Tyumen' Region, Russian Federation, 628012):  1. Environmental Dynamics & Global Climate Change Research Centre, Senior Engineer2. Biology Chair, Docent3. Journal of Environmental Dynamics & Global Climate Change, Editorial Board MemberGoogleScholar profile: http://scholar.google.ru/citations?user=Prc5qkMJ Tel: +79088817605

[O] LaTeX export with section number, name and page in internal links

2015-12-07 Thread Ilya Filippov
I export my Org-Mode notes with internal links to LaTeX and I want it to look 
like this ''Section 1.1 [Section name], page 99'' (Like in the Org Manual). I 
use this construction:

#+BEGIN_EXAMPLE
 * Chapter 1
 ** Section 1.1
:PROPERTIES:
:CUSTOM_ID: section-1
:END:
 * Chapter 2
 ** Section 2.1
I want reference to Section 1.1 from here (See #section-1)
#+END_EXAMPLE

But as a result I get only the number of the section ''1.1'', not the ''Section 
1.1 [Section name], page 99''. 
What options I need to use?

Here 
(http://emacs.stackexchange.com/questions/18547/org-mode-latex-export-with-section-number-name-and-page-in-internal-links),
 I was advised to use a Fancyref, but I have no idea how I may use it with 
Org-Mode syntax.

- - - - - - - - - - -
Ilya Filippov
Yugra State University (Khanty-Mansiysk)




Re: [O] Latex export: How to handle multiple authors, emails, institutes

2015-12-04 Thread Eric S Fraga
On Thursday, 26 Nov 2015 at 16:26, Fatma Başak Aydemir wrote:
> Hi all,
>
> I'm trying to write a conference paper which has multiple authors from 
> multiple institues. I tried to insert author infor by adding the 
> following block
>
> #+BEGIN_LaTeX
> \author{First Author\inst{1}, Second Author\inst{1}, Third Author\inst{2}}
> \authorrunning{Author et al.}
> \institute{University of X, Country\\
> \email{\{f.author, s.author\}@uX.edu}
> \and
> University of Y, CountryY\\
> \email{\{t.author\}@uY.edu}}
> #+END_LATEX

This does not work because LaTeX blocks are inserted *after* the
\begin{document} line.  You need to put this all in the preamble which
you can achieve using Tom's suggestion (define a new LaTeX class for
org) and/or using #+latex_header: lines.

I have a combination of these for articles for Springer
books/journals.  I define the following org LaTeX class, based on the
author.tex example I got from the Springer templates:

#+begin_src emacs-lisp
  (add-to-list 'org-latex-classes
   '("springer" "\\documentclass[graybox]{svmult}
  % choose options for [] as required from the list
  % in the Reference Guide
  \\usepackage{mathptmx}   % selects Times Roman as basic font
  \\usepackage{helvet} % selects Helvetica as sans-serif font
  \\usepackage{courier}% selects Courier as typewriter font
  \\usepackage{type1cm}% activate if the above 3 fonts are
  % not available on your system
  %
  \\usepackage{makeidx} % allows index generation
  \\usepackage{graphicx}% standard LaTeX graphics tool
   % when including figure files
  \\usepackage{multicol}% used for the two-column index
  \\usepackage[bottom]{footmisc}% places footnotes at page bottom

  % see the list of further useful packages
  % in the Reference Guide

  \\makeindex % used for the subject index
 % please use the style svind.ist with
 % your makeindex program
"
 ("\\section{%s}" . "\\section*{%s}")
 ("\\subsection{%s}" . "\\subsection*{%s}")
 ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
 ("\\paragraph{%s}" . "\\paragraph*{%s}")
 ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
#+end_src

and then use this in my org file for the publication as follows:

#+begin_src org
  ,#+latex_class: springer
  # Article/chapter specific information: title, authors, institution
  ,#+title: The full title of the chapter
  ,#+author: The authors
  ,#+latex_header: \titlerunning{The running title for long titles} 
  ,#+latex_header: \institute{The institute information}
  # I also include article/chapter specific requirements here
  # beyond those required by the Springer class
  ,#+latex_header: \usepackage{algorithm}
  ,* The paper starts here
#+end_src

I hope this helps.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.2, Org release_8.3.2-363-g5c13a6



Re: [O] Latex export: How to handle multiple authors, emails, institutes

2015-12-04 Thread John Kitchin
I have also done something like this for different journals here:

https://github.com/jkitchin/jmax/blob/master/ox-manuscript.el#L64


Eric S Fraga writes:

> On Thursday, 26 Nov 2015 at 16:26, Fatma Başak Aydemir wrote:
>> Hi all,
>>
>> I'm trying to write a conference paper which has multiple authors from
>> multiple institues. I tried to insert author infor by adding the
>> following block
>>
>> #+BEGIN_LaTeX
>> \author{First Author\inst{1}, Second Author\inst{1}, Third Author\inst{2}}
>> \authorrunning{Author et al.}
>> \institute{University of X, Country\\
>> \email{\{f.author, s.author\}@uX.edu}
>> \and
>> University of Y, CountryY\\
>> \email{\{t.author\}@uY.edu}}
>> #+END_LATEX
>
> This does not work because LaTeX blocks are inserted *after* the
> \begin{document} line.  You need to put this all in the preamble which
> you can achieve using Tom's suggestion (define a new LaTeX class for
> org) and/or using #+latex_header: lines.
>
> I have a combination of these for articles for Springer
> books/journals.  I define the following org LaTeX class, based on the
> author.tex example I got from the Springer templates:
>
> #+begin_src emacs-lisp
>   (add-to-list 'org-latex-classes
>'("springer" "\\documentclass[graybox]{svmult}
>   % choose options for [] as required from the list
>   % in the Reference Guide
>   \\usepackage{mathptmx}   % selects Times Roman as basic font
>   \\usepackage{helvet} % selects Helvetica as sans-serif font
>   \\usepackage{courier}% selects Courier as typewriter font
>   \\usepackage{type1cm}% activate if the above 3 fonts are
>   % not available on your system
>   %
>   \\usepackage{makeidx} % allows index generation
>   \\usepackage{graphicx}% standard LaTeX graphics tool
>% when including figure files
>   \\usepackage{multicol}% used for the two-column index
>   \\usepackage[bottom]{footmisc}% places footnotes at page bottom
>
>   % see the list of further useful packages
>   % in the Reference Guide
>
>   \\makeindex % used for the subject index
>  % please use the style svind.ist with
>  % your makeindex program
> "
>  ("\\section{%s}" . "\\section*{%s}")
>  ("\\subsection{%s}" . "\\subsection*{%s}")
>  ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
>  ("\\paragraph{%s}" . "\\paragraph*{%s}")
>  ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
> #+end_src
>
> and then use this in my org file for the publication as follows:
>
> #+begin_src org
>   ,#+latex_class: springer
>   # Article/chapter specific information: title, authors, institution
>   ,#+title: The full title of the chapter
>   ,#+author: The authors
>   ,#+latex_header: \titlerunning{The running title for long titles}
>   ,#+latex_header: \institute{The institute information}
>   # I also include article/chapter specific requirements here
>   # beyond those required by the Springer class
>   ,#+latex_header: \usepackage{algorithm}
>   ,* The paper starts here
> #+end_src
>
> I hope this helps.

--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



[O] LaTeX export with section number, name and page in internal links

2015-12-03 Thread Ilya
I export my Org-Mode notes with internal links to LaTeX and I want it to
look like this ''Section 1.1 [Section name], page 99'' (Like in the Org
Manual). I use this construction:

#+BEGIN_EXAMPLE
 * Chapter 1
 ** Section 1.1
:PROPERTIES:
:CUSTOM_ID: section-1
:END:
 * Chapter 2
 ** Section 2.1
I want reference to Section 1.1 from here (See #section-1)
#+END_EXAMPLE

But as a result I get only the number of the section ''1.1'', not the
''Section 1.1 [Section name], page 99''.
What options I need to use?

Here
(http://emacs.stackexchange.com/questions/18547/org-mode-latex-export-with-section-number-name-and-page-in-internal-links),
I was advised to use a Fancyref, but I have no idea how I may use it with
Org-Mode syntax.




Re: [O] LaTeX export with section number, name and page in internal links

2015-12-03 Thread John Kitchin
Try this.

* Chapter 1
** Section 1.1  \label{manual-section-1}
:PROPERTIES:
:CUSTOM_ID: section-1
:END:
* Chapter 2
** Section 2.1
I want reference to Section 1.1 from here (See Section
\ref{manual-section-1} on page \pageref{manual-section-1})



John

---
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu


On Thu, Dec 3, 2015 at 6:08 AM, Ilya  wrote:

> I export my Org-Mode notes with internal links to LaTeX and I want it to
> look like this ''Section 1.1 [Section name], page 99'' (Like in the Org
> Manual). I use this construction:
>
> #+BEGIN_EXAMPLE
>  * Chapter 1
>  ** Section 1.1
> :PROPERTIES:
> :CUSTOM_ID: section-1
> :END:
>  * Chapter 2
>  ** Section 2.1
> I want reference to Section 1.1 from here (See #section-1)
> #+END_EXAMPLE
>
> But as a result I get only the number of the section ''1.1'', not the
> ''Section 1.1 [Section name], page 99''.
> What options I need to use?
>
> Here
> (
> http://emacs.stackexchange.com/questions/18547/org-mode-latex-export-with-section-number-name-and-page-in-internal-links
> ),
> I was advised to use a Fancyref, but I have no idea how I may use it with
> Org-Mode syntax.
>
>
>


[O] Latex export: How to handle multiple authors, emails, institutes

2015-11-26 Thread Fatma Başak Aydemir

Hi all,

I'm trying to write a conference paper which has multiple authors from 
multiple institues. I tried to insert author infor by adding the 
following block


#+BEGIN_LaTeX
\author{First Author\inst{1}, Second Author\inst{1}, Third Author\inst{2}}
\authorrunning{Author et al.}
\institute{University of X, Country\\
\email{\{f.author, s.author\}@uX.edu}
\and
University of Y, CountryY\\
\email{\{t.author\}@uY.edu}}
#+END_LATEX

I failed (the title says no institute given, does not show emails) since 
the latex block is inserted after \maketitle command. How can insert 
author & institue information in the header?


If related, I'm using Springer LNCS style, org v 20151123.

Best,

--

Fatma Başak Aydemir
PhD Student at ICT International Doctoral School
Department of Information Engineering and Computer Science
University of Trento
Skype: fatmabasak.aydemir
E-mail: ayde...@disi.unitn.it




Re: [O] Latex export: How to handle multiple authors, emails, institutes

2015-11-26 Thread Rainer M Krug


Envoyé de mon iPhone

> Le 26 nov. 2015 à 16:26, Fatma Başak Aydemir  a écrit :
> 
> Hi all,
> 
> I'm trying to write a conference paper which has multiple authors from 
> multiple institues. I tried to insert author infor by adding the following 
> block
> 
> #+BEGIN_LaTeX
> \author{First Author\inst{1}, Second Author\inst{1}, Third Author\inst{2}}
> \authorrunning{Author et al.}
> \institute{University of X, Country\\
> \email{\{f.author, s.author\}@uX.edu}
> \and
> University of Y, CountryY\\
> \email{\{t.author\}@uY.edu}}
> #+END_LATEX
> 
> I failed (the title says no institute given, does not show emails) since the 
> latex block is inserted after \maketitle command. How can insert author & 
> institue information in the header?
> 

Check the

#+Latx_header:

Directive - it is added line by line to the preamble. 

Cheers, 

Rainer 

> If related, I'm using Springer LNCS style, org v 20151123.
> 
> Best,
> 
> -- 
> 
> Fatma Başak Aydemir
> PhD Student at ICT International Doctoral School
> Department of Information Engineering and Computer Science
> University of Trento
> Skype: fatmabasak.aydemir
> E-mail: ayde...@disi.unitn.it
> 
> 



Re: [O] Latex export: How to handle multiple authors, emails, institutes

2015-11-26 Thread Thomas S . Dye
Aloha Fatma Başak Aydemir,

Fatma Başak Aydemir  writes:

> Hi all,
>
> I'm trying to write a conference paper which has multiple authors from 
> multiple institues. I tried to insert author infor by adding the 
> following block
>
> #+BEGIN_LaTeX
> \author{First Author\inst{1}, Second Author\inst{1}, Third Author\inst{2}}
> \authorrunning{Author et al.}
> \institute{University of X, Country\\
> \email{\{f.author, s.author\}@uX.edu}
> \and
> University of Y, CountryY\\
> \email{\{t.author\}@uY.edu}}
> #+END_LATEX
>
> I failed (the title says no institute given, does not show emails) since 
> the latex block is inserted after \maketitle command. How can insert 
> author & institue information in the header?
>
> If related, I'm using Springer LNCS style, org v 20151123.

One way is to define a "my-Springer-LNCS" class and add it to
org-latex-classes.

Here is an example that meets the preamble format required by the
journal PLOS One.  In the PLOS One requirement, author edits to the
preamble are restricted to the space between the ** EDIT HERE **
comments.  So, for this style, you'd just add your LaTeX code between
the ** EDIT HERE ** comments.

(add-to-list 'org-latex-classes
 '("plos-devel"
   "\\documentclass[10pt]{article}
[NO-DEFAULT-PACKAGES]
[PACKAGES]
[EXTRA]
\\doublespacing
% Text layout
\\topmargin 0.0cm
\\oddsidemargin 0.5cm
\\evensidemargin 0.5cm
\\textwidth 16cm 
\\textheight 21cm
\\bibliographystyle{plos2009}
\\makeatletter
\\renewcommand{\\@biblabel}[1]{\\quad#1.}
\\makeatother
\\pagestyle{myheadings}
%% ** EDIT HERE **
\\DeclareCaptionLabelFormat{si}{#1S#2}

%% ** EDIT HERE **
%% PLEASE INCLUDE ALL MACROS BELOW
%% \\newcommand{\\texttwosuperior}{$^{2}$}
%% \\newcommand{\\textpm}{$\\pm$}
\\newcommand{\\rc}{$^{14}C$}
%% END MACROS SECTION"
 ("\\section{%s}" . "\\section*{%s}")
 ("\\subsection{%s}" . "\\subsection*{%s}")
 ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
 ("\\paragraph{%s}" . "\\paragraph*{%s}")
 ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))

hth,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com



Re: [O] Latex export: How to handle multiple authors, emails, institutes

2015-11-26 Thread Fatma Başak Aydemir

Aloha!

Both solutions work for me. I went for adding the code line by line 
using #+LATEX_HEADER for I do not collaborate with the same co-authors 
all the time so I did not want to permanenetly add the configuration to 
my setup.


Thanks!

26/11/15 16:59 tarihinde Thomas S. Dye yazdı:

Aloha Fatma Başak Aydemir,

Fatma Başak Aydemir  writes:


Hi all,

I'm trying to write a conference paper which has multiple authors from
multiple institues. I tried to insert author infor by adding the
following block

#+BEGIN_LaTeX
\author{First Author\inst{1}, Second Author\inst{1}, Third Author\inst{2}}
\authorrunning{Author et al.}
\institute{University of X, Country\\
\email{\{f.author, s.author\}@uX.edu}
\and
University of Y, CountryY\\
\email{\{t.author\}@uY.edu}}
#+END_LATEX

I failed (the title says no institute given, does not show emails) since
the latex block is inserted after \maketitle command. How can insert
author & institue information in the header?

If related, I'm using Springer LNCS style, org v 20151123.

One way is to define a "my-Springer-LNCS" class and add it to
org-latex-classes.

Here is an example that meets the preamble format required by the
journal PLOS One.  In the PLOS One requirement, author edits to the
preamble are restricted to the space between the ** EDIT HERE **
comments.  So, for this style, you'd just add your LaTeX code between
the ** EDIT HERE ** comments.

 (add-to-list 'org-latex-classes
  '("plos-devel"
"\\documentclass[10pt]{article}
 [NO-DEFAULT-PACKAGES]
 [PACKAGES]
 [EXTRA]
 \\doublespacing
 % Text layout
 \\topmargin 0.0cm
 \\oddsidemargin 0.5cm
 \\evensidemargin 0.5cm
 \\textwidth 16cm
 \\textheight 21cm
 \\bibliographystyle{plos2009}
 \\makeatletter
 \\renewcommand{\\@biblabel}[1]{\\quad#1.}
 \\makeatother
 \\pagestyle{myheadings}
 %% ** EDIT HERE **
 \\DeclareCaptionLabelFormat{si}{#1S#2}
 
 %% ** EDIT HERE **

 %% PLEASE INCLUDE ALL MACROS BELOW
 %% \\newcommand{\\texttwosuperior}{$^{2}$}
 %% \\newcommand{\\textpm}{$\\pm$}
 \\newcommand{\\rc}{$^{14}C$}
 %% END MACROS SECTION"
  ("\\section{%s}" . "\\section*{%s}")
  ("\\subsection{%s}" . "\\subsection*{%s}")
  ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
  ("\\paragraph{%s}" . "\\paragraph*{%s}")
  ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))

hth,
Tom



--

Fatma Başak Aydemir
PhD Student at ICT International Doctoral School
Department of Information Engineering and Computer Science
University of Trento
Skype: fatmabasak.aydemir
E-mail: ayde...@disi.unitn.it




Re: [O] Latex export or Latex tangle? Best practice?

2015-04-27 Thread Charles C. Berry

On Mon, 27 Apr 2015, Lawrence Bottorff wrote:


In a previous post I was getting at the issue of whether I should just do
regular export or use latex code blocks for what I wanted in a final
document. What I want is the ability to create a big, rambling, annotated
org file -- with keeper stuff inside the latex babel blocks -- then
tangle the .org file, thereby leaving all the annotations and lead-up notes
behind. I'm sure I'm not alone in wanting notes to evolve into a
finished product and orgmode would seem to offer a good path. So, I don't
want to have to hand-edit out my so-called annotations. Is keeping the good
stuff in latex babel blocks a best practice?

LB



I sometimes use noweb references for the purpose of having either a 
concise code block to tangle or a document for export that draws on code 
blocks elsewhere in the document.


From what I see higher in this thread, I recommend that you export a 
subtree that includes src blocks with noweb refs. Whatever latex 
boilerplate you need can be :EXPORT_*: properties. see


(info (org) Noweb reference syntax)

and the paragraphs at the end of

(info (org) Export settings)

HTH,

Chuck



[O] Latex export or Latex tangle? Best practice?

2015-04-27 Thread Lawrence Bottorff
In a previous post I was getting at the issue of whether I should just do
regular export or use latex code blocks for what I wanted in a final
document. What I want is the ability to create a big, rambling, annotated
org file -- with keeper stuff inside the latex babel blocks -- then
tangle the .org file, thereby leaving all the annotations and lead-up notes
behind. I'm sure I'm not alone in wanting notes to evolve into a
finished product and orgmode would seem to offer a good path. So, I don't
want to have to hand-edit out my so-called annotations. Is keeping the good
stuff in latex babel blocks a best practice?

LB


Re: [O] Latex export or Latex tangle? Best practice?

2015-04-27 Thread Ista Zahn
I would use LaTeX code blocks when I need to write something in LaTeX
that isn't easy to write in org mode, not to distinguish what is a
note and what is part of the draft. For that I recommend comments,
e.g.,


### Start example ###

* Section 1
** COMMENT Some rough draft notes to myself
 yadda yadda more badda
** Some stuff that should be exported
This is the actual important stuff that should be exported
*** More stuff that should be exported
yadda yada
*** COMMENT More notes and stuff don't export
*** Export this one too
bla bla

### End example ###

When you export the commented sections will be excluded.

Best,
Ista
On Mon, Apr 27, 2015 at 2:12 PM, Lawrence Bottorff borg...@gmail.com wrote:
 In a previous post I was getting at the issue of whether I should just do
 regular export or use latex code blocks for what I wanted in a final
 document. What I want is the ability to create a big, rambling, annotated
 org file -- with keeper stuff inside the latex babel blocks -- then tangle
 the .org file, thereby leaving all the annotations and lead-up notes behind.
 I'm sure I'm not alone in wanting notes to evolve into a finished
 product and orgmode would seem to offer a good path. So, I don't want to
 have to hand-edit out my so-called annotations. Is keeping the good stuff in
 latex babel blocks a best practice?

 LB



Re: [O] LaTeX export and org-add-link-type

2014-07-29 Thread Fabrice Niessen
Leonard Avery Randall wrote:
 Serge Cohen writes:
 Is this normal, if so is there another way to obtain the same results
 as what is proposed in the documentation ?

 The behaviour you are explaining is not normal.  The setup you described
 should work.

 To complete the post : I am using Aquamacs (MacOSX gui-version), based
 on GNU emacs 23.4.1 The included version of org.el is Version: 6.33x

 Herein lies your problem.  6.33 is a very old version of org. I tested
 the old Aquamacs 2.5 with org 6.33 and it does not work.  You should
 update your org version and probably your emacs as well.  I tested your
 code on the newer Aquamacs 3.0 release and it works.  If you like the
 Aquamacs key commands then 3.0 is a reasonable bet. It comes with org
 7.9.3. Other good distros for OSX can be acquired through macports,
 homebrew, or emacsforosx.  All of these are fairly integrated into the
 osx environment (the homebrew distro comes with a few config options so
 you may want to look to see which one is best for you).

 Regarding org mode version, I would recommend the most recent version
 which is available through melpa.  If you have a lot of stuff in your
 org configuration file, updating to org version 8.x requires a bit of
 work, but the new backend should be stable, so you want have to fiddle
 too much with your init file in the future.

 Once you upgrade to emacs 24, adding new packages is fairly easy through
 package.el. Just add this snippet to your init file.

 (when (= emacs-major-version 24)
   (require 'package)
   (package-initialize)
   (add-to-list 'package-archives 
   '(melpa . http://melpa.milkbox.net/packages/;) t))

 Then to upgrade to the latest version of org-mode just press `M-x package
 install RET org-plus-contrib RET'. 

Note that using custom link types is -- in my opinion -- outperformed by
the Org macros. For example, because custom link types limit you to
2 arguments, no more.

With macros, you can have as many as you want (or at least 9?), and you
can also easily convert the macro code per back-end; for example:

  #+MACRO: cite @@latex:\cite{$1}odt:\cite{$1}@@

Note that I'm planning to write a set of default (useful) Org macros,
and publish them.

My project is currently on GitHub: https://github.com/fniessen/org-macros.

See documentation on
http://htmlpreview.github.io/?https://github.com/fniessen/org-macros/blob/master/README.html.

Best regards,
Fabrice

-- 
Fabrice Niessen
Leuven, Belgium
http://www.pirilampo.org/




[O] LaTeX export and org-add-link-type

2014-07-21 Thread Serge Cohen
Hello list,

When using hte org to LaTeX exporter, I would like to use the link-type 
capabilities described here :
http://orgmode.org/worg/org-contrib/babel/examples/article-class.html#sec-3

To follow the instruction, I have added the lines to my ~/.emacs.el

(org-add-link-type
 ltx nil
 (lambda (path desc format)
   (cond
((eq format 'html)
 (format span style=\color:grey;\ class=\%s\%s/span path desc))
((eq format 'latex)
 (format \\%s{%s} path desc)

I have even added the following call just after that (but I have the feeling 
this is un-necessary, since should already be done within org-add-link-type 
function).

(org-make-link-regexps)

Then adding a [[ltx:foo][albert]] to an org file, and exporting to a HTML 
buffer, I get what I am expecting :
span style=color:grey; class=foobar/span

But when I export to a LaTeX buffer, irrelevant to what I use as link/path I 
get :
\texttt{bar}

To me this means that the org-link-type mechanism is bypassed when exporting to 
LaTeX (indeed from org-latex.el , I have the feeling that the function 
org-export-latex-link is taking care of the link parsing, without carrign for 
the content of org-link-types nor org-link-types-re).

Is this normal, if so is there another way to obtain the same results as what 
is proposed in the documentation ?

To complete the post : I am using Aquamacs (MacOSX gui-version), based on GNU 
emacs 23.4.1
The included version of org.el is Version: 6.33x

Hoping someone will be able to point me to the right direction. Thanks in 
advance,

Serge.




signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [O] LaTeX export and org-add-link-type

2014-07-21 Thread Leonard Avery Randall
Hi Serge,

Serge Cohen writes:


 Is this normal, if so is there another way to obtain the same results
 as what is proposed in the documentation ?

The behaviour you are explaining is not normal.  The setup you described
should work.

 To complete the post : I am using Aquamacs (MacOSX gui-version), based
 on GNU emacs 23.4.1 The included version of org.el is Version: 6.33x

Herein lies your problem.  6.33 is a very old version of org. I tested
the old Aquamacs 2.5 with org 6.33 and it does not work.  You should
update your org version and probably your emacs as well.  I tested your
code on the newer Aquamacs 3.0 release and it works.  If you like the
Aquamacs key commands then 3.0 is a reasonable bet. It comes with org
7.9.3. Other good distros for OSX can be acquired through macports,
homebrew, or emacsforosx.  All of these are fairly integrated into the
osx environment (the homebrew distro comes with a few config options so
you may want to look to see which one is best for you).

Regarding org mode version, I would recommend the most recent version
which is available through melpa.  If you have a lot of stuff in your
org configuration file, updating to org version 8.x requires a bit of
work, but the new backend should be stable, so you want have to fiddle
too much with your init file in the future.

Once you upgrade to emacs 24, adding new packages is fairly easy through
package.el. Just add this snippet to your init file.

(when (= emacs-major-version 24)
  (require 'package)
  (package-initialize)
  (add-to-list 'package-archives 
  '(melpa . http://melpa.milkbox.net/packages/;) t))

Then to upgrade to the latest version of org-mode just press `M-x package
install RET org-plus-contrib RET'. 

Hope this helps.

All best,
Leonard

-- 
Leonard A. Randall
PhD Candidate
Departments of Philosophy
University of St Andrews



Re: [O] LaTeX export problem

2014-07-16 Thread Nicolas Goaziou
Hello,

t...@tsdye.com (Thomas S. Dye) writes:

 With a recent Org from git and this source:

   #+attr_latex: :width 0.8\textwidth :placement [htb]
   #+name: fig:harris-errors
   #+caption[Structural effects of false transitives]: Structural effects of 
 false transitives with the stratigraphic section in Figure [[fig:fig12-open]]:

 I get this incorrect LaTeX output:

[...]

 If I place a space between the final colon and the link on the
 first #+caption: line, then I get the output I'm expecting (although
 there is the extraneous space):

[...]


This is because regexp finding short captions is greedy. It thus catches
everything up to the last ]: in the first line, making the link
invalid.

 Is there a work-around?

Just make sure the line containing the short caption doesn't end with
]:, e.g.,

  ...
  #+caption[Structural effects of false transitives]:
  #+caption: Structural effects of false transitives with the stratigraphic 
section in Figure [[fig:fig12-open]]:
  ...


Regards,

-- 
Nicolas Goaziou



Re: [O] LaTeX export problem

2014-07-16 Thread Thomas S. Dye
Aloha Nicolas,

Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 Hello,

 t...@tsdye.com (Thomas S. Dye) writes:

 With a recent Org from git and this source:

   #+attr_latex: :width 0.8\textwidth :placement [htb]
   #+name: fig:harris-errors
   #+caption[Structural effects of false transitives]: Structural effects of 
 false transitives with the stratigraphic section in Figure 
 [[fig:fig12-open]]:

 I get this incorrect LaTeX output:

 [...]

 If I place a space between the final colon and the link on the
 first #+caption: line, then I get the output I'm expecting (although
 there is the extraneous space):

 [...]


 This is because regexp finding short captions is greedy. It thus catches
 everything up to the last ]: in the first line, making the link
 invalid.

 Is there a work-around?

 Just make sure the line containing the short caption doesn't end with
 ]:, e.g.,

   ...
   #+caption[Structural effects of false transitives]:
   #+caption: Structural effects of false transitives with the stratigraphic 
 section in Figure [[fig:fig12-open]]:
   ...

Perfect.  Thanks!

All the best,
Tom

-- 
T.S. Dye  Colleagues, Archaeologists
735 Bishop St, Suite 315, Honolulu, HI 96813
Tel: 808-529-0866, Fax: 808-529-0884
http://www.tsdye.com



[O] LaTeX export problem

2014-07-13 Thread Thomas S. Dye
Aloha all,

With a recent Org from git and this source:

  #+attr_latex: :width 0.8\textwidth :placement [htb]
  #+name: fig:harris-errors
  #+caption[Structural effects of false transitives]: Structural effects of 
false transitives with the stratigraphic section in Figure [[fig:fig12-open]]:
  #+caption: /left/, a Harris Matrix of contexts adjacent to Context 1 with 
false transitives for Contexts 5 and 6;
  #+caption: /right/, a directed graph of contexts adjacent to Context 1 that 
excludes false transitives.
  #+caption: The observed stratigraphic relationships for the two diagrams are 
shown on Table [[tab:harris-errors]].
  
[[file:~/Public/projects/936-harris-matrix/figure/fig-12-harris-td-adj-1-tred-edited.pdf]]

I get this incorrect LaTeX output:

  \begin{figure}[htb]
  \centering
  
\includegraphics[width=0.8\textwidth]{/Users/dk/Public/projects/936-harris-matrix/figure/fig-12-harris-td-adj-1-tred-edited.pdf}
  \caption[Structural effects of false transitives]: Structural effects of 
false transitives with the stratigraphic section in 
Figure~[[fig:fig12-open]]{\label{fig:harris-errors}\emph{left}, a Harris Matrix 
of contexts adjacent to Context 1 with false transitives for Contexts 5 and 6; 
\emph{right}, a directed graph of contexts adjacent to Context 1 that excludes 
false transitives. The observed stratigraphic relationships for the two 
diagrams are shown on Table~\ref{tab:harris-errors}.}
  \end{figure}

If I place a space between the final colon and the link on the
first #+caption: line, then I get the output I'm expecting (although
there is the extraneous space):

 \begin{figure}[htb]
 \centering
 
\includegraphics[width=0.8\textwidth]{/Users/dk/Public/projects/936-harris-matrix/figure/fig-12-harris-td-adj-1-tred-edited.pdf}
 \caption[Structural effects of false 
transitives]{\label{fig:harris-errors}Structural effects of false transitives 
with the stratigraphic section in Figure~\ref{fig:fig12-open} : \emph{left}, a 
Harris Matrix of contexts adjacent to Context 1 with false transitives for 
Contexts 5 and 6; \emph{right}, a directed graph of contexts adjacent to 
Context 1 that excludes false transitives. The observed stratigraphic 
relationships for the two diagrams are shown on Table~\ref{tab:harris-errors}.}
 \end{figure}

Is there a work-around?

All the best,
Tom

-- 
T.S. Dye  Colleagues, Archaeologists
735 Bishop St, Suite 315, Honolulu, HI 96813
Tel: 808-529-0866, Fax: 808-529-0884
http://www.tsdye.com



[O] latex export for 4th-level heading

2014-07-10 Thread Ken Mankoff

When exporting to LaTeX, fourth-level headings become \enumerate. In
LaTeX, the item below \subsubsection is \paragraph, not \enumerate.

Here is what happens:

* Top becomes \section
** Second becomes \subsection
*** Third becomes \subsubsection
 Fourth becomes \enumerate

Is there a way to set Fourth to either \paragraph or just nothing?

 -k.



Re: [O] latex export for 4th-level heading

2014-07-10 Thread Thomas S. Dye
Aloha Ken,

Ken Mankoff mank...@gmail.com writes:

 When exporting to LaTeX, fourth-level headings become \enumerate. In
 LaTeX, the item below \subsubsection is \paragraph, not \enumerate.

 Here is what happens:

 * Top becomes \section
 ** Second becomes \subsection
 *** Third becomes \subsubsection
  Fourth becomes \enumerate

 Is there a way to set Fourth to either \paragraph or just nothing?

Only the first three outline levels will be used as headings. Deeper
levels will become itemized lists. You can change the location of this
switch globally by setting the variable org-export-headline-levels, or
on a per-file basis with a line

 #+OPTIONS: H:4


hth,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com



Re: [O] latex export for 4th-level heading

2014-07-10 Thread Ken Mankoff

* On 2014-07-10 at 17:08, Thomas S. Dye wrote:
 Aloha Ken,

 Ken Mankoff mank...@gmail.com writes:

 When exporting to LaTeX, fourth-level headings become \enumerate. In
 LaTeX, the item below \subsubsection is \paragraph, not \enumerate.

 Here is what happens:

 * Top becomes \section
 ** Second becomes \subsection
 *** Third becomes \subsubsection
  Fourth becomes \enumerate

 Is there a way to set Fourth to either \paragraph or just nothing?

 Only the first three outline levels will be used as headings. Deeper
 levels will become itemized lists. You can change the location of this
 switch globally by setting the variable org-export-headline-levels, or
 on a per-file basis with a line

  #+OPTIONS: H:4


Thanks. That makes sense. I thought that was just for controlling the
TOC depth, but it makes sense it controls content headings too.

  -k.



Re: [O] latex export for 4th-level heading

2014-07-10 Thread Thomas S. Dye
Ken Mankoff mank...@gmail.com writes:

 * On 2014-07-10 at 17:08, Thomas S. Dye wrote:
 Aloha Ken,

 Ken Mankoff mank...@gmail.com writes:

 When exporting to LaTeX, fourth-level headings become \enumerate. In
 LaTeX, the item below \subsubsection is \paragraph, not \enumerate.

 Here is what happens:

 * Top becomes \section
 ** Second becomes \subsection
 *** Third becomes \subsubsection
  Fourth becomes \enumerate

 Is there a way to set Fourth to either \paragraph or just nothing?

 Only the first three outline levels will be used as headings. Deeper
 levels will become itemized lists. You can change the location of this
 switch globally by setting the variable org-export-headline-levels, or
 on a per-file basis with a line

  #+OPTIONS: H:4


 Thanks. That makes sense. I thought that was just for controlling the
 TOC depth, but it makes sense it controls content headings too.

The table of contents is normally inserted directly before the first
headline of the file.

 #+OPTIONS: toc:2  (only to two levels in TOC)
 #+OPTIONS: toc:nil(no TOC at all)

hth,
Tom

-- 
T.S. Dye  Colleagues, Archaeologists
735 Bishop St, Suite 315, Honolulu, HI 96813
Tel: 808-529-0866, Fax: 808-529-0884
http://www.tsdye.com



Re: [O] LaTex export questions

2014-06-02 Thread Alan Tyree
Thanks for the kind words, Martin. I hope you stay inspired since making a
few homemade paperbacks sounds like something I'd like to try.

Cheers,
Alan


On 31 May 2014 17:25, Martin Schöön martin.sch...@gmail.com wrote:

 On 28 May 2014 06:31, Alan Tyree typh...@aanet.com.au wrote:

 Hi Steven,
 You want to learn more about LaTeX, but it's not too much.

 I wrote a little book called Self-publishing with LyX that will help you
 set up the title page as well as some of your other problems. This is not a
 sales pitch -- it's free :-).

  Self-publishing with LyX
 ISBN: 978-0-9803-3242-1
 http://www.lulu.com/content/1085870

 Cheers,
 Alan


 I half-way through your book and it is a good read! I am a long-time LyX
 fan so you are preaching for the choir ad far as I am concerned :-)

 Now I feel tempted (inspired) to  create a small DIY book binding
 introduction. I have experimented with this a bit and find you can do
 decent paperbacks with very limited resources.

 --
 Martin Schöön

 http://hem.bredband.net/b262106/index.html




-- 
Alan L Tyreehttp://www2.austlii.edu.au/~alan
Tel:  04 2748 6206


Re: [O] LaTex export questions

2014-05-31 Thread Martin Schöön
On 28 May 2014 06:31, Alan Tyree typh...@aanet.com.au wrote:

 Hi Steven,
 You want to learn more about LaTeX, but it's not too much.

 I wrote a little book called Self-publishing with LyX that will help you
 set up the title page as well as some of your other problems. This is not a
 sales pitch -- it's free :-).

  Self-publishing with LyX
 ISBN: 978-0-9803-3242-1
 http://www.lulu.com/content/1085870

 Cheers,
 Alan


I half-way through your book and it is a good read! I am a long-time LyX
fan so you are preaching for the choir ad far as I am concerned :-)

Now I feel tempted (inspired) to  create a small DIY book binding
introduction. I have experimented with this a bit and find you can do
decent paperbacks with very limited resources.

-- 
Martin Schöön

http://hem.bredband.net/b262106/index.html


Re: [O] LaTex export questions

2014-05-28 Thread Steven Arntson
Hi Alan,

I downloaded the book and went through it--thank you for putting that
together! It was a valuable overview. Nonetheless, some confusions
persist for me since I'm using emacs org-mode and not LyX. Should I be
putting LaTeX markup into my org-mode doc, for instance, for formatting
the title page, c?

Also, right now when I do the org to latex to pdf export, I'm given a
table of contents, and I don't want one. I'm still perplexed about where
defaults like that are kept.

Sometimes I worry that my ignorance is invulnerable.

Thanks again!

-Steven

Alan Tyree typh...@aanet.com.au writes:

 Hi Steven,
 You want to learn more about LaTeX, but it's not too much.

 I wrote a little book called Self-publishing with LyX that will help
 you set up the title page as well as some of your other problems. This
 is not a sales pitch -- it's free :-).

 Self-publishing with LyX 
 ISBN: 978-0-9803-3242-1
 http://www.lulu.com/content/1085870 

 Cheers,
 Alan

 On 28 May 2014 13:25, Steven Arntson ste...@stevenarntson.com wrote:

 
 Nick Dokos ndo...@gmail.com writes:
 
  Igor Sosa Mayor joseleopoldo1...@gmail.com writes:
 
  Steven Arntson ste...@stevenarntson.com writes:
 
  Hi, I'm trying to export an org-mode doc to LaTex and
 subsequently to
  PDF. This is a literary novel, written in prose. Right now
 when I run
  the export command, the resulting file is incorrectly
 formatted for the
  literary world, and I'm not sure how to change it. Is there a
 dialog or
  customize menu that allows users to eliminate some default
 settings,
  and add others?
 
  Maybe you can configure it with
  M-x customize-group org
 
  But I think a look at the manual is pretty useful and you can
 configure
  it in your .emacs without very much complication:
 
  http://orgmode.org/manual/Export-settings.html#Export-settings
 
 http://orgmode.org/manual/LaTeX-and-PDF-export.html#LaTeX-and-PDF-export
 
  I may be barking up the wrong tree, but to me the problem seems
 to be
  not so much what org does, but what latex does. If that is so,
 then
  perhaps what is needed is a latex style file that formats prose
  correctly for the literary world. That may be a non-trivial
  undertaking (but maybe not: typographical demands for a novel
 are
  trivial compared to say mathematics). Integrating such a
 hypothetical
  style file into org would be pretty easy.
 
  But perhaps the OP can clarify: what does incorrectly formatted
 for
  the literary world mean?
 
  Nick
 
 
 Full disclosure: I'm a beginning emacs user, and I know nothing
 about
 LaTex at all!
 
 I'm not producing a book per se, but a manuscript that will be
 printed on 8.5 x 11 pages and read by my agent or a publisher. The
 conventions are simple, but thus far I haven't been able to
 understand
 much of what I'm reading in the customize menu for org-mode.
 
 Until now I've done this formatting with MS Word or Libre Office.
 I
 dislike those programs, but I know how to use them. Simplest has
 been to
 take my raw org-mode txt files and convert them manually. It's a
 tedious
 last step before sending downstream, which I'd love to replace,
 and I've
 seen some beautiful LaTex examples online, so I know it's possible
 ...
 
 Literary format redux:
 + 12 point text
 + Title page has title and author name, centered both horizontally
 and
 vertically. Contact info for agent is in the bottom left, single
 spaced.
 + Remaining pages are double-spaced
 + Page numbers are centered at the bottom of the page (but no page
 number
 on title page)
 + Each page has a right-justified header in the format
 LASTNAME/TITLE
 
 That's it. I guess I'm wondering now--should I be learning more
 about
 org-mode, or more about LaTex?
 
 Thank you very much for taking the time to read all of this.
 
 -Steven




Re: [O] LaTex export questions

2014-05-28 Thread Axel Kielhorn

Am 28.05.2014 um 08:07 schrieb Steven Arntson ste...@stevenarntson.com:

 Hi Alan,
 
 I downloaded the book and went through it--thank you for putting that
 together! It was a valuable overview. Nonetheless, some confusions
 persist for me since I'm using emacs org-mode and not LyX. Should I be
 putting LaTeX markup into my org-mode doc, for instance, for formatting
 the title page, c?
 
 Also, right now when I do the org to latex to pdf export, I'm given a
 table of contents, and I don't want one. I'm still perplexed about where
 defaults like that are kept.

I had exactly the same question yesterday.
Putting

#+OPTIONS: toc:nil

into the org file will suppress the toc.

You should read the chapter Markup for rich export in the Org Manual.
This may answer some of you questions about markup.

Axel



Re: [O] LaTex export questions

2014-05-28 Thread Rick Frankel

On 2014-05-27 23:25, Steven Arntson wrote:

Nick Dokos ndo...@gmail.com writes:

Igor Sosa Mayor joseleopoldo1...@gmail.com writes:

Steven Arntson ste...@stevenarntson.com writes:

Hi, I'm trying to export an org-mode doc to LaTex and subsequently to
PDF. This is a literary novel, written in prose. Right now when I run
the export command, the resulting file is incorrectly formatted for the
literary world, and I'm not sure how to change it. Is there a dialog or
customize menu that allows users to eliminate some default settings,
and add others?
But perhaps the OP can clarify: what does incorrectly formatted for
the literary world mean?

Literary format redux:
+ 12 point text
+ Title page has title and author name, centered both horizontally and
vertically. Contact info for agent is in the bottom left, single 
spaced.

+ Remaining pages are double-spaced
+ Page numbers are centered at the bottom of the page (but no page 
number

on title page)
+ Each page has a right-justified header in the format LASTNAME/TITLE



A quick google for latex novel manuscript template leads to
http://goer.org/Journal/2011/01/publishing_with_sphinx_rest_and_sffms_latex.html,
which leads to: http://www.mcdemarco.net/sffms/, which looks like what
you want...

rick



Re: [O] LaTex export questions

2014-05-28 Thread Bastien
Hi Steven,

Steven Arntson ste...@stevenarntson.com writes:

 Hi, I'm trying to export an org-mode doc to LaTex and subsequently to
 PDF. This is a literary novel, written in prose. Right now when I run
 the export command, the resulting file is incorrectly formatted for the
 literary world, and I'm not sure how to change it. Is there a dialog or
 customize menu that allows users to eliminate some default settings,
 and add others?

If you are not familiar with LaTeX, maybe it's worth exporting to ODT
instead.  Otherwise, do get some knowledge of LaTeX (perhaps by reading
the .tex output) and Org's documentation on how to customize the LaTeX
export.

HTH,

-- 
 Bastien



Re: [O] LaTex export questions

2014-05-28 Thread Grant Rettke
What kind of deadlines are you facing to accomplish this?
Grant Rettke | AAAS, ACM, ASA, FSF, IEEE, SIAM, Sigma Xi
g...@wisdomandwonder.com | http://www.wisdomandwonder.com/
“Wisdom begins in wonder.” --Socrates
((λ (x) (x x)) (λ (x) (x x)))
“Life has become immeasurably better since I have been forced to stop
taking it seriously.” --Thompson


On Tue, May 27, 2014 at 2:49 PM, Steven Arntson
ste...@stevenarntson.com wrote:
 Hi, I'm trying to export an org-mode doc to LaTex and subsequently to
 PDF. This is a literary novel, written in prose. Right now when I run
 the export command, the resulting file is incorrectly formatted for the
 literary world, and I'm not sure how to change it. Is there a dialog or
 customize menu that allows users to eliminate some default settings,
 and add others?

 Thank you!
 Steven Arntson





Re: [O] LaTex export questions

2014-05-28 Thread Steven Arntson
Rick,

Your google search to find the sffms style package seems like it could
be the perfect answer to my quandary. I'm trying now to get my head
around acquiring it. I don't have a great track record with installing
things, and try to use package management systems when I can.

Sffms is located on CTAN (which I'm learning about as I write
this!). I'm running Ubuntu, and believe I have TexLive installed, but
have never tried its package management system.

What's a good way to proceed here?

Thank you!
Steven



Rick Frankel r...@rickster.com writes:

 On 2014-05-27 23:25, Steven Arntson wrote:
 Nick Dokos ndo...@gmail.com writes:

 Igor Sosa Mayor joseleopoldo1...@gmail.com writes:

 Steven Arntson ste...@stevenarntson.com writes:

 Hi, I'm trying to export an org-mode doc to LaTex and subsequently to
 PDF. This is a literary novel, written in prose. Right now when I run
 the export command, the resulting file is incorrectly formatted for the
 literary world, and I'm not sure how to change it. Is there a dialog or
 customize menu that allows users to eliminate some default settings,
 and add others?
 But perhaps the OP can clarify: what does incorrectly formatted for
 the literary world mean?

 Literary format redux:
 + 12 point text
 + Title page has title and author name, centered both horizontally and
 vertically. Contact info for agent is in the bottom left, single
 spaced.
 + Remaining pages are double-spaced
 + Page numbers are centered at the bottom of the page (but no page
 number
 on title page)
 + Each page has a right-justified header in the format LASTNAME/TITLE


 A quick google for latex novel manuscript template leads to
 http://goer.org/Journal/2011/01/publishing_with_sphinx_rest_and_sffms_latex.html,
 which leads to: http://www.mcdemarco.net/sffms/, which looks like what
 you want...

 rick




Re: [O] LaTex export questions

2014-05-28 Thread Nick Dokos
Steven Arntson ste...@stevenarntson.com writes:

 Rick,

 Your google search to find the sffms style package seems like it could
 be the perfect answer to my quandary. I'm trying now to get my head
 around acquiring it. I don't have a great track record with installing
 things, and try to use package management systems when I can.

 Sffms is located on CTAN (which I'm learning about as I write
 this!). I'm running Ubuntu, and believe I have TexLive installed, but
 have never tried its package management system.

 What's a good way to proceed here?


You can search for packages containing a file:

$ dpkg -S sffms.cls
texlive-latex-extra: /usr/share/texmf-texlive/tex/latex/sffms/sffms.cls

So you need to install texlive-latex-extra:

# apt-get install texlive-latex-extra

You'll probably need to be root for that (or use the graphical thingie
that will ask for your password).

Nick




Re: [O] LaTex export questions

2014-05-28 Thread Steven Arntson
Nick Dokos ndo...@gmail.com writes:

 Steven Arntson ste...@stevenarntson.com writes:

 Rick,

 Your google search to find the sffms style package seems like it could
 be the perfect answer to my quandary. I'm trying now to get my head
 around acquiring it. I don't have a great track record with installing
 things, and try to use package management systems when I can.

 Sffms is located on CTAN (which I'm learning about as I write
 this!). I'm running Ubuntu, and believe I have TexLive installed, but
 have never tried its package management system.

 What's a good way to proceed here?


 You can search for packages containing a file:

 $ dpkg -S sffms.cls
 texlive-latex-extra: /usr/share/texmf-texlive/tex/latex/sffms/sffms.cls

 So you need to install texlive-latex-extra:

 # apt-get install texlive-latex-extra

 You'll probably need to be root for that (or use the graphical thingie
 that will ask for your password).

 Nick

That dpkg search is a great thing to know about! So I just went through
the install process, and it turns out I already have the files in
question. I just haven't gotten them working yet. The website for sffms
says I need to put the following into my doc:

\documentclass{sffms}
\author{Lois McMaster Bujold}
\title{Komarr}
\begin{document}
Your story goes here.
\end{document}

Which seems encouragingly simple, but I'm a little confused about using
this LaTex markup in the context of an org document. Org has its own
markup to pass to latex for these I think, like #+AUTHOR. Is there
a similar one for \documentclass ?

Thanks again!
Steven




Re: [O] LaTex export questions

2014-05-28 Thread Nick Dokos
Steven Arntson ste...@stevenarntson.com writes:

 Nick Dokos ndo...@gmail.com writes:

 Steven Arntson ste...@stevenarntson.com writes:

 Rick,

 Your google search to find the sffms style package seems like it could
 be the perfect answer to my quandary. I'm trying now to get my head
 around acquiring it. I don't have a great track record with installing
 things, and try to use package management systems when I can.

 Sffms is located on CTAN (which I'm learning about as I write
 this!). I'm running Ubuntu, and believe I have TexLive installed, but
 have never tried its package management system.

 What's a good way to proceed here?


 You can search for packages containing a file:

 $ dpkg -S sffms.cls
 texlive-latex-extra: /usr/share/texmf-texlive/tex/latex/sffms/sffms.cls

 So you need to install texlive-latex-extra:

 # apt-get install texlive-latex-extra

 You'll probably need to be root for that (or use the graphical thingie
 that will ask for your password).

 Nick

 That dpkg search is a great thing to know about! So I just went through
 the install process, and it turns out I already have the files in
 question. I just haven't gotten them working yet. The website for sffms
 says I need to put the following into my doc:

 \documentclass{sffms}
 \author{Lois McMaster Bujold}
 \title{Komarr}
 \begin{document}
 Your story goes here.
 \end{document}

 Which seems encouragingly simple, but I'm a little confused about using
 this LaTex markup in the context of an org document. Org has its own
 markup to pass to latex for these I think, like #+AUTHOR. Is there
 a similar one for \documentclass ?


You will need to add a class to org-latex-classes. You should read the
documentation for the variable with C-h v org-latex-classes RET.

You can try customizing this variable but I find the customize interface
to it somewhat confusing, so I prefer to do it by hand - you need to add
something like this to the end of your initialization file (you probably
just need chapters):

--8---cut here---start-8---
(setq sa/sffms-latex-class '(novel \\documentclass{sffms}
  (\\chapter{%s} . \\chapter*{%s})
  (\\section{%s} . \\section*{%s})
  (\\subsection{%s} . \\subsection*{%s})
  (\\subsubsection{%s} . \\subsubsection*{%s})))

(eval-after-load ox-latex
 '(add-to-list 'org-latex-classes sa/sffms-latex-class))
--8---cut here---end---8---

Then your org file should look like this:

--8---cut here---start-8---
#+LATEX_CLASS: novel
#+TITLE: Fahrenheit 451
#+AUTHOR: Ray Bradbury
#+OPTIONS: toc:nil

* The Hearth and the Salamander

It was a pleasure to burn.

It was a special pleasure to see things eaten, blackened
and /changed/.
--8---cut here---end---8---

Note  that the latex class is known as novel to org because of
the way I defined sa/sffms-latex-class. You could call it whatever
you want, by changing the two instances of novel.

That's a beginning but you will probably have to modify some other
things.  Just put them in a style file, say misc.sty:

--8---cut here---start-8---
\runningtitle{Fahrenheit 451}
\authorname{Ray Bradbury}
--8---cut here---end---8---

plus any other settings from the sfmms documentation you think are
necessary, and add a line to your .org file:

--8---cut here---start-8---
#+LATEX_HEADER: \usepackage{misc}
--8---cut here---end---8---

to pick them up. That should get you some way towards your goal.

Nick







  1   2   3   4   5   >