Text FormattingChanging Appendix Title Font

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
ChrisDanger
Posts: 13
Joined: Tue Dec 07, 2010 5:25 pm

Changing Appendix Title Font

Post by ChrisDanger »

Hi,

I just need to change the font of the text "APPENDIX" on the appendix title page. I managed to change the font of the \part environment thanks to information on this site, and I need to do the same kind of thing for the appendix. See here:

Code: Select all

\documentclass{thesis}

\usepackage{appendix}

\makeatletter
\def\@part[#1]#2{
    \ifnum \c@secnumdepth >\m@ne
      \refstepcounter{part}
      \addcontentsline{toc}{part}{Part \thepart\hspace{0.25em} -- \hspace{0.25em}#1}
    \else
      \addcontentsline{toc}{part}{Part #1}
    \fi
    {\parindent \z@
     \interlinepenalty \@M
     \normalfont
     \ifnum \c@secnumdepth >\m@ne
       \huge\bfseries\hfil\partname~\thepart\hfil   
       \par\nobreak\vspace{0.5\baselineskip}
     \fi
     \Huge \bfseries \centering #2
     \markboth{}{}\par}
    \nobreak
    \vskip 3ex
    \@afterheading}
\makeatother

\begin{document}
	\part{The first part}
	\appendix
\end{document}
I hope somebody can help. The code above to change \part is a bit above my capacity to reproduce for the appendix environment, if it does need to be done this way.

Thanks for your time,
Chris
Last edited by ChrisDanger on Tue Apr 19, 2011 3:31 pm, edited 1 time in total.

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Changing Appendix Title Font

Post by localghost »

It additionally requires the modification of the corresponding macro for the starred version of the \part command. This is used by the \appendix switch.

Code: Select all

\documentclass{thesis}
\usepackage[T1]{fontenc}
\usepackage{appendix}

\makeatletter
\def\@part[#1]#2{
    \ifnum \c@secnumdepth >\m@ne
      \refstepcounter{part}
      \addcontentsline{toc}{part}{Part \thepart\hspace{0.25em} -- \hspace{0.25em}#1}
    \else
      \addcontentsline{toc}{part}{Part #1}
    \fi
    {\parindent \z@
     \interlinepenalty \@M
     \normalfont
     \ifnum \c@secnumdepth >\m@ne
       \huge\bfseries\hfil\partname~\thepart\hfil   
       \par\nobreak\vspace{0.5\baselineskip}
     \fi
     \Huge \bfseries \centering #2
     \markboth{}{}\par}
    \nobreak
    \vskip 3ex
    \@afterheading}

\def\@spart#1{%
    {\if@center
      \centering
    \else
      \raggedright
    \fi
      \reset@font\p@font
    \if@upper
      \huge\bfseries\expandafter{#1}
    \else  #1%
      \fi\par}
    \@endpart}
\makeatother

\begin{document}
   \part{The first part}
   \appendix
\end{document}

Thorsten
ChrisDanger
Posts: 13
Joined: Tue Dec 07, 2010 5:25 pm

Re: Changing Appendix Title Font

Post by ChrisDanger »

Thanks so much Thorsten.
Post Reply