1

In my report I have quite a lot of appendices (pdf's). I want to refer to them as A.1, A.2.....and so on It all works fine for A , B and C, but when i refer to any appendix under C, the refrence in the output pdf is printed as C.3.

In the code I use \ref{appendix:....}

\newpage
\pagenumbering{roman}
\appendix
\addtocontents{toc}{\protect\setcounter{tocdepth}{1}}
\noappendicestocpagenum
\renewcommand{\appendixtocname}{Vedlegg}
\addappheadtotoc
\includepdf[pages=1, pagecommand={\section{A}\label{appendix:A}},linktodoc=true]{A.pdf}

\newpage

\includepdf[pages = 1, scale = 0.72, fitpaper=true, pagecommand ={\section{B}\label{appendix:B}}, linktodoc = true]{B.pdf}

\newpage

\section{C}
\subsection{C.1}
\label{appendix:C.1}
\includegraphics[scale = 2]{C.1.jpg}
\newpage


\subsection{C.2}
\label{appendix:C.2}
\begin{center}
 \includegraphics[scale = 0.8]{C.2.jpg} 
\end{center}

\newpage

\subsection{C.3}
\includegraphics[scale = 0.9]{C.3.jpg}\label{appendix:C.3}  


\newpage
\includepdf[pages = 1, scale = 0.65, fitpaper=true, pagecommand ={\section{D}\subsection{D.1}\label{appendix:D.1}}, linktodoc = true]{D.1.pdf}
\newpage

\includepdf[pages = 1, scale = 0.72, fitpaper=true, pagecommand ={\subsection{D.2}}\label{appendix:D.2}, linktodoc = true]{D.2.pdf}
  • I had the labels outside pagecomand{}.., Problem soved – Marte Tostrup May 14 '18 at 16:27
1

I had the labels outside \pagecomand{...}. Problem soved!

  • Your code example has all the \labels within the \pagecommand. So, how does this answer help? – Werner May 14 '18 at 17:05
  • Not if you look at D.2, i noticed that i got the right reference at D.1, but from D.2 and down they all said C.3 – Marte Tostrup May 14 '18 at 17:32
  • Riiight. I missed that one. I'll delete my comments. – Werner May 14 '18 at 17:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.