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}
\newcommand\tocentry[1]{\addcontentsline{toc}{chapter}{#1}}
\begin{document}
\pagenumbering{Alph}
\pagenumbering{roman}
\setcounter{page}{1}
\tableofcontents
\listoffigures
\tocentry{Figures}
\pagenumbering{arabic}
\chapter{chapter1}
dsfdsfdsfsdf
\section{section1}
dsafdsaffdasfdasfffadsfffadsff
\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 :-)
\tocentry{Appendix}
with\appendix
and write ` \chapter{appendix1},
\chapter{appendix2}` instead of ` \section{appendix1}` and ` \section{appendix2}`.