From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Colon in block name? Date: Fri, 13 Feb 2015 14:11:56 -0500 Message-ID: <87lhk1bp8j.fsf@alphaville.usersys.redhat.com> References: <877fvnxime.fsf@hornfels.zedat.fu-berlin.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53041) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMLes-0001ZV-Pm for emacs-orgmode@gnu.org; Fri, 13 Feb 2015 14:12:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YMLen-0003oe-Ng for emacs-orgmode@gnu.org; Fri, 13 Feb 2015 14:12:10 -0500 Received: from plane.gmane.org ([80.91.229.3]:59285) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMLen-0003o7-HN for emacs-orgmode@gnu.org; Fri, 13 Feb 2015 14:12:05 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YMLek-0006SV-U2 for emacs-orgmode@gnu.org; Fri, 13 Feb 2015 20:12:03 +0100 Received: from nat-pool-bos-t.redhat.com ([66.187.233.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 13 Feb 2015 20:12:02 +0100 Received: from ndokos by nat-pool-bos-t.redhat.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 13 Feb 2015 20:12:02 +0100 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 "Loris Bennett" writes: > Hi, > > I want to export to LaTeX and refer to tables and code blocks as in the > example below. However a name with a colon, such as 'tab:my_data' used > as a variable for a source block fails: > > org-babel-ref-resolve: Reference 'my_data' not found in this buffer > Yes, it looks as if the babel header parsing code is a bit picky: changing just tab:my_data to tabmy_data everywhere it occurs is enough for the export to succeed. > Obviously, and perhaps not surprisingly, the use of the colon in the > name seems to be problematic. > > Should this work? If not, is there a common alternative to the idiom > tab:shootings_in_the_foot and fig:foot_with_hole? > > Cheers, > > Loris > > PS: In the example below, the last table is not exported to the LaTeX > file, but this is presumably an unrelated issue ... > Yes, you need ":exports both" for that. > Example: > > * Test with block names containing a colon > ** Data > My data can be found in Table [[tab:my_data]]. > #+CAPTION: My data > #+NAME: tab:my_data > | a | b | > |---+---| > | 2 | 4 | > | 3 | 9 | > > ** Code > > My code can be found in Listing [[code:my_code]]. > > #+CAPTION: My code > #+NAME: code:my_code > #+HEADER: :var data=tab:my_data :colnames yes > #+BEGIN_SRC R > d <- data > #+END_SRC > > ** Results > > My results can be found in Table [[tab:my_results]]. > > #+CAPTION: My results > #+NAME: tab:my_results > #+RESULTS: code:my_code > | a | b | > |---+---| > | 2 | 4 | > | 3 | 9 | > > ** Conclusions > > Names with colons don't work. Nick