emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Truong Nghiem <truong.nghiem@gmail.com>
To: emacs-orgmode@gnu.org
Subject: LaTeX export should honor CUSTOM_ID property
Date: Wed, 28 Mar 2012 22:10:04 -0400	[thread overview]
Message-ID: <CADNXMz_6Qyc1k-UPxYOZ3z_fOeBbGpa7wbb-keCKA0GwPuZfkw@mail.gmail.com> (raw)

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	other threads:[~2012-03-29  2:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADNXMz_6Qyc1k-UPxYOZ3z_fOeBbGpa7wbb-keCKA0GwPuZfkw@mail.gmail.com \
    --to=truong.nghiem@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).