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