emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] LaTeX export should honor CUSTOM_ID property


From: Truong Nghiem
Subject: [O] LaTeX export should honor CUSTOM_ID property
Date: Wed, 28 Mar 2012 22:10:04 -0400

I'm using orgmode version 7.8.06.  Right now, whenever an org file is
exported to LaTeX, each heading is assigned an automatic label (e.g.
sec-1).  All hyperlinks to the heading will also use this label.
There is a standard orgmode property for assigning custom ID to
headings for hyperlinks: CUSTOM_ID.  Exporting a heading with
CUSTOM_ID produces two labels, one automatic label by the LaTeX
exporter and one by CUSTOM_ID.  However all hyperlinks to the heading
use the automatic label.  For example, the following org code:

======== BEGIN =========
* Section 1
  :PROPERTIES:
  :CUSTOM_ID: sec:section-1
  :END:

This is section 1.

* Section 2
Refer [[Section 1]].
======== END ===========

produces LaTeX code:

======== BEGIN =========
\section{Section 1}
\label{sec-1}
\label{sec:section-1}


This is section 1.
\section{Section 2}
\label{sec-2}

Refer \hyperref[sec-1]{Section 1}.
======== END ===========

Although this is not a bug, I think the LaTeX exporter should honor
the CUSTOM_ID property, and only assign an automatic label in the
absent of this property.  The above LaTeX should read:

======== BEGIN =========
\section{Section 1}
\label{sec:section-1}


This is section 1.
\section{Section 2}
\label{sec-2}

Refer \hyperref[sec:section-1]{Section 1}.
======== END ===========


If the hyperlink is changed to using the CUSTOM_ID instead of the
heading text, it produces wrong LaTeX code:
\hyperref[sec-section-1]{\#sec:section-1}.  This is definitely a bug.
--
Truong Nghiem



reply via email to

[Prev in Thread] Current Thread [Next in Thread]