auctex-devel
[Top][All Lists]
Advanced

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

reftex label support for lstlisting?


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

Hi 

The correct way that a one can have a reference to a lstlisting
environment is by using \lstset, but it seems that reftex does not
support this.


Please consider

,----
| \documentclass{article}
| \usepackage[numbered,framed]{matlab-prettifier}
| \usepackage[colorlinks]{hyperref}
|  \begin{document}
| \section{Label works with latex}
| 
| 
\lstset{style=Matlab-editor,basicstyle=\mlttfamily,escapechar=",mlshowsectionrules=true,mathescape=true,morecomment={[s]{\%\{}{\%\}}},language=Matlab,label=parallel,caption=
 ,captionpos=b,numbers=none}
| \begin{lstlisting}
|     [num,den]=series(num1,den1,num2,den2)
|     [num,den]=parallel(num1,den1,num2,den2)
|     [num,den]=feedback(num1,den1,num2,den2)
| \end{lstlisting}
| The reference works  \ref{parallel}, but reftex does encounter the label

| \section{Label works with reftex}
| 
\lstset{style=Matlab-editor,basicstyle=\mlttfamily,escapechar=",mlshowsectionrules=true,mathescape=true,morecomment={[s]{\%\{}{\%\}}},language=Matlab,label=,caption=
 ,captionpos=b,numbers=none}
| \begin{lstlisting}
| \label{lstl:test-matlab:1}
|     [num,den]=series(num1,den1,num2,den2)
|     [num,den]=parallel(num1,den1,num2,den2)
|     [num,den]=feedback(num1,den1,num2,den2)
| \end{lstlisting}
| Reftex finds the label \ref{lstl:test-matlab:1} but latex ignores it!!
| \end{document}
`----

Regards

Uwe Brauer 

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


reply via email to

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