all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* LaTeX export should honor CUSTOM_ID property
@ 2012-03-29  2:10 Truong Nghiem
  0 siblings, 0 replies; only message in thread
From: Truong Nghiem @ 2012-03-29  2:10 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-03-29  2:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-29  2:10 LaTeX export should honor CUSTOM_ID property Truong Nghiem

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.