I'm wrapping up my dissertation and my table of contents currently reads along these lines:
-
- chapter one
- 1.1 section one
- 1.2 section two
- chapter one
-
- chapter two
- 2.1 section one
- 2.2 section two
- chapter two
- A. appendix for chapter one
- B. appendix for chapter two
if at all possible, i'd really like to be able to do something along these lines:
-
- chapter one
- 1.1 section one
- 1.2 section two
- 1.A appendix
- chapter one
-
- chapter two
- 2.1 section one
- 2.2 section two
- 2.A appendix
- chapter two
does anyone know how to do this sort of thing? thanks in advance!
Edit
Thank you for the quick reply @Au101. ideally i'd like the actual appendix to chapter one to come before the actual start of chapter two. i am pretty experienced with latex, but this is my first time putting together a book-like document rather than just an individual article…
Best Answer
Some weird code-golfing with
xparse
and a slightly (;-)) modified\section
command -- do not use\subsection
there!I just added a 4th optional argument to
\section
, which is a*
, indicating that this should be an appendix section, going right here, not at the end of the document. (well, a chapter appendix then)It will break if another 'normal'
\section
will follow.All is reset if the next
\chapter
comes into action.And there is some warning by
hyperref
, but the links work.Update Improved interface and preventing sections to be added after some section has been declared as
appendix
section. It automatically adds aAppendix
and a clearpage.subsections
etc. work as expected as well as references.The macro call is
\section![toc title]{body title}
if is meant to be an appendix section at the end of the chapter. If!
is omitted, the standard command is used.