From mboxrd@z Thu Jan 1 00:00:00 1970 From: Suvayu Ali Subject: Re: Target and link text normalised to `orgtargetn' Date: Sun, 19 Apr 2015 15:24:25 +0200 Message-ID: <20150419132425.GA14328@chitra.no-ip.org> 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> <87618smg2i.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55478) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YjpD9-00005k-3G for emacs-orgmode@gnu.org; Sun, 19 Apr 2015 09:24:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YjpD4-0000xL-3x for emacs-orgmode@gnu.org; Sun, 19 Apr 2015 09:24:35 -0400 Received: from mail-wi0-x234.google.com ([2a00:1450:400c:c05::234]:34097) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YjpD3-0000xF-SA for emacs-orgmode@gnu.org; Sun, 19 Apr 2015 09:24:30 -0400 Received: by wicmx19 with SMTP id mx19so20970493wic.1 for ; Sun, 19 Apr 2015 06:24:29 -0700 (PDT) Content-Disposition: inline In-Reply-To: <87618smg2i.fsf@nicolasgoaziou.fr> 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: emacs-orgmode@gnu.org, Rasmus Hi Nicolas, On Sun, Apr 19, 2015 at 02:57:09PM +0200, Nicolas Goaziou wrote: > 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. Yes indeed. I wanted to use the location information provided by refstyle, and varioref. By using \secref or \vpageref I would get references like: section §3, on page 5, etc. > 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)}}} > Okay I see it now, in your last email I got a bit confused, but now I follow. With your solution I use both label and reference using LaTeX, bypassing Org. Of course this leaves me with links not working inside Org. I was eventually going to use filters to transform the ref commands to the alternate ones from refstyle and varioref to get both LaTeX and Org side working as I wanted. Something like this: <> [[sec:interesting]] Then transform \ref{sec:interesting} → \secref{sec:interesting} with a filter; that way I would have my cake and eat it too! I see your point though. Thanks a lot for the comments. :) Cheers, -- Suvayu Open source is the future. It sets us free.