Re: [O] Incorrect references to LaTeX Listings

2018-01-10 Thread James Harkins
 On Tue, 09 Jan 2018 20:35:37 +0800 Eric S Fraga  wrote 
 
> Check org-latex-prefer-user-labels. 

OK, this works for me, thanks.

FWIW, org-latex-prefer-user-labels eluded me in the documentation. Now that you 
pointed me to it, I see the reason for the change, but I wouldn't have guessed 
it on my own.

I'll update org when I can.

In any case, thanks.
hjh




Re: [O] Incorrect references to LaTeX Listings

2018-01-09 Thread Nicolas Goaziou
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



Re: [O] Incorrect references to LaTeX Listings

2018-01-09 Thread Eric S Fraga
On Tuesday,  9 Jan 2018 at 18:58, James Harkins wrote:
> I have several org documents containing source code listings, with
> references such as the following:

[...]

> Well, there is no label orgsrcblock1, so the exported document shows
> "??" instead of a listing number.

Check org-latex-prefer-user-labels.

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.6-317-gc82c21


signature.asc
Description: PGP signature


[O] Incorrect references to LaTeX Listings

2018-01-09 Thread James Harkins
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