From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [patch] Support CUSTOM_ID property in latex export Date: Sun, 16 Feb 2014 10:10:12 +0100 Message-ID: <87iosfs9sb.fsf@gmail.com> References: <87y51cgmc5.fsf@aquinas.i-did-not-set--mail-host-address--so-tickle-me> <87mwhsro6c.fsf@gmail.com> <87vbwggcwb.fsf@berkeley.edu> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42350) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WExja-0003Ra-Gd for emacs-orgmode@gnu.org; Sun, 16 Feb 2014 04:10:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WExjV-0006Q3-LG for emacs-orgmode@gnu.org; Sun, 16 Feb 2014 04:09:58 -0500 Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]:65376) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WExjV-0006Py-E0 for emacs-orgmode@gnu.org; Sun, 16 Feb 2014 04:09:53 -0500 Received: by mail-wi0-f170.google.com with SMTP id hi5so1548064wib.3 for ; Sun, 16 Feb 2014 01:09:52 -0800 (PST) In-Reply-To: <87vbwggcwb.fsf@berkeley.edu> (Richard Lawrence's message of "Sat, 15 Feb 2014 15:43:48 -0800") 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: Richard Lawrence Cc: emacs-orgmode@gnu.org Hello, Richard Lawrence writes: > 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 I don't think this is a good idea, as the character set allowed in \label{...} macros is only a subset of the character set allowed in custom id value. Hence the `org-export-solidify-link-text' function. If you are cautious, this will not be a problem, but it could bite users with little LaTeX knowledge. > 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. * A headline #+latex: \label{my-section} #+BEGIN_LATEX % ... more stuff ... (see section~\ref{my-section}) #+END_LATEX It also seems more consistent to me: since you want to explicitly write the \ref{...}, you are also expected to explicitly write the \label{...} part. > 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. See above. You can even automate that with a hook (i.e., get the custom id value and add a corresponding label at the beginning of the headline). > 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. One relying on an implementation detail instead of the actual specifications has to be prepared for surprises. What do you think? Regards, -- Nicolas Goaziou