3

I am writing my thesis using a document class that has chapters and then sections under them. Because the chapters are about pretty unrelated topics, I'd like to put the appendices at the end of each chapter (at section level) that they belong (instead of having all the appendices at the end).

One way that I found that mostly worked was to put this in front of each of the appendices

\newcounter{ninjalevel}
\setcounter{ninjalevel}{1}

\renewcommand{\theequation}{\arabic{chapter}.\Alph{ninjalevel}.\arabic{equation}}
\renewcommand{\thesection}{\arabic{chapter}.\Alph{ninjalevel}}

and then reset \theequation and \thesection after the appendices. But I have to do this for each chapter and it's kind of clumsy. Are there better ways?

Btw, I am not even sure if this is the right terminology. Can you have appendices not at the end of the documents, or should they be called something else? Thanks!

1 Answer 1

4

The subappendices environment of the appendix package pretty much does what you want. In addition, use the chngcntr package to couple the equation counter to the section level.

\documentclass{report}

\usepackage{appendix}

\usepackage{chngcntr}
\counterwithin{equation}{section}

\begin{document}

\chapter{foo}

\section{foofirst}

\begin{equation}
a^2 + b^2 = c^2
\end{equation}

\begin{subappendices}

\section{foofirstappendix}

\begin{equation}
d^2 + e^2 = f^2
\end{equation}

\end{subappendices}

\chapter{bar}

\section{barfirst}

\begin{equation}
g^2 + h^2 = i^2
\end{equation}

\end{document}
0

You must log in to answer this question.

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