Hi all,
I was experimenting with fonts and some of their advanced features, but still have no clear idea of how to use them: how can particular font+features be chosen for \section text? For TOC? Page numbers? Bibliography?
For example, if I've set oldstyle numbers to be used by default, but don't want them to appear on \section texts or just TOC, inevitably they need to be set somehow specially.
Any links? Or, still better, is there some way for me to know where to find that out without much of search engine use?
Text Formatting ⇒ Choose fonts for document structure?
NEW: TikZ book now 40% off at Amazon.com for a short time.

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Choose fonts for document structure?
Such font attributes are set globally and I'm not aware of a solution that would allow to switch from old style to normal numbers in the document. For the sake of consistency this is not recommendable.karlisrepsons wrote:[…] For example, if I've set oldstyle numbers to be used by default, but don't want them to appear on \section texts or just TOC, inevitably they need to be set somehow specially. […]
Best regards
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Choose fonts for document structure?
If you're using XeLateX, you can get what you want by using the following packages:
Hope this helps. Read the documentation for fontspec, titlesec and fancyhdr for more info on their usage. I don't think it's a typographical error to use two different types of numbers; oldstyle numbers look great in running text, but not so great in titles and vice versa. (I use slashed zero because I have a few zero-numbered sections. I don't want any confusion with a capital letter `O'.)
Use titletoc to redefine toc formatting.
Code: Select all
Code, edit and compile here:
\usepackage{fontspec} % for using and definining fonts\usepackage{titlesec} % to redefine title formatting\usepackage{fancyhdr} % to redefine footers and headers% font stuff\defaultfontfeatures{Ligatures=Common,Mapping=tex-text}\setmainfont[Numbers=OldStyle]{Warnock Pro}\newfontfamily\mytitlefont[Numbers={Lining,SlashedZero}]{Warnock Pro}% title stuff\titleformat{\section}{\mytitlefont\Large}{\thesection}{.5em}{}% footer stuff\fancyfoot[LF]{\mytitlefont\footnotesize\thesection}\fancyfoot[RF]{\mytitlefont\footnotesize\thepage}
Use titletoc to redefine toc formatting.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Choose fonts for document structure?
Headers and footers can also be customized with titlesec. So I would consider fancyhdr superfluous in this case. Unfortunately the font you suggested is commercial. If you have any solution with a free font I would be very interested in that.bdr wrote:[…] Read the documentation for fontspec, titlesec and fancyhdr for more info on their usage. I don't think it's a typographical error to use two different types of numbers; oldstyle numbers look great in running text, but not so great in titles and vice versa. […]
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Choose fonts for document structure?
You're right, I use fancyhdr out of habit. Any OpenType font with oldstyle and lining numbers will do. I believe -- based upon a cursory glance with Apple's Font Book -- that most TeX Gyre fonts contain both sets.
-
- Posts: 50
- Joined: Sat May 23, 2009 10:13 pm
Re: Choose fonts for document structure?
About free fonts...
After some days of searches and experiments I've found quite some. These seemed good:
Tex Gyre:
Bonum: Hmmmm... Good!
Heros: good!!
Other:
SIL:
Gentium (GenAI102.TTF, GenAR102.TTF, GenI102.TTF, GenR102.TTF) are fine, but
basic are missing some characters.
CharisSIL, DoulosSIL - fine.
Linux Libertine: good.
Lavoisier: great!!
Lido STF: meant for newspaper, I liked; however, is not really a free font.
Cardo.
There is also a free font review in [1]. You can obtain some good free fonts through [2,3,4]. And thanks for formatting suggestions, I'll see later!
If ligatures, slashed zero and oldstyle numbers along with kerning is what you need, you might be very well off with Linux Libertine!
[1] http://www.garzo.co.uk/documents/freefonts.pdf
[2] http://scripts.sil.org/cms/scripts/page ... tDownloads
[3] http://linuxlibertine.sourceforge.net
[4] http://www.gust.org.pl/projects/e-foundry/tex-gyre
After some days of searches and experiments I've found quite some. These seemed good:
Tex Gyre:
Bonum: Hmmmm... Good!
Heros: good!!
Other:
SIL:
Gentium (GenAI102.TTF, GenAR102.TTF, GenI102.TTF, GenR102.TTF) are fine, but
basic are missing some characters.
CharisSIL, DoulosSIL - fine.
Linux Libertine: good.
Lavoisier: great!!
Lido STF: meant for newspaper, I liked; however, is not really a free font.
Cardo.
There is also a free font review in [1]. You can obtain some good free fonts through [2,3,4]. And thanks for formatting suggestions, I'll see later!
If ligatures, slashed zero and oldstyle numbers along with kerning is what you need, you might be very well off with Linux Libertine!
[1] http://www.garzo.co.uk/documents/freefonts.pdf
[2] http://scripts.sil.org/cms/scripts/page ... tDownloads
[3] http://linuxlibertine.sourceforge.net
[4] http://www.gust.org.pl/projects/e-foundry/tex-gyre