emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Incorrect references to LaTeX Listings


From: Nicolas Goaziou
Subject: Re: [O] Incorrect references to LaTeX Listings
Date: Tue, 09 Jan 2018 13:50:27 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

Hello,

James Harkins <address@hidden> writes:

> I have several org documents containing source code listings, with references 
> such as the following:
>
> ```
> * Section
>
> #+name: codeblock
> #+caption: Hello, world.
>
> #+BEGIN_SRC C
> // Hello, world
> #+END_SRC
>
> Reference to [[codeblock]].
> ```
>
> I've been doing this for years, never had any problem.
>
> Today, I get the following sort of LaTeX export (assuming the Listings 
> package):
>
> ```
> \section{Section}
> \label{sec:orgheadline1}
> \lstset{language=C,label=codeblock,caption={Hello, 
> world.},captionpos=b,numbers=none}
> \begin{lstlisting}
> // Hello, world
> \end{lstlisting}
>
> Reference to \ref{orgsrcblock1}.
> ```
> Well, there is no label orgsrcblock1, so the exported document shows
> "??" instead of a listing number.

FWIW, I cannot reproduce it on a recent Org.

> So, how do I make source block references work the way they used to?
> Rather critical for me -- this is one of /the/ main reasons why
> I prefer to write in org and export LaTeX.

You could update Org.

> org 8.3.3 -- I'm using the packages provided by Ubuntu 16.04. (I
> realize distro packages are usually behind, but I wouldn't have
> expected a seriously broken org version to make it into package
> repositories, especially for a feature whose malfunction would not be
> tolerated by the technical writers in org's user base. So I suspect
> there must be some configuration issue, rather than a bug.)

I'm also surprised this doesn't work in Org 8.3.3, but my time machine
is being repaired at the moment, so there is nothing I can do about it.
Meanwhile, let me quote the usual licensing stuff, included in every Org
library (caps are not mine):

    ;; GNU Emacs is distributed in the hope that it will be useful,
    ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
    ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    ;; GNU General Public License for more details.

Again, I suggest to update Org. Release 8.3.3 is very old.

Regards,

-- 
Nicolas Goaziou



reply via email to

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