From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Harkins Subject: Incorrect references to LaTeX Listings Date: Tue, 09 Jan 2018 18:58:37 +0800 Message-ID: <160da926dba.117630b7011054.8767956275007294613@zoho.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53439) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYrcR-0007W2-4a for emacs-orgmode@gnu.org; Tue, 09 Jan 2018 05:59:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYrcO-0002CG-4O for emacs-orgmode@gnu.org; Tue, 09 Jan 2018 05:58:59 -0500 Received: from sender-pp-091.zoho.com ([135.84.80.236]:25001) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eYrcN-00021j-Ul for emacs-orgmode@gnu.org; Tue, 09 Jan 2018 05:58:56 -0500 In-Reply-To: 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" 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