Hacer referencia a una no figura en el Apéndice

Hacer referencia a una no figura en el Apéndice

Tengo una sección de apéndices personalizada, que incluye varios apéndices diferentes, por ejemplo, Apéndice A, Apéndice B, etc. Dentro de cada apéndice, tengo tablas, figuras y, a veces, también páginas tomadas de un PDF (que no son figuras) y, por lo tanto, no las titulo como tales, sino que les doy un título de sección personalizado que no aparece en la tabla de contenido. . Aquí hay un MWE.

\documentclass[12pt, a4paper]{memoir}
\usepackage[utf8]{inputenc}
\usepackage[dvips]{graphicx} % to include images
\usepackage[bookmarksnumbered, breaklinks=true,colorlinks=true, linkcolor=black, urlcolor=blue, citecolor=blue, bookmarks=true]{hyperref}
\usepackage[nameinlink,noabbrev]{cleveref}
\crefname{page}{p.}{pp.}
\crefname{figure}{figure}{figures}

\settypeblocksize{237mm}{150mm}{*} % size of text block on page
\setulmargins{3.5cm}{*}{*} % sets start of text on page after ruled header
\setheadfoot{\onelineskip}{2\onelineskip}
\setheaderspaces{2cm}{*}{*} % start of rule header line on page
\setlrmarginsandblock{3.5cm}{2.5cm}{*} % left and right margins
\checkandfixthelayout

%%% MAKE CHAPTER IN APPENDIX LOOK LIKE SECTIONS
\cftinsertcode{APP}{
  \setlength\cftchapterindent{\cftsectionindent}
  \setlength\cftbeforechapterskip{0pt}
  \renewcommand*{\cftappendixname}{\appendixname\space}
  \renewcommand{\cftchapteraftersnum}{:}
  \renewcommand\cftchapterdotsep{\cftdotsep} % Chapters should use dots in ToC
  \renewcommand\cftchapterfont{\normalfont}
  \renewcommand\cftchapterpagefont{\normalfont}
}

