0

I have made to following book class MWE that uses this template for making the chapter heading pages look pretty.

\documentclass[12pt,a4paper,titlepage,twoside,openright]{book}

\usepackage[titletoc]{appendix}

%%%%%
% v chapter heading style from http://zoonek.free.fr/LaTeX/LaTeX_samples_chapter/0.html
%%%%
\makeatletter
 \def\thickhrulefill{\leavevmode \leaders \hrule height 1ex \hfill 
 \kern \z@}
 \def\@makechapterhead#1{%
 \reset@font
  \vspace*{10\p@}%
  {\parindent \z@ 
    \begin{flushright}
  \reset@font \scshape \bfseries \Huge \thechapter \par
\end{flushright}
\hrule
\begin{flushright}
  \reset@font \LARGE \strut #1\strut \par
\end{flushright}
\vskip 100\p@
}}
 \def\@makeschapterhead#1{%
  \reset@font
  \vspace*{10\p@}%
  {\parindent \z@ 
    \begin{flushright}
      \reset@font \scshape \bfseries \Huge \vphantom{\thechapter} \par
    \end{flushright}
    \hrule
    \begin{flushright}
      \reset@font \LARGE \strut #1\strut \par
    \end{flushright}
    \vskip 100\p@
  }}
%%%%%

\begin{document}

\tableofcontents

  \chapter{title of this chapter}

some text

\begin{appendices}

  \chapter{Title of this appendix}\label{apx:f}

  \section{an appendix section}

\end{appendices}

\end{document}

Currently this produces simple numbers for chapter headings (i.e. "1" instead of "Chapter 1"). This is what I want.

It also does a similar trick to appendices (i.e. "A" instead of "Appendix A"). I don't want this.

How can I change the script to give me appendix titles like: "Appendix A"?

enter image description here

1 Answer 1

1

You can easily do that with the apptools package, which defines booleans and conditional related with being in an appendix. B.t.w., to have bold small caps with Computer Modern, you have to load cm-super, i.e. load the T1 font encoding:

\documentclass[12pt,a4paper,titlepage,twoside,openright]{book}
\usepackage[T1]{fontenc}
\usepackage[titletoc]{appendix}
\usepackage{apptools}

%%%%%
% v chapter heading style from http://zoonek.free.fr/LaTeX/LaTeX_samples_chapter/0.html
%%%%
\makeatletter
 \def\thickhrulefill{\leavevmode \leaders \hrule height 1ex \hfill
 \kern \z@}
 \def\@makechapterhead#1{%
 \reset@font
  \vspace*{10\p@}%
  {\parindent \z@
    \begin{flushright}
  \reset@font \scshape \bfseries \Huge\IfAppendix{Appendix}{} \thechapter \par
\end{flushright}
\hrule
\begin{flushright}
  \reset@font \LARGE \strut #1\strut \par
\end{flushright}
\vskip 100\p@
}}
 \def\@makeschapterhead#1{%
  \reset@font
  \vspace*{10\p@}%
  {\parindent \z@
    \begin{flushright}
      \reset@font \scshape \bfseries \Huge\vphantom{\thechapter} \par%
    \end{flushright}
    \hrule
    \begin{flushright}
      \reset@font \LARGE \strut #1\strut \par
    \end{flushright}
    \vskip 100\p@
  }}
\makeatother
%%%%%

\begin{document}

\tableofcontents

  \chapter{title of this chapter}

some text

\begin{appendices} \appendixtrue

  \chapter{Title of this appendix}\label{apx:f}

  \section{An appendix section}

\end{appendices}

\end{document} 

enter image description here

1
  • excellent wizardry!
    – geordie
    Sep 5, 2019 at 0:54

You must log in to answer this question.

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