From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Bach Subject: Re: LaTeX export: Handle hash symbol in footnote url links Date: Fri, 21 Feb 2014 13:57:51 +0100 Message-ID: <53074D4F.4090808@gmail.com> References: <20140221111408.GH904@smoon> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44015) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGpg5-0000vK-Q5 for emacs-orgmode@gnu.org; Fri, 21 Feb 2014 07:58:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WGpfy-000408-A7 for emacs-orgmode@gnu.org; Fri, 21 Feb 2014 07:58:05 -0500 Received: from mail-ee0-x244.google.com ([2a00:1450:4013:c00::244]:50590) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGpfy-0003yS-2M for emacs-orgmode@gnu.org; Fri, 21 Feb 2014 07:57:58 -0500 Received: by mail-ee0-f68.google.com with SMTP id c13so732848eek.7 for ; Fri, 21 Feb 2014 04:57:56 -0800 (PST) In-Reply-To: <20140221111408.GH904@smoon> 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: Vladimir Lomov , emacs-orgmode@gnu.org Hello Vladimir, On 21/02/2014 12:14, Vladimir Lomov wrote: > Hello, > ** Michael Bach [2014-02-21 11:52:14 +0100]: > >> Dear org-mode Devs and Users, > >> I am trying to export the following snippet > >> #+BEGIN_ORG >> * LaTeX export of url with hash symbol > >> The Org mode export facilities can be used to export Org documents or >> parts of Org documents to a variety of other formats.[fn:1] > >> * Footnotes > >> [fn:1] [[http://orgmode.org/org.html#Exporting]] >> #+END_ORG > >> Now the exported .tex file contains the link as >> : \footnote{\url{http://orgmode.org/org.html#Exporting}} > >> Which LaTeX does not like: >> : Illegal parameter number in definition of \Hy@tempa > >> FWIW, there is a workaround for the percent symbol described on SO[1] >> using `\urldef` - but this does not work with the hash symbol. > >> Is there another workaround/solution that works with org-mode? > > Hash (#), as well as several other symbols have to be espaced when used > as is in LaTeX documents. See, for example, "The Not So Short > Introduction to LaTeX2e", 1.3.2 Special Characters. In general it is > duty of ox-latex (LaTeX export backend) to espace such characters. > Thanks for your answer. `\url` can handle hash symbols in its argument without escaping alright - as can be expected. AFAICS, the problem lies in the `\footnote` command. And yes, I was thinking of `ox-latex` figuring out that the url is in a footnote and escape accordingly. I can see that the export engine should not and cannot cover all special cases, but since links and footnotes are `first-class` org-mode concepts, it would be nice to have them play along in this situation. >From a typographic point of view, I figured url links in footnotes are not that unusual. Best Regards, Michael >> [1] bit.ly/1cwYJaM > > --- > WBR, Vladimir Lomov >