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 16:18:41 +0100 Message-ID: <224945F4-65E4-4904-9065-ADF3FE9F4DD2@gmail.com> References: <873a49e8g6.fsf@missioncriticalit.com> <361B87B2-29D2-465C-84BE-A82376059D35@gmail.com> <877htlcjos.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 1NBVG5-0006dR-Gg for emacs-orgmode@gnu.org; Fri, 20 Nov 2009 10:18:49 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NBVG1-0006cL-Mp for emacs-orgmode@gnu.org; Fri, 20 Nov 2009 10:18:49 -0500 Received: from [199.232.76.173] (port=40920 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBVG1-0006cI-L7 for emacs-orgmode@gnu.org; Fri, 20 Nov 2009 10:18:45 -0500 Received: from ey-out-1920.google.com ([74.125.78.147]:5447) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NBVG0-0000Fv-Pt for emacs-orgmode@gnu.org; Fri, 20 Nov 2009 10:18:45 -0500 Received: by ey-out-1920.google.com with SMTP id 3so1127729eyh.34 for ; Fri, 20 Nov 2009 07:18:44 -0800 (PST) In-Reply-To: <877htlcjos.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 On Nov 20, 2009, at 4:14 PM, Francesco Pizzolante wrote: > Hi Carsten, > >>> --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 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. > > OK. But the information in these 2 comments is correctly used to > replace the > alias (heading-c and heading-d) with the label generated by org > during the > export. See the last 2 references in my example: these references > are correct. > They thus have been correctly processed from heading-c and heading-d > to sec-3 > and sec-4... these comments are thus not simply removed... right? This is only by chance, because a simple text search does match these two lines. if you'd happen to have the string headline-a anywhere in the file, the link would point to the enclosing section. > > In the case of the :CUSTOM_ID: property, the property is also used > to convert > the alias to the label (heading-a to sec-1) but additionally an > extra label > (heading-a) is created and not used. > > That's why, when creating references to sections I found the # > +CUSTOM_ID very > elegant... But apparently I don't have to use such syntax... > Not if you want to have reliable links, no. - Carsten > I wanted to know the recommended way of doing references... > > Thanks a lot for your help. > > Francesco - Carsten