From: James Harkins <jamshark70@zoho.com>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Incorrect references to LaTeX Listings
Date: Tue, 09 Jan 2018 18:58:37 +0800 [thread overview]
Message-ID: <160da926dba.117630b7011054.8767956275007294613@zoho.com> (raw)
In-Reply-To:
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
next reply other threads:[~2018-01-09 10:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-09 10:58 James Harkins [this message]
2018-01-09 12:35 ` Incorrect references to LaTeX Listings Eric S Fraga
2018-01-10 9:14 ` James Harkins
2018-01-09 12:50 ` Nicolas Goaziou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=160da926dba.117630b7011054.8767956275007294613@zoho.com \
--to=jamshark70@zoho.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.