From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: [PATCH] Fix the export of underscores in links in the LaTeX export Date: Thu, 8 Jan 2009 14:25:38 +0100 Message-ID: <2889E437-8904-4F48-A2FE-DA8650A1F04F@uva.nl> References: Mime-Version: 1.0 (Apple Message framework v929.2) 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 1LKutP-0003cP-0H for emacs-orgmode@gnu.org; Thu, 08 Jan 2009 08:25:47 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LKutM-0003bF-Q5 for emacs-orgmode@gnu.org; Thu, 08 Jan 2009 08:25:45 -0500 Received: from [199.232.76.173] (port=60127 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LKutL-0003ai-PJ for emacs-orgmode@gnu.org; Thu, 08 Jan 2009 08:25:44 -0500 Received: from ug-out-1314.google.com ([66.249.92.168]:38798) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LKutL-0005y5-2P for emacs-orgmode@gnu.org; Thu, 08 Jan 2009 08:25:43 -0500 Received: by ug-out-1314.google.com with SMTP id 36so2370939uga.17 for ; Thu, 08 Jan 2009 05:25:41 -0800 (PST) In-Reply-To: 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: Christian Egli Cc: emacs-orgmode@gnu.org Thanks for the patch, I am fixing this problem on a more fundamental level, already during preprocessing. - Carsten On Jan 8, 2009, at 1:58 PM, Christian Egli wrote: > Hi > > I have the attached org file which I export to LaTeX. With the current > version of git the export produces the link as follows: > > \href{http://wiki.dspace.org/index.php/Configure\_media\_{}filters} > {media filters} > > Notice the spurious '{}' before filters. Needless to say this link > doesn't work. > > I tried to understand the source of the problem and came up with the > following patch which seems to work. However since I don't quite > understand this code you should take my change with a grain of salt. > With my patch I now get the following link. > > \href{http://wiki.dspace.org/index.php/Configure\_media\_filters} > {media filters} > > #+OPTIONS: ^:nil TeX:nil toc:nil > > * Title > ** Subtitle > [[http://wiki.dspace.org/index.php/Configure_media_filters][media > filters]] > > Thanks > Christian > --- > lisp/org-export-latex.el | 7 ++++--- > 1 files changed, 4 insertions(+), 3 deletions(-) > > diff --git a/lisp/org-export-latex.el b/lisp/org-export-latex.el > index daa75dc..eeb8199 100644 > --- a/lisp/org-export-latex.el > +++ b/lisp/org-export-latex.el > @@ -958,12 +958,13 @@ SUBSUP corresponds to the ^: option in the # > +OPTIONS line. > Convert CHAR depending on STRING-BEFORE and STRING-AFTER." > (cond ((equal string-before "\\") > (concat string-before char string-after)) > + ; deal with links > + ((eq 'org-link (get-text-property 0 'face char)) > + (concat string-before "\\" char string-after)) > ;; this is part of a math formula > ((and (string-match "\\S-+" string-before) > (string-match "\\S-+" string-after)) > - (cond ((eq 'org-link (get-text-property 0 'face char)) > - (concat string-before "\\" char string-after)) > - ((save-match-data (org-inside-latex-math-p)) > + (cond ((save-match-data (org-inside-latex-math-p)) > (if subsup > (cond ((eq 1 (length string-after)) > (concat string-before char string-after)) > -- > 1.5.6.3 > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode