GeneralGet the word Appendix in heading

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
matt1
Posts: 3
Joined: Wed Oct 26, 2011 1:48 pm

Get the word Appendix in heading

Post by matt1 »

Hello,

I've used latex a few years ago for creating a report, now I am creating an article. I changed the formatting to remove the contents page and numbering. However, once I created my appendix I lose the "Appendix A" at the top of the page to simply "A". How do I get the prefix "Appendix" back? I must have removed it somehow when I eliminated my contents.

Code 1, appendix file. Code 2, main file.

Thank you.

Code: Select all

\section{Data}
\centerline{\rule{149mm}{.02in}}
\vspace{2cm}

Stuff.

Code: Select all

\documentclass[11pt,a4paper]{article}

% Package for figures
\usepackage{lscape,graphicx}

\usepackage{url}
%\usepackage{times}
\usepackage{alltt}
\usepackage{subfigure}
\usepackage{mathptmx}  % if you have maths
\newcommand{\PD} [2]{\frac{\partial #1}{\partial #2}}

\usepackage{blindtext}

% Various parameters
\setlength{\hoffset}{0in}
\setlength{\textheight}{8.75in}
\setlength{\textwidth}{6.25in}
\setlength{\headsep}{0.5in}
\setlength{\footskip}{0.5in}
\setlength{\oddsidemargin}{0in}
\setlength{\evensidemargin}{0in}
\renewcommand{\baselinestretch}{1.5}
\setlength{\footnotesep}{3ex}

\setcounter{secnumdepth}{-1}

\begin{document}

\thispagestyle{empty}

\include{cover}          % This is the front page

\pagestyle{plain}
\pagenumbering{roman}
\setcounter{page}{1}

\addtolength{\parskip}{\baselineskip}
\setlength{\parindent}{0in}

% Set up page numbering
\pagenumbering{arabic}
\setcounter{page}{1}

\include{abstract}
\include{intro}
\include{background}
\include{methods}
\include{results}

% include the bibliography
\addcontentsline{toc}{chapter}{\numberline { }Bibliography}
\bibliographystyle{plain}
\bibliography{refs}

\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{4}

% include the appendices
\appendix
\include{appendixa}

\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

Get the word Appendix in heading

Post by Stefan Kottwitz »

You use sections, and by

Code: Select all

\section{Heading}
you get
1 Heading
or in case of an appendix, which is alphabetically numbered,
A Heading
Not:
Section 1

Heading
or
Appendix A

Heading
The latter you would get by \chapter, as you probably did with the report class. Now you use the article class without chapters, so you lost the chapter style. You still could get it for example using the titlesec package, however it's perhaps not a good idea to change the section heading layout only because the appendix starts.

Stefan
LaTeX.org admin
matt1
Posts: 3
Joined: Wed Oct 26, 2011 1:48 pm

Get the word Appendix in heading

Post by matt1 »

Stefan_K wrote:
Appendix A

Heading
The latter you would get by \chapter, as you probably did with the report class. Now you use the article class without chapters, so you lost the chapter style. You still could get it for example using the titlesec package, however it's perhaps not a good idea to change the section heading layout only because the appendix starts.

Stefan
The above is what I desire but am currently achieving example 2 that you showed.

I might just fudge it and create a normal section and call it the Appendix. I wouldn't normally put an appendix on an article but for my assessment it is necessary.

Thank you for your advice.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

Get the word Appendix in heading

Post by Stefan Kottwitz »

Do you have several appendix sections? If not, you could omit the A, just writing "Appendix".

Such as:

Code: Select all

\appendix
\part*{Appendix}
\section*{Heading}
text ...
\end{document}
Stefan
LaTeX.org admin
matt1
Posts: 3
Joined: Wed Oct 26, 2011 1:48 pm

Re: Appendix issue

Post by matt1 »

At the moment I only have one, but will almost certainly need more. I really appreciate the quick response to my question as my deadline is looming and these small things can be irritating.

Cheers :)
Post Reply