1

I want to continue the numbering of my Appendix in Roman. But if I switch after \begin{appendices} to Roman, the divider page is not included. If I switch the numbering before the appendix, my last chapter has Roman numbering, too. Can I switch to Roman beginning with the Divider Page?

\documentclass[a4paper,12pt,oneside]{report}
\usepackage[toc,page]{appendix}
\newcounter{savepage}
\begin{document}
  \pagenumbering{Roman}
  \pagestyle{plain}

  \tableofcontents
  \cleardoublepage

  \chapter{Introduction}
  \setcounter{savepage}{\arabic{page}}
  \pagenumbering{arabic}
  \chapter{Conclusion and Outlook}\label{ch_conclusion}

  \begin{appendices}
    \pagenumbering{Roman}
    \setcounter{page}{\thesavepage}
    \addtocontents{toc}{\protect\setcounter{tocdepth}{1}}
    \makeatletter
    \addtocontents{toc}{%
        \begingroup
        \let\protect\l@chapter\protect\l@section
        \let\protect\l@section\protect\l@subsection
    }
    \makeatother        
    \addtocontents{toc}{\endgroup}      
  \end{appendices}
\end{document}

Thanks for your help!

1
  • 1
    Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – Stefan Pinnow Oct 6 '19 at 10:38
1

Use \cleardoublepage followed by the change of the pagenumbering before \begin{appendices}:

\documentclass[a4paper,12pt,oneside]{report}
\usepackage[toc,page]{appendix}
\newcounter{savepage}
\begin{document}
  \pagenumbering{Roman}
  \pagestyle{plain}
  \tableofcontents
  %\cleardoublepage
  \chapter{Introduction}

  \cleardoublepage
  \setcounter{savepage}{\value{page}}
  \pagenumbering{arabic}
  \chapter{Conclusion and Outlook}\label{ch_conclusion}

  \cleardoublepage
  \pagenumbering{Roman}
  \setcounter{page}{\value{savepage}}
  \begin{appendices}
    \addtocontents{toc}{\value{tocdepth}=1}
    \makeatletter
    \addtocontents{toc}{%
        \begingroup
        \let\protect\l@chapter\protect\l@section
        \let\protect\l@section\protect\l@subsection
    }
    \makeatother
    \chapter{Appendix chapter}
    \section{Appendix section}
  \end{appendices}
\end{document}
1
  • Thank you very much! – shermes Oct 6 '19 at 14:01
0

You need to eject the page you need to know the number of, which is done by setting the value of savepage after \cleardoublepage.

I also suggest not to use \arabic{page} or \thesavepage, but \value{page} and \value{savepage}.

Also it's better to use abstract command and to avoid lengthy code in the document body. It's easy to patch appendices to do the necessary job. Thus the code in the body is much cleaner.

\documentclass[a4paper,12pt,oneside]{report}
\usepackage[toc,page]{appendix}
\usepackage{etoolbox}

\usepackage{lipsum} % for context

\newcounter{savepage}
% when appendices starts we need to reset the page number
\pretocmd{\appendices}
  {\cleardoublepage\pagenumbering{Roman}\setcounter{page}{\value{savepage}}}
  {}{}
% before the appendices we need to setup the toc
\apptocmd{\appendices}
  {%
   \addtocontents{toc}{\string\setcounter{tocdepth}{1}}%
   \addtocontents{toc}{%
     \begingroup
     \let\string\l@chapter\string\l@section
     \let\string\l@section\string\l@subsection
   }%
  }
  {}{}
% when the appendices end we need to end the group
\pretocmd{\endappendices}{\addtocontents{toc}{\endgroup}}{}{}

% front matter with Roman numbers
\newcommand{\frontmatter}{%
  \cleardoublepage\pagenumbering{Roman}\pagestyle{plain}%
}
% main matter with arabic numbers (but save the page number up to here)
\newcommand{\mainmatter}{%
  \cleardoublepage
  \setcounter{savepage}{\value{page}}%
  \pagenumbering{arabic}%
  \pagestyle{headings}% or whatever you like
}

\begin{document}

\frontmatter

\tableofcontents

\chapter*{Introduction}
\addcontentsline{toc}{chapter}{Introduction}

\lipsum

\mainmatter

\chapter{First}

\lipsum

\chapter{Conclusion and Outlook}\label{ch_conclusion}

\begin{appendices}

\chapter{First appendix}

\lipsum

\section{First section}

\lipsum

\chapter{Second appendix}

\lipsum

\end{appendices}

\end{document}

enter image description here

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.