I have a problem with the numbering of my appendix. This is my MWE:

\documentclass[oneside, openright, 12pt]{book}
\sloppy

\usepackage[plainpages=false,pdfpagelabels]{hyperref}
\hypersetup{
pdftitle={title},
pdfsubject={subject},
pdfauthor={author},
pdfborder={0 0 0}
}

\usepackage[titles]{tocloft}

\begin{document}
\pagenumbering{Alph}

\pagenumbering{roman}
\setcounter{page}{1}
\tableofcontents

\listoffigures
\tocentry{Figures}

\pagenumbering{arabic}
\chapter{chapter1}
dsfdsfdsfsdf
\section{section1}
\section{section2}
gfsdcsdfdsf
\section{section3}
dsfdsfdsf

\tocentry{Appendix}
\chapter*{appendix}
\section{appendix1}
\section{appendix2}

\bibliographystyle{alpha}
\bibliography{mwe/lit}
\tocentry{Literature}

\end{document}

As you can see in the following screenshot the numbering in my appendix simply continues from the last chapter. I want it to be A, B,... I figured out that \chapter*{} does not increment the necessary counters - there are many similar questions on stackoverflow... I fixed my problem like this:

\setcounter{chapter}{\thechapter+1}
\setcounter{section}{0}
\renewcommand{\thesection}{\Alph{section}}
\chapter*{appendix}

It solved my problem. But now, I've observed another problem with my Hyperref table of contents within the pdf viewer: My appendix and literature are placed as a subsection of chapter1->section3.

Does anyone know how to solve this problem? Thanks in advance :-)

• Replace \tocentry{Appendix} with \appendix and write  \chapter{appendix1},\chapter{appendix2} instead of  \section{appendix1} and  \section{appendix2}. – Bobyandbob Aug 1 '17 at 8:44
• – Bobyandbob Aug 1 '17 at 9:03

If you really want to add your appendices as sections instead chapters (I do not recommend this) you can use:

\usepackage{xpatch}
\xapptocmd\appendix
{}{\PatchFailed}

and

\appendix
\section{appendix1}
\section{appendix2}

Use package tocbibind for the ToC entrys of the lists and the bibliography to ensure the correct page numbers in the table of contents.

Use \cleardoublepage before \pagenumbering{...}.

\documentclass[oneside, openright, 12pt]{book}
\usepackage[nottoc]{tocbibind}% add a ToC entry for lists, index and bibliography

\usepackage{xpatch}
\xapptocmd\appendix
{}{\PatchFailed}

\usepackage[plainpages=false,pdfpagelabels]{hyperref}
\hypersetup{
pdftitle={title},
pdfsubject={subject},
pdfauthor={author},
pdfborder={0 0 0}
}

\begin{document}
\pagenumbering{roman}
\tableofcontents
\listoffigures

\cleardoublepage% <-must be added before \pagenumbering
\pagenumbering{arabic}
\chapter{chapter1}
Text
\section{section1}
Text
\section{section2}
Text
\section{section3}
Text

\appendix
\section{appendix1}
\section{appendix2}

\bibliographystyle{alpha}
\bibliography{mwe/lit}
\end{document}

Result:

• Thank you very much! I nevertheless decided to use Bobyandbob's solution. – lukasl1991 Aug 1 '17 at 18:32
• Do I have to use \cleardoublepage before every \pagenumbering call ??? – lukasl1991 Aug 2 '17 at 6:54
• The page numbering is changed on the page where \pagenumbering is called. You have to ensure that this is not the last page of the previous chapter (or list). For a onesided document or a twosided with openright it would be enough to shift \pagenumbering after \chapter, because \chapter starts a new page. But if you switch to a twosided document with openany, you have to ensure that the page numbering changes on a right page. – esdd Aug 2 '17 at 7:13