I'm new to xelatex, but I've managed to change the font of the chapter, sections, and so on. Now, I want to change the global font of the float captions (figures, tables...). I've named the font "\captionfont", as you can see.

Below, you'll find a minimal working example, where I have not done any modifications. I guess the problem lies within the captionsetup. I've read a lot about setting the font, and I've now settled for this way of doing it, so if it is possible to set the caption font globally, without changing too much of the original code, it'd great.

%---- FONTS ----
         BoldFont={Minion Pro Bold},BoldFeatures={LetterSpace=3}]{Minion Pro}
\setmonofont{Minion Pro}
\newfontfamily\chapterfont{Neo Sans Std}
\newfontfamily\sectionfont{Neo Sans Std Medium}
\newfontfamily\captionfont{Neo Sans Std} 
% ---- END FONTS ----


Here goes some text with the font X.
\caption{This should be font \captionfont}
Here continues font X.

I hope someone can fix it for me :)

  • How do you set the font for the titles? – egreg Jan 26 '15 at 16:46
  • @egreg I'll add it to the question. Basically, I use \newfontfamily to name the font (here \chapterfont). Then I use \titleformat{\chapter}{\huge\chapterfont} to globally set the chapter font (and size using \huge). The same goes for sections etc. Be aware that \titleformat requires {titlesec}-package – Niels Møller Jan 26 '15 at 17:14
  • The MWE is almost useless as it is. – Ludenticus Jan 26 '15 at 19:05
  • Why? After adding \titleformat I forgot to include titlesec, so that's the only thing causing errors for me. – Niels Møller Jan 26 '15 at 21:39

This should give you the desired caption font:


A complete reduced example:


\newfontfamily\captionfont{Neo Sans} 


Here goes some text with the main font.
\caption{This is on Neo Sans font}
Here continues main font.

The output:

enter image description here

I used Neo Sans instead of Neo Sans Std, but the idea is the same.

| improve this answer | |
  • Great! Thanks a lot! This solves my problem, and gives me an idea to solve future look-a-like problems – Niels Møller Jan 26 '15 at 16:46

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.