Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

\appendix \section{Appendix} gives me "A Appendix". How can I get "Appendix A"

share|improve this question
6  
Which documentclass are you using? Normally you write the name of the appendix in the sectioning command, not the word "Appendix". Anyway, the titlesec package should be helpful to change this. –  Martin Scharrer Apr 13 '11 at 16:25
1  
I'm using article. I just want section headings "Appendix A" then "Appendix B" and for these to appear in the contents correcty. –  Alex Apr 14 '11 at 11:30
    
Please provide a minimal example –  Joseph Wright Apr 20 '11 at 13:54
add comment

2 Answers

the only way i can see to do this is to redefine the \section command either just before or just after \appendix. this should do it:

\renewcommand\section{\@startsection {section}{1}{\z@}%
                                     {-3.5ex \@plus -1ex \@minus -.2ex}%
                                     {2.3ex \@plus.2ex}%
                                     {\normalfont\Large\bfseries Appendix }}

(this is simply a cut-and-paste of the definition from article.cls with \newcommand changed to \renewcommand and "Appendix" added at the end. be careful with the spacing; you have to supply the space after "Appendix"; it won't be done for you.)

using this, just input \appendix \section{}. this is admittedly brute force, but the question has been hanging around for a while with no answer, so something is probably better than nothing.

share|improve this answer
add comment

I'm copy-pasting the answer from yoda at this link. It is an exact answer of this question.


You can easily achieve what you want using the appendix package. Here's a sample file that shows you how. The key is the titletoc option when calling the package. It takes whatever value you've defined in \appendixname and the default value is Appendix.

\documentclass{report}
\usepackage[titletoc]{appendix}
\begin{document}
\tableofcontents

\chapter{Lorem ipsum}
\section{Dolor sit amet}
\begin{appendices}
  \chapter{Consectetur adipiscing elit}
  \chapter{Mauris euismod}
\end{appendices}
\end{document}

 The output looks like

enter image description here

share|improve this answer
    
Please don't post answers that are just links. Perhaps summarise what is important about the answers linked to for the purposes of the current question. –  Seamus Jul 12 '12 at 12:03
    
We have a policy against just posting links. I appreciate that in this case, the danger of link rot is less worrying since it's a link to another stack exchange site, but I think it's important to encourage good practices. –  Seamus Aug 10 '12 at 17:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.