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