Hi,
I was just wondering how you could make the table of contents not show appendices?
Thanks
Page Layout ⇒ Contents without appendix
NEW: TikZ book now 40% off at Amazon.com for a short time.

-
- Posts: 87
- Joined: Tue Sep 14, 2010 6:58 pm
Re: Contents without appendix
Do you have a MWE? What class are you using?
Contents without appendix
I am using article but am not sure what an MWE is?west.logan wrote:Do you have a MWE? What class are you using?
-
- Posts: 87
- Joined: Tue Sep 14, 2010 6:58 pm
Re: Contents without appendix
Sorry about that. An MWE is "Minimum Working Example" and the forum rules specify that you should post one when asking a question. I'd suggest reading those right away. It helps others to be able to quickly help you, rather than spend a lot of time trying to come up with something they can test their ideas on.
Welcome to the forum!
Welcome to the forum!
Contents without appendix
Ah ok... So something like this:
I want it so that my table of contents only shows the sections rather than the appendices aswell.
Thanks
Code: Select all
Code, edit and compile here:
\documentclass[a4paper,12pt]{article}\begin{document}\tableofcontents\section{Section 1}.....\appendix\section{Appendix A}\end{document}
Thanks
-
- Posts: 87
- Joined: Tue Sep 14, 2010 6:58 pm
Contents without appendix
There are a couple of ways you could do it, one would be to use the
command. This would prevent it from showing up in the ToC but it would also eliminate automatic numbering.
If you need the automatic numbering, I'd suggest just changing it with something like:
I basically just redefined the section command after "\appendix" is called.
Code: Select all
\section*{First Appendix}
If you need the automatic numbering, I'd suggest just changing it with something like:
Code: Select all
Code, edit and compile here:
\documentclass[a4paper,12pt]{article}%command to remove appendix from ToC\renewcommand{\appendix}{%\setcounter{section}{0}\renewcommand{\section}[1]{%\addtocounter{section}{1}\vspace{1em}\par\noindent\bfseries\Large Appendix \Alph{section}: ##1%\vspace{1em}\par\noindent\normalfont\normalsize}%}\begin{document}\tableofcontents\section{First Section}This is some text.\section{Second Section}This is some more text.\appendix\section{First Appendix}This is some text.\section{Second Appendix}This is some more text\end{document}