1

I am using the memoir class with XeLaTeX and am using titleps to format my page headers. I need to change the font family only for the page headers because the main font I am using has no small caps. If I can use another similar font with a small caps option this would solve the problem. I have checked the memoir class and titleps docs but there doesn't seem to be a way to do this. Am I out of luck?

My (inadequate) solution is here:

\documentclass[legalpaper, twoside, 11pt]{memoir}
\usepackage{titleps}
\setmainfont{original font}

\newpagestyle{mystyle}{
% Try to change font family to a small caps font only for page header
\setmainfont{A different font}
\setheadrule{.2pt}% Header rule
\sethead[{\thepage} ]% even left
[\textsc{\footnotesize{\chaptertitle}}]% even center
[{\textsc{\footnotesize{Author \  Name}}}]% even center
[]% even right
{}% odd left
{{\textsc{\footnotesize{Title \  Of \ Book}}}}% o c
{{\thepage}}% odd right
% change font back to original font
\setmainfont{original font}
}

\begin{document}
\pagestyle{mystyle}
A bunch of text goes here
\end{document}

This is clearly inadequate but I'm not sure how to do this

1
  • I tried your MWE but I got an error report about an undefined control sequence, via xelatex, of "\setmainfont{Book Antiqua}". I have just checked that my TeXlive is upto date. I don't know if it is my problem or your MWE. In any case I don't have the Book Antiqua or Minion Pro fonts so it's not easy to help. Commented Apr 29, 2016 at 19:33

1 Answer 1

2

Use \newfontfamily and avoid changing the main font mid document. Besides, it can't work the way you are trying to do.

You should also use the memoir specific functions for page styles.

For the example I used two fonts with very distinctive features, just to emphasize how and when they're used.

\documentclass[legalpaper, twoside, 11pt]{memoir}

\usepackage{kantlipsum} % just for the example

\usepackage{fontspec}
\setmainfont{Old Standard}
\newfontfamily\headerfont{Libertinus Sans}

\makepagestyle{mystyle}
\makeevenhead{mystyle}
  {\headerfont\footnotesize\thepage}
  {\headerfont\footnotesize\scshape\leftmark}
  {\headerfont\footnotesize\scshape Author Name}
\makeoddhead{mystyle}
  {}
  {\headerfont\footnotesize\scshape Title Of Book}
  {\headerfont\footnotesize\thepage}
\makeheadrule{mystyle}{\textwidth}{.2pt}
\makepsmarks{mystyle}{%
  \renewcommand{\chaptermark}[1]{\markboth{##1}{##1}}%
}
\pagestyle{mystyle}

\begin{document}

\mainmatter
\chapter{Some chapter title}
\kant[1-20]

\end{document}

enter image description here

0

You must log in to answer this question.

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