0

I have an appendix with multiple sections that each contain multiple subsections. Each subsection contains an appendix (named for instance A1, A2, etc.). When I refer to one of the appendices, it only mentions the letter (the section), but it doesn't mention the number (the subsection / the specific appendix file).

My appendices are coded with:

\begin{appendices}
\section{interviews}
\includepdf[scale=0.95,pages=1,pagecommand=\subsection{Interview: Christine}]{fig/interviews/christine.pdf}
\label{appendix:christine}

\includepdf[scale=0.95,pages=1,pagecommand=\subsection{Interview: Hans-Frederik}]{fig/interviews/hf.pdf}
\label{appendix:hf}

\end{appendices}

I know it doesn't get any easier when the appendices are .pdf-files, and the pagecommand=\subsection{..} is to prevent the pdf from changing to a new page from the subsection.

These are named A1 and A2 respectively in the report when I export it to a pdf, but referring to them with

\ref{appendix:christine}
\ref{appendix:hf}

produces the same output (just A).

\ref{app:christine}

produces ??.

So how can I refer to them and get A1 and A2?

thanks in advance!

1 Answer 1

2

You can extend the \pagecommand with a label for the subsection, surrounded by {}.

MWE:

\documentclass{article}
\usepackage{appendix}
\usepackage{pdfpages}
\begin{document}
References: \ref{appendix:christine}, \ref{appendix:hf}.
\begin{appendices}
\section{interviews}
\includepdf[scale=0.95,pages=1,pagecommand={\subsection{Interview: Christine}\label{appendix:christine}}]{christine.pdf}

\includepdf[scale=0.95,pages=1,pagecommand={\subsection{Interview: Hans-Frederik}\label{appendix:hf}}]{hf.pdf}

\end{appendices}
\end{document}

This produces:

References: A.1, A.2.

For further reference, please provide a complete example, including the document class and packages (such as the MWE given here). This makes it easier for the community to reproduce the problem and provide a solution.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .