4

I intend to use the Trajan fonts for the headings of the chapters only (hence, not the section headings etc.) of my thesis. I am using a template provided by a previous student, and this is the section concerning the chapter headings:

%% Check for fancychap flag and change chapter default if true
\ifthenelse{\boolean{fancychapflag}}{%
  \titleformat{\chapter}[display]%
    {\huge\normalfont\defaultfont\filleft\onehalfspacing%
    \titlerule[1pt]%
    \vspace{1pt}%
    \titlerule}%
    {%
    \vspace{1ex}%
    \chaptertitlename \space \thechapter}%
    {0.5ex}%
    {\bfseries\Huge}%
    [\vspace{1ex}%
    \titlerule]%
    %% Control the spacing of the numbered chapters.
    \titlespacing*{\chapter}{0pt}{0pt}{30pt}
    \titleformat{name=\chapter,numberless}[display]%
    {\huge\normalfont\defaultfont\filcenter}%
    %% Move the title to the top of the page
    {\vspace{-6ex}}%
    {0pt}%
    {\titlerule\huge}%
    [\vspace{\parskip}%
    \titlerule]
    %% Control the spacing of the un-numbered chapters.
    \titlespacing*{name=\chapter,numberless}{0pt}{0pt}{30pt}%
    }%
  {%% Fix chapter spacing to one and a half
    \titleformat{\chapter}[display]%
    {\huge\normalfont\defaultfont\bfseries\onehalfspacing}%
    {\chaptertitlename\ \thechapter}%
    {20pt}%
    {\Huge}%
  }

where:

\newcommand{\defaultfont}{\ifthenelse{\boolean{sansflag}}{\sffamily}{}}

From a previous post, I now know that I need to use \trjnfamily instead of \deaultfont. However, I would like to modify the Trajan font (which comes only in capital letters) as follows:

  • Use a slightly smaller font for non-capital letters and having Trajan recognize them as such (i.e. when you use Trajan with a small letter, it typically never shows anything).
  • Use slightly larger letters for actual capitals.

This is as shown here, for instance: https://www.fonts.com/font/adobe/trajan/regular

My question is whether I can do this in the class file for the document, or whether I need to buy new fonts, such as Trajan Regular.

Thanks for the help!

  • Which typesetting engine do you use: pdfTeX, XeTeX, or LuaTeX? If it's XeTeX or LuaTeX, do you have the font Trajan Pro installed on your system? – Mico Mar 2 '17 at 13:41
  • Please augment your code snippet so that it's compilable without having to engage in too much guess-work regarding which packages may have to loaded. – Mico Mar 2 '17 at 13:44
  • pdfTex. I can be flexible with packages: the class file is very long at the moment. – Enrico Anderlini Mar 2 '17 at 16:02
3

It sounds to me like what you really want is to make use of the Opentype font named Trajan Pro. If that's the case, you should look into using LuaLaTeX and the fontspec package. You could use the sectsty package and its \chapterfont macro to change the font used in chapter-level headers.

enter image description here

% !TeX program = lualatex
\documentclass{report} 
\usepackage{fontspec,booktabs}
\setmainfont{TexGyre Termes}  % just for this example
\newfontfamily{\trajan}[BoldFont=Trajan Pro Bold]{Trajan Pro}

\newcommand\hw{Hello World} % handy short-cut macro

\usepackage{sectsty}
\chapterfont{\centering\trajan} % "\centering" is optional!

\renewcommand\chaptername{Episode} % just for fun...
\renewcommand\thechapter{\Roman{chapter}}
\setcounter{chapter}{3}

\begin{document} 

\chapter{A New Hope}

\centering
\begin{tabular}{@{}lcc@{}}
\toprule 
 & non-bold & \bfseries bold \\
