From mboxrd@z Thu Jan 1 00:00:00 1970 From: Magnus Nilsson Subject: Bug in LaTeX export for links with underscores in captions. (Easy to fix for elispers) Date: Sun, 2 Oct 2011 13:30:36 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001636427485f1bb0904ae4f2f40 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:52211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RAKFj-0002a4-Pb for emacs-orgmode@gnu.org; Sun, 02 Oct 2011 07:30:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RAKFi-0005LN-OJ for emacs-orgmode@gnu.org; Sun, 02 Oct 2011 07:30:39 -0400 Received: from mail-qy0-f169.google.com ([209.85.216.169]:49394) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RAKFi-0005LH-M8 for emacs-orgmode@gnu.org; Sun, 02 Oct 2011 07:30:38 -0400 Received: by qyl38 with SMTP id 38so1488031qyl.0 for ; Sun, 02 Oct 2011 04:30:37 -0700 (PDT) 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 --001636427485f1bb0904ae4f2f40 Content-Type: text/plain; charset=ISO-8859-1 This is a bug which elisp-driven orgers with access to the git repository can fix quickly. * Linking to [[a_file.txt][a file with underscore]] in a headline works well with LaTeX export #+CAPTION: Linking [[a_file.txt][a file with underscore]] in a caption does _not_ work well with LaTeX export. [[/Path_to_figure/figure.png]] The reason is because org-export-latex-links processes the figure's caption with org-export-latex-fontify-headline, which in turn processes the caption's link (with altered underscores for some reason). For example, (org-export-latex-fontify-headline "[[/Path_to_figure/figure.png][a file with underscore]]") returns #("\\href{file://./Path\\_{}to\\_{}figure/figure.png}{a file with underscore}" 14 15 (org-attr nil) 15 24 (org-protected t org-attr nil) 24 25 (org-protected t org-attr nil) 25 28 (org-protected t org-attr nil) 28 35 (org-protected t org-attr nil) 35 46 (org-attr nil)) There must be a way to process links (whose path contains underscores) within captions to floats correctly. Best regards, Magnus --001636427485f1bb0904ae4f2f40 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable This is a bug which elisp-driven orgers with access to the git
repositor= y can fix quickly.

* Linking to [[a_file.txt][a file with underscore= ]] in a headline works well with LaTeX export

#+CAPTION: Linking [[a= _file.txt][a file with underscore]] in a caption does _not_ work well with = LaTeX export.
[[/Path_to_figure/figure.png]]

The reason is because org-export-late= x-links processes the figure's
caption with org-export-latex-fontify= -headline, which in turn
processes the caption's link (with altered = underscores for some
reason). For example,
(org-export-latex-fontify-headline "[[/Path_= to_figure/figure.png][a file with underscore]]")
returns
#("= ;\\href{file://./Path\\_{}to\\_{}figure/figure.png}{a file with underscore}= " 14 15 (org-attr nil) 15 24 (org-protected t org-attr nil) 24 25 (org= -protected t org-attr nil) 25 28 (org-protected t org-attr nil) 28 35 (org-= protected t org-attr nil) 35 46 (org-attr nil))

There must be a way to process links (whose path contains underscores) = within captions to floats correctly.

Best regards,
Magnus
--001636427485f1bb0904ae4f2f40--