I adopted @Mico 's solution in here to determine the singular or plural form of Appendix in the ToC based on the number of sections in the appendix part. It works well for this purpose.

However, I find that the solution has a side effect that the hyperlink to appendix is wrong and also bookmarks in the PDF.

Please see the following MWE. Appendix 1.A is wrongly referred to section 1.1. The same problem happens in Appendix 2.A which is linked to section 2.1. But the reference to Appendix 2.B is right.

If there are other ways to change the singular or plural form of Appendix in the ToC, I am happy to accept it as well.

\documentclass[11pt, a4paper, twoside]{book}

% solution in https://tex.stackexchange.com/a/47011/87806
%% For source of "@seccntformat" command, see book "The LaTeX Companion"
   {\csname the#1\endcsname\ \ }%  default
   {\csname #1@cntformat\endcsname}}%    enable individual control
%% Individual control: '\section@cntformat'
\newcommand{\section@cntformat}{\thechapter.\thesection\ \ }

% Macros to redefine numbering of appendix sections
\newcommand{\appname}{} % dummy definition
    \renewcommand{\section@cntformat}{\appendixname~\thesection\ \ }
    \renewcommand{\section@cntformat}{\thesection\ \ }}
\renewcommand\chapter{\normalsecnumbering % first, reset numbering style
    \origchapter} % second, execute the original \chapter command

\usepackage[ pdftex, plainpages = false, pdfpagelabels,
pdfpagelayout = useoutlines,
bookmarksopen = true,
bookmarksnumbered = true,
breaklinks = true,
colorlinks = true,
linkcolor = blue,
urlcolor  = blue,
citecolor = blue,
anchorcolor = green,
hyperindex = true,



\chapter{First chapter}
\section{A sections}
\subsection{A subsection}

See Appendix \ref{app:first}. % Wrongly referred to section 1.1


% \begin{subappendices}
\section{First appendix} \label{app:first}
% \end{subappendices}

\chapter{Second chapter}
\section{A section}
See Appendix \ref{app:first2}. % Wrongly referred to section 2.1

See Appendix \ref{app:second}. % Correct


% \begin{subappendices}
\section{First appendix} \label{app:first2}
\section{Second appendix} \label{app:second}
% \end{subappendices}


Your Answer

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

Browse other questions tagged or ask your own question.