From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ethan Ligon Subject: Re: [BUG?] Strange effect of noweb name collision on LaTeX export Date: Fri, 8 Jun 2012 08:54:48 -0700 Message-ID: References: <87txylltut.fsf@gmx.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:39456) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sd1Ws-0005Sp-4a for emacs-orgmode@gnu.org; Fri, 08 Jun 2012 11:55:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sd1Wo-0001O9-O6 for emacs-orgmode@gnu.org; Fri, 08 Jun 2012 11:55:13 -0400 Received: from mail-ob0-f169.google.com ([209.85.214.169]:34055) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sd1Wo-0001Nm-H1 for emacs-orgmode@gnu.org; Fri, 08 Jun 2012 11:55:10 -0400 Received: by obbwd18 with SMTP id wd18so3334079obb.0 for ; Fri, 08 Jun 2012 08:55:08 -0700 (PDT) In-Reply-To: <87txylltut.fsf@gmx.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: Eric Schulte Cc: "Emacs-orgmode@gnu.org" On Fri, Jun 8, 2012 at 8:13 AM, Eric Schulte wrote: > Ethan Ligon writes: > >> #+TITLE: =A0 =A0 =A0 Example of name collision bug >> #+AUTHOR: >> #+EMAIL: >> #+DATE: =A0 =A0 =A02012-06-07 Thu >> #+OPTIONS: =A0 H:3 num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t >> >> * Figure and trivial code reference >> =A0 Here we have a figure. >> =A0 This example works as expected; we get a latex figure on export. >> >> [[./foo.png]] >> >> * Figure and trivial code reference (with collision) >> =A0 Here we have a figure and a trivial code block with a noweb referenc= e. >> =A0 The difference is that the basename of the figure matches the noweb >> =A0 reference. =A0Instead of a figure on latex export, we get a hyperref= ! >> >> [[./bar.png]] >> >> #+BEGIN_SRC sh :exports none >> #<> >> #+END_SRC > > Ah, so as it turns out the syntax for the noweb reference happens to be > the same as the syntax used to specify a latex label. =A0In this case the > LaTeX exporter first mistakes the <> as a label anchor, and then > apparently converts the bar.png link to a real link. > > The latex exporter probably shouldn't try to make anchors out of the > text within code blocks. =A0However, in the mean time you can customize > the noweb syntax using the `org-babel-noweb-wrap-start' and > `org-babel-noweb-wrap-end' variables so that they aren't mistaken for > label anchors. This diagnosis seems exactly right (and thanks for the work-around). The problem is even worse than I indicated earlier, though---things like ./foo-bar.png or ./foo_bar.png are incorrectly turned into a link if there's any source block along the lines of #+begin_src sh <> #+end_src or #+begin_src sh <> #+end_src Note also that this is not just an ambiguity about whether ./foo-bar.png should be treated as a link or a figure, because if it's a link it's a /broken/ link (in the example above the resulting LaTeX is \hyperref[.-foo-bar.png]{./foo-bar.png}) -Ethan --=20 Ethan Ligon, Associate Professor Agricultural & Resource Economics University of California, Berkeley