auctex-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: reftex label support for lstlisting?


From: Uwe Brauer
Subject: Re: reftex label support for lstlisting?
Date: Sun, 09 Jan 2022 22:39:12 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

>>> "AE" == Arash Esbati <arash@gnu.org> writes:

> Hi Uwe,
> Uwe Brauer <oub@mat.ucm.es> writes:

>> The correct way that a one can have a reference to a lstlisting
>> environment is by using \lstset,

> Yet another correct way is to put the caption into the optional argument
> of the lstlisting environment.

I see, I obtained that by starting with an org file and converting it to
latex.

>> but it seems that reftex does not support this.

> AUCTeX has some code to parse the optional argument for a caption key
> and add the label key in that since 2017 (I think).  Just do `C-c C-e
> lstlisting RET caption=your caption RET' and you should be done.  This
> should work with RefTeX as well if you have a recent Emacs.
Thanks, I have a recent GNU emasc master and auctex master

However when I do that you propose I end up with 

\begin{lstlisting}[caption=feed],label={lstl:table:1}
if = x
[num,den]=feedback(num 1, den 1,num 2,den2)
\end{lstlisting}
\newpage
Note this \ref{lstl:table:1}


But latex does not find this label.

\begin{lstlisting}[caption=feed],label={lstl:table:1} 

Looks like a bug to me it should be 

\begin{lstlisting}[caption=feed,label={lstl:table:1}]

Shall I submit a bug report?

Uwe 

Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]