# Why does \ref show A instead of A1? [duplicate]

I want to know why when I'm using /ref{} it only show A, but I'm actually are referring to A1.

\documentclass[../main.tex]{subfiles}

\begin{document}
\appendix

\section{Vedlegg Arbeidspakker}

\includepdf[scale=0.85,pages=1,pagecommand=
\subsection{Lekkasjedeteksjon på ledningsnett},offset=0 -3cm]{../vedlegg/ArbeidspakkeLekkasjedeteksjon.pdf}
\label{atc:ArbeidspakkeLekkasjedeteksjon}

\includepdf[scale=0.85,pages=1,pagecommand=
\subsection{Flomsikring},offset=0 -3cm]{../vedlegg/ArbeidspakkeFlomsikring.pdf}
\label{atc:ArbeidspakkeFlomsikring}

\section{Vedlegg Tidsplan}

\includepdf[scale=1,pages=-,pagecommand=
\subsection{Timeplanlegging},offset=0 -3cm]{../vedlegg/Timeplanlegging.pdf}
\label{atc:Timeplanlegging}

\includepdf[scale=1,pages=-,pagecommand=
\subsection{Gantt},offset=0 -3cm]{../vedlegg/Gantt.pdf}
\label{atc:Gantt}

\end{document}



Example:

Se vedlegg \ref{atc:Timeplanlegging} og \ref{atc:Gantt}.


Become "Se vedlegg B og B", but they are B.1 and B.2 from TOC.

Is it possible to change it so B og B become B.1 and B.2

• Welcome to TeX.se, and thanks for adding a sample document. But unfortunately this document doesn't really help, since it depends completely on included files we don't have. Can you reproduce your problem without these files, and then edit your question to show that document? – Alan Munn Jan 26 '20 at 20:03
• Try putting the \label commands inside the \subsection code. – Alan Munn Jan 26 '20 at 20:08
• That actually did the trick Alan! Thank you. And yes, I will try to come up with a better sample next time. – Peder Jan 26 '20 at 20:15
• Since your question code is hard to reproduce, I suggest we close the question as a duplicate of Understanding how references and labels work – Alan Munn Jan 26 '20 at 20:20
• Yes, thats ok. Thanks again :) – Peder Jan 26 '20 at 20:21