From mboxrd@z Thu Jan 1 00:00:00 1970 From: Myles English Subject: Re: [new exporter] what is the label syntax for LaTeX export? Date: Wed, 07 Nov 2012 22:46:16 +0000 Message-ID: <87a9utxc93.fsf@gmail.com> References: <87fw4nyac4.fsf@gmail.com>, <87390nbsmu.fsf@gmail.com>, <87d2zqxwuw.fsf@gmail.com>, <87hap1sr45.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:46400) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TWEO4-0006Q7-VI for Emacs-orgmode@gnu.org; Wed, 07 Nov 2012 17:46:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TWEO3-0006lJ-Tn for Emacs-orgmode@gnu.org; Wed, 07 Nov 2012 17:46:20 -0500 Received: from mail-we0-f169.google.com ([74.125.82.169]:56045) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TWEO3-0006lC-IR for Emacs-orgmode@gnu.org; Wed, 07 Nov 2012 17:46:19 -0500 Received: by mail-we0-f169.google.com with SMTP id u3so1154008wey.0 for ; Wed, 07 Nov 2012 14:46:18 -0800 (PST) In-reply-to: <87hap1sr45.fsf@gmail.com> 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: Nicolas Goaziou Cc: Emacs-orgmode Nicolas Goaziou writes: >> One problem I am having is that the exported LaTeX replaces the ":" with >> a "-" to become \ref{tab-niceone} which precludes the use of (e.g.) >> \autoref which would need to know that the thing being referenced was a >> table by recognising the "tab:", no? I am sure there is a good reason >> for this, can you say why? > > This is due to one of the few functions that was brought from the old > exporter: `org-export-solidify-link-text'. > > That's because targets (that is <<...>> or #+NAME: ...) have no > limitation on the characters allowed in their value, which can lead to > problems when translated into foreign code (i.e. an % sign in the target > when using the latex back-end). Thanks for the explanation. > So, the function replaces forbidden characters with hyphens. > > Besides using filters, a solution might be either: (I haven't actually made any progress on a solution using filters. I was expecting it to be a little convoluted though; splitting on the first hyphen and joining on a colon.) Not sure if you are showing me two options you are thinking of implementing here or suggesting two things I can do myself: > 1. to remove colons from the forbidden characters. If no backends would mind dealing with a colon (I don't know them well enough to be able to decide) then this would be preferable. > 2. to limit the characters allowed in targets and remove > `org-export-solidify-link-text' altogether. This option could restrict future backends, or other (future?) latex packages. The first option seems most appropriate because a character should only be restricted if there is a good reason (e.g. a backend would not like it) rather than forbidding every character and only allowing it if there is a good reason to. As to whether my use case is a good reason to allow colons: I have no idea how many people use the \autoref or \nameref thing. > > > Regards, Myles