From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: LaTeX export of section links Date: Fri, 20 Nov 2009 15:13:20 +0100 Message-ID: <361B87B2-29D2-465C-84BE-A82376059D35@gmail.com> References: <873a49e8g6.fsf@missioncriticalit.com> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NBUEr-000669-Er for emacs-orgmode@gnu.org; Fri, 20 Nov 2009 09:13:29 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NBUEm-00064f-K3 for emacs-orgmode@gnu.org; Fri, 20 Nov 2009 09:13:29 -0500 Received: from [199.232.76.173] (port=53787 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBUEm-00064c-FA for emacs-orgmode@gnu.org; Fri, 20 Nov 2009 09:13:24 -0500 Received: from ey-out-1920.google.com ([74.125.78.147]:35657) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NBUEl-0004PA-TA for emacs-orgmode@gnu.org; Fri, 20 Nov 2009 09:13:24 -0500 Received: by ey-out-1920.google.com with SMTP id 3so1110563eyh.34 for ; Fri, 20 Nov 2009 06:13:22 -0800 (PST) In-Reply-To: <873a49e8g6.fsf@missioncriticalit.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Francesco Pizzolante Cc: mailing-list-org-mode Hi Francesco, On Nov 20, 2009, at 12:34 PM, Francesco Pizzolante wrote: > Hi, > > I have a few questions about links to sections. > > I've read that it is better to user IDs and CUSTOM_IDs to links to > section... > > Here's a small example with 4 cases: > > --8<---------------cut here---------------start------------->8--- > * First > :PROPERTIES: > :CUSTOM_ID: heading-a > :END: > > Hello Toto! > > * Second > # <> > > Hello Tata! > > * Third > #+CUSTOM_ID: heading-c > > Hello Titi! > > * Fourth > #+ID: heading-d > > Hello Tete! > > [[heading-a]] > [[heading-b]] > [[heading-c]] > [[heading-d]] > --8<---------------cut here---------------end--------------->8--- > > Which give the following LaTeX code: > > --8<---------------cut here---------------start------------->8--- > \section{First} > \label{sec-1} > \label{heading-a} > > > Hello Toto! > > \section{Second} > \label{sec-2} > \label{heading-b} > > > Hello Tata! > > \section{Third} > \label{sec-3} > > > Hello Titi! > > \section{Fourth} > \label{sec-4} > > > Hello Tete! > > \hyperref[sec-1]{heading-a} > \hyperref[sec-2]{heading-b} > \hyperref[sec-3]{heading-c} > \hyperref[sec-4]{heading-d} > --8<---------------cut here---------------end--------------->8--- > > The first and second cases both generate labels which are not used > in LaTeX. There is no harm in defining labels that are not used. > > The third and fourth cases are very elegant as they use only aliases > (which > are dropped from the LaTeX code). Third and forth are non-existent syntax in Org, these lines are just treated as comments and are removed during export. > > My questions are: > > - what's the difference between using ID and CUSTOM_ID? Custom ID is human-readable, ID is usually a sha1 hash. ID's have the advantage that in HTML, they can link from one file to another one. > - the cases "Third" and "Fourth" are the more elegant from my point > of view. > Is this the right way of doing? No, see above > > - what's the difference between cases "First" and "Second" (I mean > between > using PROPERTIES and # <>)? Only in the way that the property might be conceived as cleaner - but this is really a matter of taste at this point. > > - in the documentation (section 4.2), we talk about "CUSTOM_ID > property" does > it mean that we should use it as in case 1? Yes. HTH - Carsten