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:....}

\includepdf[pages=1, pagecommand={\section{A}\label{appendix:A}},linktodoc=true]{A.pdf}


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


\includegraphics[scale = 2]{C.1.jpg}

 \includegraphics[scale = 0.8]{C.2.jpg} 


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

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

\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

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.