From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Target and link text normalised to `orgtargetn' Date: Sun, 19 Apr 2015 14:57:09 +0200 Message-ID: <87618smg2i.fsf@nicolasgoaziou.fr> References: <20150414092530.GC2957@chitra.no-ip.org> <20150414120852.GD2957@chitra.no-ip.org> <87zj699ez9.fsf@gmx.us> <20150416001830.GC14328@chitra.no-ip.org> <87egnk9ycz.fsf@gmx.us> <87k2x9cddu.fsf@nicolasgoaziou.fr> <20150419121305.GZ14328@chitra.no-ip.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52301) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YjolK-0003l1-BT for emacs-orgmode@gnu.org; Sun, 19 Apr 2015 08:55:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YjolJ-0002dH-8v for emacs-orgmode@gnu.org; Sun, 19 Apr 2015 08:55:50 -0400 Received: from relay3-d.mail.gandi.net ([2001:4b98:c:538::195]:52445) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YjolI-0002d6-Pe for emacs-orgmode@gnu.org; Sun, 19 Apr 2015 08:55:49 -0400 In-Reply-To: <20150419121305.GZ14328@chitra.no-ip.org> (Suvayu Ali's message of "Sun, 19 Apr 2015 14:13:05 +0200") 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: Suvayu Ali Cc: emacs-orgmode@gnu.org, Rasmus Hello, Suvayu Ali writes: > Sorry, I don't think I quite understand. AFAIU, targets like > <> have to be unique even inside the Org buffer for links > like this to work: [[interesting][very cool]], regardless of export. So > then why rename them during export? There's no guarantee that, e.g., \label{interesting} is a valid syntax. Think about <<100%>> for LaTeX. Actually such links were broken for non-ASCII characters before the patch. Note that this is transparent for the user: if <> becomes \label{foo}, [[interesting][very cool]] automatically becomes \hyperref[foo]{very cool}. Your problem is different AFAIU. You are relying on the internal pattern of generated labels, i.e., you are eating Org's dog food. I advise against it. If you need explicitly "\label{interesting}", ask Org to write it with, e.g., "@@latex:\label{foo}@@" or even better #+MACRO: lbl @@latex:\label{$1}@@ {{{lbl(foo)}}} > How does the above solve the issue? I was not having problems with > getting to export \label{foo}, my problem was what do I put as `foo' > since in the exported TeX file foo was different. > > Hopefully I made myself clear, or I'm not misunderstanding something. Again <> are for [[target]], \label{...} are for \whateverref{..}. IOW, you are mixing two different concepts. Since you write "\secref{fig:1}" in your documents, you can also write "\label{fig:1}" there. Org can only ensures you that [[target]] always point to <>. No more, no less. There is another data point to consider: internal label scheme must not follow a simple pattern, as a user might use the same and introduce a label collision. E.g., if <> becomes par:foo, the following line is problematic: <> \label{par:foo} \ref{par:foo} [[foo]] This is why I suggest to rever commit cf7d64f. It also introduces a non-alphanumeric character ":", even though `org-export-get-reference' uses only alphanumeric ones by portability concern (it is even specified in its docstring). Commit f1548e1 is different. I actually mostly agree with it (though I was confused at first with the docstring change, which needs to be fixed), but it breaks radio targets. It doesn't need to be reverted. Regards, -- Nicolas Goaziou