>>> "AE" == Arash Esbati <[email protected]> writes:

> Hi Uwe,
> Uwe Brauer <[email protected]> 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