%%% PREVENT APPENDIX SECTIONS TO BE ADDED TO TOC
\newcommand{\nocontentsline}[3]{}
\newcommand{\tocless}[2]{\bgroup\let\addcontentsline=\nocontentsline#1{#2}\egroup}

%%% CUSTOM CHAPTER STYLE FOR APPENDICES
\makechapterstyle{appendix}{%
  \chapterstyle{default}
  \setlength{\beforechapskip}{3.5ex}
  \renewcommand*{\chapterheadstart}{\vspace{\beforechapskip}}
  \setlength{\afterchapskip}{2.3ex}
  \renewcommand{\chapnumfont}{\normalfont\bfseries\Large}
  \renewcommand{\chapnamefont}{\normalfont\bfseries\Large}
  \renewcommand{\chaptitlefont}{\normalfont\bfseries\Large}
  \renewcommand{\printchapternum}{\chapnumfont~\thechapter}
  \renewcommand{\afterchapternum}{:\space}
}

\renewcommand{\contentsname}{Table of Contents}
\maxsecnumdepth{subsubsection} % chapters, sections, subsections numbered
\maxtocdepth{subsection}

\begin{document}

% TABLE OF CONTENTS
\SingleSpacing
\tableofcontents*
\clearpage % Force a break to new page

\chapter{Chapter title}
\section{A first section title}
\section{A second section title}
Just some text. I'd like to reference Appendix A2 here by doing (see \Cref{appendix:A2}, \cpageref{appendix:A2}), but it only references to A not to A2.

\appendix
\appendixpage % cover page appendix
\cftinserthook{toc}{APP}
\chapterstyle{appendix}

%appendix A content
\chapter{Some title for first appendix}
\label{appendix:A}

\tocless\section{Information Form - Page 1/2}
\begin{figure}[!htb]
\label{appendix:A1}
\fbox{\includegraphics[page=1,width=14.5cm]{info.pdf}}
\end{figure}

\tocless\section{Information Form - Page 2/2}
\begin{figure}[!htb]
\label{appendix:A2}
\fbox{\includegraphics[page=2,width=14.5cm]{info.pdf}}
\end{figure}

\chapter{Some title for next appendix}
\label{appendix:B}
Nothing here yet.

\end{document}

Así es como se ve una vez compilado.PDF de ejemplo... Mi problema es que me gustaría hacer referencia al Apéndice A2 en el texto. Por el momento la referencia dice Apéndice A, pero debería decir Apéndice A2. ¿Alguna sugerencia sobre cómo se puede lograr esto? Gracias.

Respuesta1

Usar \labelsin \captiones inútil allí, ya que necesita un \refstepcountercomando por adelantado, que se realiza internamente mediante \caption, es decir, un manual \refstepcounter{figure}\label{...}debería resolver el problema para ambos ejemplos, pero esto puede resultar tedioso si tiene más secciones 'falsas' sin subtítulos. .

\documentclass[12pt, a4paper]{memoir}
\usepackage[utf8]{inputenc}
\usepackage[demo]{graphicx} % to include images
\usepackage[bookmarksnumbered, breaklinks=true,colorlinks=true, linkcolor=black, urlcolor=blue, citecolor=blue, bookmarks=true]{hyperref}
\usepackage[nameinlink,noabbrev]{cleveref}
\crefname{page}{p.}{pp.}
\crefname{figure}{figure}{figures}

\settypeblocksize{237mm}{150mm}{*} % size of text block on page
\setulmargins{3.5cm}{*}{*} % sets start of text on page after ruled header
\setheadfoot{\onelineskip}{2\onelineskip}
\setheaderspaces{2cm}{*}{*} % start of rule header line on page
\setlrmarginsandblock{3.5cm}{2.5cm}{*} % left and right margins
\checkandfixthelayout

%%% MAKE CHAPTER IN APPENDIX LOOK LIKE SECTIONS
\cftinsertcode{APP}{
  \setlength\cftchapterindent{\cftsectionindent}
  \setlength\cftbeforechapterskip{0pt}
  \renewcommand*{\cftappendixname}{\appendixname\space}
  \renewcommand{\cftchapteraftersnum}{:}
  \renewcommand\cftchapterdotsep{\cftdotsep} % Chapters should use dots in ToC
  \renewcommand\cftchapterfont{\normalfont}
  \renewcommand\cftchapterpagefont{\normalfont}
}

%%% PREVENT APPENDIX SECTIONS TO BE ADDED TO TOC
\newcommand{\nocontentsline}[3]{}
\newcommand{\tocless}[2]{\bgroup\let\addcontentsline=\nocontentsline#1{#2}\egroup}

%%% CUSTOM CHAPTER STYLE FOR APPENDICES
\makechapterstyle{appendix}{%
  \chapterstyle{default}
  \setlength{\beforechapskip}{3.5ex}
  \renewcommand*{\chapterheadstart}{\vspace{\beforechapskip}}
  \setlength{\afterchapskip}{2.3ex}
  \renewcommand{\chapnumfont}{\normalfont\bfseries\Large}
  \renewcommand{\chapnamefont}{\normalfont\bfseries\Large}
  \renewcommand{\chaptitlefont}{\normalfont\bfseries\Large}
  \renewcommand{\printchapternum}{\chapnumfont~\thechapter}
  \renewcommand{\afterchapternum}{:\space}
}

\renewcommand{\contentsname}{Table of Contents}
\maxsecnumdepth{subsubsection} % chapters, sections, subsections numbered
\maxtocdepth{subsection}

\begin{document}

% TABLE OF CONTENTS
\SingleSpacing
\tableofcontents*
\clearpage % Force a break to new page

\chapter{Chapter title}
\section{A first section title}
\section{A second section title}
Just some text. I'd like to reference Appendix A2 here by doing (see \Cref{appendix:A2}, \cpageref{appendix:A2}), but it only references to A not to A2.

\appendix
\appendixpage % cover page appendix
\cftinserthook{toc}{APP}
\chapterstyle{appendix}

%appendix A content
\chapter{Some title for first appendix}
\label{appendix:A}

\tocless\section{Information Form - Page 1/2}
\begin{figure}[!htb]
\refstepcounter{figure}%
\label{appendix:A1}
\fbox{\includegraphics[page=1,width=14.5cm]{info.pdf}}
\end{figure}

\tocless\section{Information Form - Page 2/2}
\begin{figure}[!htb]
\refstepcounter{figure}%
\label{appendix:A2}
\fbox{\includegraphics[page=2,width=14.5cm]{info.pdf}}
\end{figure}

\chapter{Some title for next appendix}
\label{appendix:B}
Nothing here yet.

\end{document}

información relacionada