1

I want to make Appendix A continue by Appendix B. This is the command I used:

\appendix
\include{appendixA} \label{appendixprocedure}
\newpage{\pagestyle{empty}\cleardoublepage}

\include{appendixB} \label{appendixlinearization}
\newpage{\pagestyle{empty}\cleardoublepage}

But I got both in the naming Appendix A.

CarLaTeX
  • 62,716
QiuHan
  • 49

3 Answers3

3

The only way I can reproduce this problem is by including the \appendix command inside your appendixA.tex and appendixB.tex. Here's an example that replicates this (even though it's an article without \includes, the principle remains the same):

enter image description here

\documentclass{article}

\begin{document}

\tableofcontents

\section{A section}

\appendix
\section{An appendix}

\appendix
\section{Another appendix}

\end{document}

If this is what you're doing, you're doing it wrong. \appendix resets appendix-specific counters (which may depend on your document class). Here's what \appendix does in book and report (comments added):

\newcommand\appendix{\par
  \setcounter{chapter}{0}% <--- Reset chapter counter
  \setcounter{section}{0}% <--- Reset section counter
  \gdef\@chapapp{\appendixname}%
  \gdef\thechapter{\@Alph\c@chapter}}

article does something similar, only one level down:

\newcommand\appendix{\par
  \setcounter{section}{0}% <--- Reset section counter
  \setcounter{subsection}{0}% <--- Reset subsection counter
  \gdef\thesection{\@Alph\c@section}}

It is obvious that \appendix reset the main appendix counters, so including it as part of every appendix unit is incorrect. Only use it once to demarcate the end of your regular chapters and the start of the appendices.

In conclusion, remove \appendix from your appendixA.tex and appendixB.tex.

Some things to note in your code:

  • Your \labels might not reference the correct location within your document, as it is only called at the end of every appendix.

  • \newpage does not take an argument, so don't use \newpage{..}.

  • If you want a blank (no header/footer) page between your appendices, consider reading Really blank pages between chapters or creating a page break command.

Werner
  • 603,163
1

Use the commands chapter, section (depending on your document class) and so on as in the rest of the document.

\documentclass[]{article}

\begin{document}

\tableofcontents

\section{First Section}
\subsection{A Subsection}

\section{Secound Section}
\subsection{A Subsection}

\appendix
\section{First Appendix}
\section{Secound Appendix}
\section{Third Appendix}

\end{document}

enter image description here

1

Normally, the \appendix should start the Appendix-part, so you can just start \sections after the appendix-command.