TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to set a custom font I acquired for all section and subsection headers in a scratcl paper I'm writing. It's a ttf and installed correctly on my Mac.

I know about \setkomafont and \addtokomafont, and I also have found the fontspec package, but all that seems to do is set the font for the entire document via \setmainfont, or for a section via \fontspec if I understand correctly.

I just can't seem to add one and one here, so to recap: how do I set (sub)section headers to a font installed on my Mac?

share|improve this question
up vote 9 down vote accepted

To use the system fonts you need to use xe(la)tex or lualatex instead of (pdf)latex. And with fontspec you can define a new family with \newfontfamily.

% I'm a UNICODE/UTF-8 encoded file!

\newfontfamily\atfamily{American Typewriter}


% for testing


Save this file as UTF-8 file and compile it with xelatex then you’ll get this.


share|improve this answer
Thanks for answering! Also thanks for using \addtokomafont, I hate having to figure out sizes and stuff :) – Zsub Mar 26 '12 at 10:44

If you want to use pdf(la)tex you will have to generate the various support files needed: metrics .tfm, encoding files, font definition files, map files, perhaps virtual font files.

With xelatex/lualatex you can use the font directly:

\setkomafont{subsection}{\color{red}\fontspec{Times New Roman}}
share|improve this answer
Thanks for answering! – Zsub Mar 26 '12 at 10:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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