1

I would like to change the default font of all headings in my document to the Type 1 fonts Trajan, whose class is described here: http://www.tug.dk/FontCatalogue/trajan/

For my document, I am using a template created by previous students. The section related to the headings is reported here:

%% Headers for the main body of the text, ie from the contents onwards.
%% These headers are used when the document is single sided.
%% If there is no chapter number then uppercase lettering is used.
%% Format is {left}{center}{right}. \defaultfont sets the font to sans.
\newpagestyle{main}[\defaultfont\bfseries]{%     %\defaultfont\bfseries
  \headrule%
  \sethead%
   {\ifthesection{\thesection{.} \space}{\ifthechapter{\thechapter{.}%
    \space}{}}\ifthesection{\sectiontitle}{\ifthechapter{\chaptertitle}{%
    \MakeUppercase{\chaptertitle}}}}%
   {}{\thepage}%
  \setfoot{}{}{}%
  }

%% If the twoside option is set, the even pages can have different styles.
%% These are defined in the sqaure brackets [left][centre][right]{}{}{}
%% The headers are now controlled by the twomain pagstyle.
\newpagestyle{twomain}[\defaultfont\bfseries]{%
  \headrule%
  \sethead%
    [\thepage]%
    [][\ifthechapter{\chaptertitle}{\MakeUppercase{\chaptertitle}}]%
    {\ifthesection{\thesection{.} \space}{\ifthechapter{\thechapter{.}%
    \space}{}}\ifthesection{\sectiontitle}{\ifthechapter{\chaptertitle}{%
    \MakeUppercase{\chaptertitle}}}}%
    {}{\thepage}%
  \setfoot[][][]{}{}{}%
  }

%% Redefine the plain page style to use the defaultfont for the
%% numbering.
\renewpagestyle{plain}[\defaultfont]{%
  \sethead{}{}{}%
  \setfoot{}{\thepage}{}%
}

Now, I tried to change \defaultfont to \trajan (as well as removing the \bfseries command which would no longer be required), but that created errors in the compilation of Latex. At the moment, I am using PDFlatex.

Could anyone help me out with this problem? Thank you in advance for the help!

  • 1
    Have you tried the \trjnfamily given at the link location? – TeXnician Feb 16 '17 at 12:02
  • Yes, I get a compilation error. I substituted \defaultfont\bfseries and \defaultfont with that. – Enrico Anderlini Feb 16 '17 at 12:05
  • Then please post a full MWE. – TeXnician Feb 16 '17 at 12:11
  • Ok, now if I remove the boldface everything is fine. Apparently, you have to use \trjnfamily rather than \trajan as I was using. Thanks for the help! – Enrico Anderlini Feb 16 '17 at 12:36
  • That's exactly what I suggested. I'll post it as answer. – TeXnician Feb 16 '17 at 12:37
2

According to the linked site you are wrong using \trajan. Rather you have to use \trjnfamily.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.