I am using the appendices and the varioref package to refer at them.
The code for the appendices is the following:
\documentclass{book}
\begin{document}
\begin{appendices}
\appendixpage
\noappendicestocpagenum
\addappheadtotoc
\chapter[MATLAB codes]{List of MATLAB codes} \label{app:MATLAB}
\begin{lstlisting} [language=Matlab, caption=Reconstruction function., label=code:reconstruction]
some text
\end{lstlsiting}
\end{appendices}
\end{document}
when i quote them in the text i do it this way:
In appendix \vref{app:MATLAB} we have the code \vref{code:reconstruction}
the results are strange, like:"In the appendix chapter A we have the code ?? A.1 on page 121".
Is it normal?
I am using (in this order) these packages:
\usepackage{varioref}
\usepackage{hyperref}
\usepackage{cleveref}
Thank you in advance.
matlab-prettifier
package; see this answer.