\midrule
Regular Times Roman     & \hw & \bfseries\hw \\
Small-caps Times Roman  & \scshape \hw & \scshape\bfseries \hw \\
Trajan Pro              & \trajan \hw & \trajan\bfseries \hw \\
\bottomrule
\end{tabular}
\end{document}
  • The OP might also consider the free Cinzel font, which is similar to Trajan, and has an Open Type version. Does not necessarily solve the problem, but provides an alternative. – user103221 Mar 2 '17 at 15:41
  • If the OP wanted to employ the non-bold (aka medium-weight) version of Trajan Pro for chapter-level headers, he/she should simply add \mdseries to the argument of \chapterfont. – Mico Mar 2 '17 at 15:44
  • @RobtA - Do you maybe want to post a separate answer to mention Cinzel as a possible alternative? – Mico Mar 2 '17 at 15:45
  • Thanks for the help. Using LuaLaTex is a bit tricky considering the template I already have. However, using Trajan Pro is by far the neatest solution. So, if I have time at the end, I guess I will try to make the switch. – Enrico Anderlini Mar 2 '17 at 16:08
  • @EnricoAnderlini - LuaLaTeX has become quite stable and robust in recent years. Unless your document has a very unusual setup, it shouldn't be tricky at all to switch from pdfLaTeX to LuaLaTeX. You may want to check out the postings Frequently loaded packages: Differences between pdfLaTeX and LuaLaTeX and Using LuaTeX as a replacement for pdfTeX for more information on this subject. – Mico Mar 2 '17 at 16:53
4

I think this is completely inappropriate, but the document is yours. Please, don't ask for accents and other diacritics: the free Trajan font on TeX Live has none of them.

\documentclass{book}
\usepackage{xparse,l3regex}
\usepackage{titlesec}

\titleformat{\chapter}[display]%
  {\huge\fontsize{18}{24}\usefont{T1}{trjn}{m}{n}}
  {\maketrajan{\chaptertitlename}\ \Roman{chapter}}
  {20pt}
  {\maketrajan}

