all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Incorrect references to LaTeX Listings
@ 2018-01-09 10:58 James Harkins
  2018-01-09 12:35 ` Eric S Fraga
  2018-01-09 12:50 ` Nicolas Goaziou
  0 siblings, 2 replies; 4+ messages in thread
From: James Harkins @ 2018-01-09 10:58 UTC (permalink / raw)
  To: emacs-orgmode

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.

I checked the manual to see if any of the syntax had changed, but I don't see any. I also tried doing

#+CAPTION:
#+NAME:
#+BEGIN_SRC
...

... but no difference -- I still get the wrong reference in the text.

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.

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.)

hjh

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-01-10  9:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-09 10:58 Incorrect references to LaTeX Listings James Harkins
2018-01-09 12:35 ` Eric S Fraga
2018-01-10  9:14   ` James Harkins
2018-01-09 12:50 ` Nicolas Goaziou

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.