7

I have genuinely been searching for about 20-30 minutes with no luck to achieving what I want. It's very simple.

I'm using article class, and I want to it so that the title of my appendix goes

Appendix A: {Insert Title}

Right now I'm using

 \documentclass[a4,12pt]{article}
 \usepackage[titletoc,toc,title]{appendix}
 \begin{document}

 <main body of text>

 \begin{appendices}
 \section{Magnetic flux tubes}
 Bunch of text
 \end{appendices}

But I keep getting as my appendix title.

A. Magnetic flux tubes.

How do I get it to say Appendix A: Magnetic flux tubes.

Also ideally I would like to alter the size of the appendix title.

EDIT: My problems is that I have this in my file preamble

\usepackage{titlesec}
\usepackage{secdot}\sectiondot{subsection}\sectiondot{subsubsection}


%\renewcommand{\thesubsection}{\normalfont\arabic{section}.\arabic{subsection}}
\titleformat{\section}{\bf}{\thesection .}{0.5em}{}
\titleformat{\subsection}{\normalfont \it}{\thesubsection .}{0.5em}{}
\titleformat{\subsubsection}{\normalfont \it}{\thesubsubsection .}{0.6em}{}

I'm using this to get the document titles to look how I want, but unfortunately these new commands feed over to the appendix section. Is there anyway to undo the titleformat just for the appendices?

2 Answers2

8

You can use \titleformat again just before the appendices to give the desired formatting:

\documentclass{article}
\usepackage{titlesec}
\usepackage[titletoc,toc,title]{appendix}

\titleformat{\section}{\bfseries}{\thesection.}{0.5em}{}
\titleformat{\subsection}{\normalfont\itshape}{\thesubsection.}{0.5em}{}
\titleformat{\subsubsection}{\normalfont\itshape}{\thesubsubsection.}{0.6em}{}

\begin{document}

\section{A regular section}

\titleformat{\section}{\large\bfseries}{\appendixname~\thesection .}{0.5em}{}
\begin{appendices}
\section{Magnetic flux tubes}
Bunch of text
\end{appendices}

\end{document}

enter image description here

To recover the original formatting for sections, but adding the word "Appendix" and the dot after the number you'll need

\titleformat{\section}{\normalfont\Large\bfseries}{\appendixname~\thesection.}{1em}{}

Two letter font commands (\it, \bf and similar) are old TeX commands which shouldn't be used anymore in modern LaTeX documents; use \itshape, \bfseries instead.

Gonzalo Medina
  • 505,128
0

I think this should do the trick. My master code looks like this:

\documentclass[10pt,twoside,a4paper]{report}
\usepackage[pdftex]{graphicx}

\begin{document}

\include{Introduction} 

\include{Theory}

\renewcommand{\chaptername}{Appendix} % To change title from chapter to Appendix
\appendix
\renewcommand{\thepage}{\thechapter.\arabic{page}}  % This to change the page numebering format for the Appendices
\setcounter{page}{1}
\include{FluxCalc}

\include{ForceFieldCalc}

\end{document}

I use \include{} to call the individual .tex files for my chapters and Appendices. I prefer this because it makes my main code look much more tidy. Here I have called 4 .tex files - introduction, theory, FluxCalc (Appendix A in this case) and ForceFieldCalc (Appendix B in this case). The output pdf has for pages as shown in the figure below.

Page-1

Page-2

Page-A.1

Page-B.1

  • this example uses the report document class. the original says that article is used. there are significant differences between the two classes, and this substitution may not be appropriate. – barbara beeton May 08 '14 at 13:11
  • Yes indeed it cannot be used. I am sorry about that. Thank you for pointing it out. – Siddarth Vasudevan May 08 '14 at 13:16