\ExplSyntaxOn
\NewDocumentCommand{\maketrajan}{m}
 {
  \anderlini_maketrajan:f { #1 }
 }
\cs_new_protected:Nn \anderlini_maketrajan:n
 {
  \tl_set:Nn \l_anderlini_title_tl { #1 }
  % change any run of lowercase letters into \trajanlower{<lc letters>}
  \regex_replace_all:nnN { ([a-z]+) } { \c{trajanlower}\cB\{\1\cE\} } \l_anderlini_title_tl
  \tl_use:N \l_anderlini_title_tl
 }
\cs_generate_variant:Nn \anderlini_maketrajan:n { f }
\NewDocumentCommand{\trajanlower}{m}
 {
  \group_begin:
  \fontsize{14}{0}\selectfont
  \tl_upper_case:n { #1 }
  \group_end:
 }
\tl_new:N \l_anderlini_title_tl
\ExplSyntaxOff

\begin{document}

\chapter{This is the title with Trajan letters}

\end{document}

enter image description here

Here's the complete character table of the font.

enter image description here

  • This does not look like Trajan at all, especially R, Q, W. Is this the same as Adobe Trajan or just another font with the same name? – Yan Zhou Mar 2 '17 at 14:41
  • @YanZhou This is the Trajan font, reproducing the glyphs on the Columna Traiana in Rome. – egreg Mar 2 '17 at 18:22
  • It may be named Trajan, but it definitely is not a faithful reproduction the letters on the Column. en.wikipedia.org/wiki/Trajan_(typeface) has a photo of the original as well as the Adobe version of the typeface. dropbox.com/s/o2qj0jf6z20e71u/20160716-eu-2054.jpg?dl=0 This is photo of Column of Marcus Aurelius I took last year, which is modeled on Trajan and viewed on 1:1 you can see the letter, which is very close to Trajan's (the later was not available for up close photographing when I visited it) – Yan Zhou Mar 2 '17 at 19:04
  • @YanZhou I see no photo in the Wikipedia page; your photo is not relevant, because the inscription you see on the basement is clearly dated 1589. See capitolivm.it/wp-content/uploads/2015/07/… instead. – egreg Mar 2 '17 at 20:40
  • The wiki page has a photo of the letterforms as copied by Eric Gill. Even taken your photo, I think it is difficult to argue that the font in Texlive can be said to be the Trajan in comparison to Twombly's version. For example, the leg of R in proportion to its upper half is distorted. Anyway, this is probably mostly subjective. – Yan Zhou Mar 2 '17 at 21:05
3

Hm, that's a tricky one since Trajan font isn't meant to have letters that aren't the same size (documentation here: http://www.tug.dk/FontCatalogue/trajan/). I could work around the issue by modifying the package itself, but since you only need your exotic style for the title, I'm going to post my simple and sketchy solution anyway. I think its look is at least bearable.

So the first problem I've ran into is the environment of \trjnfamily. The following code produces the result:

\documentclass[13,legalpaper]{report}

\usepackage[utf8]{inputenc}
\usepackage{trajan}
\usepackage[T1]{fontenc}

\begin{document}

\title{
\begin{Huge}T\end{Huge}HIS \begin{Huge}I\end{Huge}S \begin{Huge}A\end{Huge} \begin{Huge}W\end{Huge}ONDERFUL \begin{Huge}T\end{Huge}HESIS
}

{\trjnfamily \maketitle}

\end{document}

enter image description here

The nasty thing about this code is that \maketitle dictates the font of the thesis title and furthermore, when the command itself is placed in the right environment, \trjnfamily interprets it as text (hence M,).

So I found a alternate solution that is pretty sketchy but still good-looking:

\documentclass[13,legalpaper]{report}

\usepackage[utf8]{inputenc}
\usepackage{trajan}
\usepackage[T1]{fontenc}

\begin{document}

\begin{titlepage}
\vspace*{\stretch{1.0}}
\begin{center}
{\fontsize{18}{60}
{\trjnfamily \begin{Huge}T\end{Huge}HIS \begin{Huge}I\end{Huge}S \begin{Huge}A\end{Huge} \begin{Huge}W\end{Huge}ONDERFUL \begin{Huge}T\end{Huge}HESIS} \\
}
\vspace{0.5cm}
\large{Flying Spaghetti Monster} \\
\vspace{0.2cm}
\large{13.4 million years BC}
\end{center}
\vspace*{\stretch{2.0}}
\end{titlepage}

\end{document}

enter image description here

I hope this helps. The real problem would arise if you wanted to expand this style across the whole thesis. Then, my sketchy solution would be too time consuming. To my knowledge, no LaTeX command exists that is explicitly made for configuration of upper-case-only fonts.

Have a good day.

  • thanks for the help. I sort of knew it would be an interesting challenge. – Enrico Anderlini Mar 2 '17 at 16:04
  • No problem. I knew someone could make it better than me, for example egreg has a wonderful answer while mine is simplistic. I wish you many more hours of fun with LaTeX! – Gregor Perčič Mar 2 '17 at 16:41
3

Also consider the free Cinzel font, which is similar to Trajan. Cinzel also has an Open Type version. I like Cinzel, for page headings.

If you are not locked into Trajan or equivalent for style reasons, you might also have a look at the free Raleway fonts, which come in many weights, and are also available as Open Type. Different look, but also nice for page headings.

EDIT: At Mico's request (and copying his code!) here is a MWE:

% !TeX program = lualatex
\documentclass{report} 
\usepackage{fontspec,booktabs}
\setmainfont{TexGyre Termes}  % just for this example
\newfontfamily{\cinzel}{Cinzel}
\newfontfamily{\raleway}{Raleway}

\newcommand\hw{Hello World} % handy short-cut macro

\usepackage{sectsty}
\chapterfont{\centering\cinzel} % "\centering" is optional!

\renewcommand\chaptername{Episode} % just for fun...
\renewcommand\thechapter{\Roman{chapter}}
\setcounter{chapter}{3}

\begin{document} 

\chapter{A New Hope}

\centering
\begin{tabular}{@{}lcc@{}}
\toprule 
 & non-bold & \bfseries bold \\
\midrule
Regular Times Roman     & \hw & \bfseries\hw \\
Small-caps Times Roman  & \scshape \hw & \scshape\bfseries \hw \\
Cinzel              & \cinzel \hw & \cinzel\bfseries \hw \\
Raleway              & \raleway\textsc \hw & \raleway\bfseries H\textsc{ello} W\textsc{orld} \\
\bottomrule
\end{tabular}
\end{document}

Note that Raleway Bold is peculiar, in that the small caps are defined for uppercase, rather than lowercase letters. So I had to re-write Hello World to comply.

screenshot new

  • Thanks. Please also post an MWE, possibly along the lines of the example code in my answer. – Mico Mar 2 '17 at 16:03

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.