Theses, Books, Title pagesHow do I change Lagrande Orange to use only Unicode fonts?

Classicthesis, Bachelor and Master thesis, PhD, Doctoral degree
Post Reply
AntonVargas
Posts: 9
Joined: Wed Sep 13, 2017 10:31 am

How do I change Lagrande Orange to use only Unicode fonts?

Post by AntonVargas »

I'm using the Lagrande Orange book template, and I need to use Unicode fonts for everything. I've figured out how to do this for specifically designated text:

Code: Select all

\usepackage[]{fontspec}
\newfontfamily\unifont[]{Unicode Font Here}
\begin{unifont}þøłßðđŋħ\end{unifont}
But I need to change the default body, heading and math fonts to Unicode, too.

In structure.tex, the fonts are defined with the following code:

Code: Select all

\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs
\usepackage{mathptmx} % Use the Adobe Times Roman as the default text font together with math symbols from the Sym­bol, Chancery and Com­puter Modern fonts
\usepackage{avant} % Use the Avantgarde (T1) font for headings
I can change the default encoding and font easily enough:

Code: Select all

\usepackage[]{fontspec}
\setmainfont[Mapping=tex-text]{Doulos SIL}

The problem is, I can't figure out how Avantgarde is applied to headings, which I also need to change. "Avant" doesn't appear anywhere else in either file of the template. Can anyone tell me how to do this?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

How do I change Lagrande Orange to use only Unicode fonts?

Post by Stefan Kottwitz »

Hi Anton,

welcome to the forum!

It seems you changed from the pdfLaTeX way (fontenc, specific LaTeX packages such as avant, pag font) to XeLaTeX (fontspec). That's a good choice when new fonts are needed.

How about

\setmainfont{TeX Gyre Adventor}

Adventor should be an Avantgarde clone, for trade mark reasons it cannot have the same name.

Stefan
LaTeX.org admin
AntonVargas
Posts: 9
Joined: Wed Sep 13, 2017 10:31 am

How do I change Lagrande Orange to use only Unicode fonts?

Post by AntonVargas »

Thanks so much for your answer, Stefan.

Your suggestion allows me to use TeX Gyre Adventor (or any other font, in theory) as the single font for the entire document. That's a step forward!

The problem I'm having is a bit different, though -- the default Lagrande Orange template defines two different font sets, one for the headings (Avant) and one for the body (Mathptmx, which is a mix of Adobe Times Roman, Chancery and Computer Modern, according to the in-line comment). And I want to do the same -- that is, define one font for headings and a different font everything else, but with Unicode fonts (using LuaLaTeX/XeLaTeX).

Unfortunately, I'm a LaTeX noob, and though I've read through the template and structure.txt, I cannot find how the header font is defined. In the original template, it's done with...

Code: Select all

\usepackage{avant}
And nothing else, as far as I can tell. How does the (La)TeX engine know to use Avant just for headings? And how do I do the same?
AntonVargas
Posts: 9
Joined: Wed Sep 13, 2017 10:31 am

How do I change Lagrande Orange to use only Unicode fonts?

Post by AntonVargas »

After much searching and even more trial and error, I've found what appears to be the solution. The template doesn't assign fonts to different elements, but rather font classes (or "families"; not sure about the proper term). So body text is set to serif, headers to sans, etc., with commands like this:

Code: Select all

\sffamily
So using XeTeX/LuaTeX and fontspec to select fonts, you use code like the following to define what specific fonts are mapped to serif, sans serif and monospace:

Code: Select all

\usepackage[]{fontspec}
\setmainfont[]{Doulos SIL}   % Main font, typically serif.
\setsansfont[]{TeX Gyre Adventor} % Heading and title font, typically sans.
\setmonofont[]{Liberation Mono} % Monospace font, typically for code.
Post Reply