3
\documentclass{book}

\usepackage{kantlipsum}
\usepackage{appendix}

\usepackage{fontspec} % compile w/XeLaTeX
\setmainfont{Perpetua}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{} % clear all header and footer fields
\renewcommand{\headrule}{} % Remove the horizontal line from the header
\fancyfoot[C]{\fontfamily{ppl}\fontsize{11}{13}\selectfont\thepage} % set the footer centred and using Perpetua 11 font

\newcommand{\appendixchapter}{% https://tex.stackexchange.com/a/681868/269662
  \cleardoublepage
  \fancyfoot[C]{\fontfamily{ppl}\fontsize{11}{13}\selectfont\thepage}
  \pagenumbering{arabic}
  \setcounter{page}{1}%
  \renewcommand{\thepage}{\thechapter\arabic{page}}%
  \chapter
}

\begin{document}
  \fontsize{13pt}{15.6pt}\selectfont
  \chapter{A chapter}
  \kant[1]
  \appendix
    \appendixchapter{An appendix}
    \kant
    \appendixchapter{Another appendix}
    \kant
\end{document}

The page numbers are set to Perpetua 11, which compiles like that. However, it only appears to do so on the first page of the (appendix) chapter. Then, the numbers get bigger again. How do I set the page numbering to Perpetua 11 throughout the whole document?

BlueIris
  • 339
  • What is this \fontsize{13pt}{15.6pt}\selectfont suppose to do? It will be overwritten as soon as \normalsize is called somewhere in the code. – daleif May 01 '23 at 08:21
  • That was the only way I was able to set the size to 13pt globally. \usepackage[fontsize=13pt]{fontsize} or something like that didn't work for me. – BlueIris May 01 '23 at 08:30
  • There is no support for 13pt in book. Or most other classes for that matter. You'll probably need a class that allows you you define your own .clo file (for example memoir supports this, not sure if extbook does, the KOMA bundle probably has an interface for it as well) – daleif May 01 '23 at 09:01
  • BTW the footer size is because the title page of a chapter does not use the fancy style, it often uses plain. Look in the fancyhdr manual, there should be information about changing the plain style as well. – daleif May 01 '23 at 09:04

1 Answers1

4

You shouldn't be using \fontsize{13.5}{15.6}\selectfont. Instead use fontsize.

With \usepackage[fontsize=13.5pt]{fontsize}, the baseline skip would be set to 16.19995pt, so it's easy to fix \baselinestretch in order to obtain 15.6pt: just divide to find that

15.6/16.19995 = 0.96296593508004654335

and indeed issuing

\linespread{0.96297}

produces \baselineskip=15.6pt. I'd also set \topskip to the font size.

This said, your code has mysterious \fontfamily{ppl} instructions that are to be removed.

Now the text height is set to 550pt, but

(550-13.5)/15.6 = 34.39102564102564102564

so you don't have an integral number of lines in your pages. You need to reduce a bit the text height:

13.5+34*15.6 = 543.9

But roundings accumulate, so it's better to use 543.91pt.

\documentclass{book}
\usepackage[fontsize=13.5pt]{fontsize}
\usepackage{fontspec} % compile w/XeLaTeX
\usepackage{appendix}

\usepackage{kantlipsum} \usepackage{fancyhdr}

\setmainfont{Perpetua}[ Path=/Applications/Microsoft Word.app/Contents/Resources/DFonts/, BoldFont=* Bold, ItalicFont=* Italic, BoldItalicFont=* Bold Italic, ]

\pagestyle{fancy} \fancyhf{} % clear all header and footer fields \renewcommand{\headrulewidth}{0pt} % Remove the horizontal line from the header

\fancyfoot[C]{% \fontsize{11}{13}\selectfont\thepage } % set the footer centred and using Perpetua 11 font % fix also the plain page style \fancypagestyle{plain}{% \fancyhf{}% \renewcommand{\headrulewidth}{0pt}% \fancyfoot[C]{\fontsize{11}{13}\selectfont\thepage}% }

\newcommand{\appendixchapter}{% https://tex.stackexchange.com/a/681868/269662 \cleardoublepage \pagenumbering{arabic}% \renewcommand{\thepage}{\thechapter\arabic{page}}% \chapter }

% final setting: fix the baseline skip \linespread{0.96297} \setlength{\topskip}{13.5pt} \setlength{\textheight}{543.91pt}

\begin{document}

\chapter{A chapter}

\kant[1]

\appendix

\appendixchapter{An appendix}

\kant

\appendixchapter{Another appendix}

\kant

\end{document}

egreg
  • 1,121,712