emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Colon in block name?


From: Nick Dokos
Subject: Re: [O] Colon in block name?
Date: Fri, 13 Feb 2015 14:11:56 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

"Loris Bennett" <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]