From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Lawrence Subject: Re: [patch] Support CUSTOM_ID property in latex export Date: Sat, 15 Feb 2014 15:43:48 -0800 Message-ID: <87vbwggcwb.fsf@berkeley.edu> References: <87y51cgmc5.fsf@aquinas.i-did-not-set--mail-host-address--so-tickle-me> <87mwhsro6c.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38349) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEovT-0006a4-HM for emacs-orgmode@gnu.org; Sat, 15 Feb 2014 18:45:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WEovO-0006jz-1J for emacs-orgmode@gnu.org; Sat, 15 Feb 2014 18:45:39 -0500 Received: from mail-pa0-f41.google.com ([209.85.220.41]:37895) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEovN-0006jt-QM for emacs-orgmode@gnu.org; Sat, 15 Feb 2014 18:45:33 -0500 Received: by mail-pa0-f41.google.com with SMTP id fa1so13761516pad.14 for ; Sat, 15 Feb 2014 15:45:32 -0800 (PST) In-Reply-To: <87mwhsro6c.fsf@gmail.com> 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: Nicolas Goaziou Cc: emacs-orgmode@gnu.org Nicolas Goaziou writes: > Richard Lawrence writes: > >> Here is a patch to add support for using CUSTOM_ID properties for labels >> and refs in the LaTeX exporter. > > Thank you for the patch. Though, I don't understand why it is needed. > >> I also need this behavior, which is why I wrote this. > > Would you mind explaining your use case? > > From a user's perspective, CUSTOM_ID allows an user to refer to > a particular headline with a specific internal link type. How this is > done internally is something different, which belong to the > implementation level. Sure. I apologize -- I should have said more about this in my previous email than just referring to that old post. I am presently using Org to write my dissertation, which I compile using the LaTeX exporter. This means I am writing long documents with embedded LaTeX blocks. (Maybe this is ill-advised, but it has worked great so far!) Basically, I want control over how the labeling is done in the exported document for two reasons: 1) Sometimes I need to refer to a section from within an embedded LaTeX block. In that case, I need to know the appropriate label to use at the LaTeX level, not just in Org. For example: * A headline :PROPERTIES: :CUSTOM_ID: sec:a-headline :END: # ... stuff ... #+BEGIN_LATEX % ... more stuff ... (see section~\ref{sec:a-headline}) #+END_LATEX This is not possible with the present section labeling in LaTeX export, because I have no way of forcing Org to use a particular label for a section. 2) I hope this doesn't happen, but there may come a time when I need to move away from Org and just use straight LaTeX. Having control over the labeling will make this transition much easier, because it means I won't have to worry about manually changing the labels in a long document from Org's default "sec-..." numbering to my own semantic labels. Right now, I am at a risk of losing a lot of information if I have to make this transition, because my CUSTOM_ID values don't have any effect on the generated LaTeX. Being able to set section labels as needed from within Org would reduce this risk and therefore allow me to put this transition off longer. Another reason (not mine, but someone else might care) is: 3) This will make the LaTeX exporter's behavior more consistent with the HTML exporter's behavior. The HTML exporter will use CUSTOM_ID if it is supplied to construct the id attributes of headlines and divs. If someone is relying on this behavior of the HTML exporter, they might be unpleasantly surprised by the LaTeX exporter's behavior. Does all that seem reasonable? Best, Richard