How to pass CUSTOM_ID property as custom \ label when exporting to latex?

I used to be able to pass the property CUSTOM_ID

as custom \label

after exporting to LaTeX. This snippet looks like this:

* Introduction
  :PROPERTIES:
  :CUSTOM_ID: custom_label
  :END:

      

To be exported:

\section{Introduction}
\label{sec-1}
\label{custom_label}

      

I am using Org-mode version 8.2.7c and this is no longer the case, the org-mode snippet above export to:

\section{Introduction}
\label{sec-1}

      

Because of this, I need to add custom shortcuts everywhere, for example:

* Introduction
  :PROPERTIES:
  :CUSTOM_ID: custom_label
  :END:
  \label{custom_label}

      

Is there a better way to pass a property in a CUSTOM_ID

new way org-latex-export-as-latex

?

Or more generally, is there a systematic way to pass either one PROPERTIES

when exporting to LaTeX?

Thanks for any help or pointer I might use.

+3


source to share


2 answers


The current development branch org-mode

(8.3) allows the CUSTOM_ID property to be used for this.

If you must use your own labels in the LaTeX export, it can set the org-latex-custom-id-as-label to non-nil.

org-latex-custom-id-as-label

is part of Org v8.3.

The following code:



(with-temp-buffer
  (let ((org-latex-custom-id-as-label t))
    (insert "* Introduction\n:PROPERTIES:\n:CUSTOM_ID: custom_label\n:END:")
    (org-mode)
    (org-latex-export-as-latex nil nil nil t)))

      

will create a buffer with content

\section{Introduction}
\label{custom_label}

      

optional.

0


source


Just in case you won't notice @ nberth's answer, in current version Org 8.3.2

do the following



(setq org-latex-prefer-user-labels t)

      

+3


source







All Articles