From mboxrd@z Thu Jan 1 00:00:00 1970 From: Truong Nghiem Subject: LaTeX export should honor CUSTOM_ID property Date: Wed, 28 Mar 2012 22:10:04 -0400 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:43511) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SD4oS-0005ay-HI for emacs-orgmode@gnu.org; Wed, 28 Mar 2012 22:10:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SD4oQ-0006eo-Ob for emacs-orgmode@gnu.org; Wed, 28 Mar 2012 22:10:08 -0400 Received: from mail-bk0-f41.google.com ([209.85.214.41]:64508) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SD4oQ-0006cO-GB for emacs-orgmode@gnu.org; Wed, 28 Mar 2012 22:10:06 -0400 Received: by bkwq16 with SMTP id q16so1825745bkw.0 for ; Wed, 28 Mar 2012 19:10:04 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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