5

I'm having a problem when writing appendices for my thesis. This is the general structure:

\documentclass[11pt,a4paper,titlepage]{report}  
\usepackage[T1]{fontenc}  
\usepackage[latin9]{inputenc}  
\usepackage{amsmath}  
\usepackage{amsfonts}  
\usepackage{amssymb}  
\usepackage{graphicx}  

\begin{document}  
\chapter{Chap 1}  
...  
\appendix  
\chapter*{Appendix A}  
\addcontentsline{toc}{chapter}{Appendix A}  
\section{Section 1}  
...   
\chapter*{Appendix B}  
\addcontentsline{toc}{chapter}{Appendix B}  
\section{Section 1}  
...  
\end{document}  

For some reasons, all the sections in the two appendices are displayed like this: ".1" instead of "A.1" or "B.1". And the first section in Appendix B is numbered continuously from Appendix A (For example I have 3 sections in Appendix A. The first section in Appendix B is numbered as ".4"???)

Thank a lot for any suggestions to solve this problem!

2 Answers 2

5

Appendices should have a title. If you insist in not giving a title other than “Appendix A”, then you can add

\newcommand{\newappendix}{%
  \refstepcounter{chapter}\chapter*{Appendix \thechapter}%
  \addcontentsline{toc}{chapter}{Appendix \thechapter}%
}

to your preamble and do

\appendix
\newappendix\label{firstappendix}
\section{First section}

\newappendix\label{secondappendix}
\section{Another section}

Complete example

\documentclass[11pt,a4paper,titlepage]{report}

\newcommand{\newappendix}{%
  \refstepcounter{chapter}\chapter*{Appendix \thechapter}%
  \addcontentsline{toc}{chapter}{Appendix \thechapter}%
}


\begin{document}
\chapter{Chap 1}

\appendix

\newappendix\label{firstappendix}

\section{First section}

This is Appendix~\ref{firstappendix}


\newappendix\label{secondappendix}

\section{Another section}

This is Appendix~\ref{secondappendix}

\end{document}

enter image description here

1
  • Wow, amazing. This is exactly what I intend to do. Thank you so much!!!
    – atn
    Aug 14, 2013 at 22:34
4

Don't do this:

\chapter*{Appendix A}  
\addcontentsline{toc}{chapter}{Appendix A}  
\section{Section 1} 

Let LaTeX number the sections automatically:

\chapter{appendix title}  
\section{section title} 

That way the chapter/appendix counter will be incremented A B .... if you use unnumbered chapters the A and B are just letters in the appendix title and LaTeX doesn't see them as a counter.

1
  • Thanks for your help! This works very well too but the other solution is exactly how I intend to do (although it might be stupid...)
    – atn
    Aug 14, 2013 at 22:36

You must log in to answer this question.

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