From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Incorrect references to LaTeX Listings Date: Tue, 09 Jan 2018 13:50:27 +0100 Message-ID: <87wp0r2o30.fsf@nicolasgoaziou.fr> References: <160da926dba.117630b7011054.8767956275007294613@zoho.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34484) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYtMP-0003ys-Dt for emacs-orgmode@gnu.org; Tue, 09 Jan 2018 07:50:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYtML-0003Nf-Vx for emacs-orgmode@gnu.org; Tue, 09 Jan 2018 07:50:33 -0500 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:35218) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eYtML-0003LN-O4 for emacs-orgmode@gnu.org; Tue, 09 Jan 2018 07:50:29 -0500 In-Reply-To: <160da926dba.117630b7011054.8767956275007294613@zoho.com> (James Harkins's message of "Tue, 09 Jan 2018 18:58:37 +0800") 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: James Harkins Cc: emacs-orgmode Hello, James Harkins 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