0

To write my thesis, I am using

\documentclass[a4paper,12pt]{book}

I added two chapters, then I included an article with two appendices.

The problem is that both appendices have the number 3.A in the table of contents. I using this for appendices

\usepackage[titletoc]{appendix}
\renewcommand\@pnumwidth{2.15em}
\renewcommand\@tocrmarg{3.15em} % \@tocrmarg-\@pnumwidth=1
\usepackage{mwe}
\usepackage{appendix}
\usepackage{etoolbox}
\BeforeBeginEnvironment{appendices}{\edef\TheChapter{\thechapter}}
\AtBeginEnvironment{appendices}{\renewcommand\thesection{\TheChapter.\Alph{section}}}

How can I change the numeber of the second one to 3.B?

Thanks

4
  • 2
    you should provide an example that shows the problem, but you seem to be setting up appendices to use the section counter so do you have \section before each of them? (with no example it is not at all clear why you need \TheChapter) Commented May 30, 2019 at 12:34
  • this is what i have in the article \begin{appendices} \section{Appendex 1 }\end{appendices} \begin{appendices} \section{Appendex 2 }\end{appendices}
    – user640960
    Commented May 30, 2019 at 12:37
  • that is probably the error then (it is hard for people to fix your code if you do not show it) you should (I assume) only have one appendices enviornment, with both sections, please fix the example in your question so it starts \documentclass and ends \end{document} and shows the problem, then it will be easy for someone to fix it without having to guess what you might have done in parts not shown. Commented May 30, 2019 at 12:41
  • Exactly that is the problem, thanks a lot
    – user640960
    Commented May 30, 2019 at 12:53

1 Answer 1

1

The problem is unrelated to the code in the question, but as shown in the comments, you should only have one appendices environment (as this resets the counters) not one around each appendix.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .