# Specify different fonts for bold and italic with fontspec

The main font I use for my LuaLaTeX document lacks bold and italic variants. I'd like to specify a different font for those variants using the fontspec package.

\usepackage{fontspec}
\setmainfont{GFS Elpis}
\setmonofont{Courier}


and in order to use a different font for italics and bold, say Minion Pro, I tried putting the following line in the preamble just after the above shown lines:

\fontspec[BoldFont={Minion Pro}, ItalicFont={Minion Pro}]{GFS Elpis}


Unfortunately it doesn't seem to have any effect. Italics and bold passages in the document remain in upright font.

-
Welcome to TeX.sx! Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Upvoting is the preferred way here to say "thank you" to users who helped you. –  doncherry Oct 16 '11 at 17:53
Thank you for welcoming me to TeX.sx and for the tip. I'll keep it in mind next time. –  christosc Oct 16 '11 at 19:00

You need to be specific if you declare the bold/italic/bold italic shapes, because fontspec does not automatically expand the font name:

\documentclass{article}
\usepackage{fontspec}
\setmainfont[
BoldFont={Minion Pro Bold},
ItalicFont={Minion Pro Italic},
BoldItalicFont={Minion Pro Bold Italic}
]{Linux Libertine O}

\begin{document}
normal \emph{italic}, \textbf{bold} and \textbf{\emph{bold italic}}.
\end{document}


Works fine with Minion/Linux Libertine O.

Edit: changed to \setmainfont instead of \fontspec so that there is a correct and good example. Thanks Ulrike for pointing this out.

-
Thank you very much for the quick reply! Actually a few moments before I check if anyone had answered my question, I reached the same answer myself by trials. However I'm having another problem now with the text I had put in the header and footer of the pages (with \lhead{...} and \cfoot{...} commands of the fancyhdr package), that happens to be in Greek, and most of the letters there have now gone missing. That seems a different issue, though. Thanks very much again. –  christosc Oct 16 '11 at 18:49
@christosc you're welcome, glad I could help you. Just post another question here and we can look into it. –  topskip Oct 16 '11 at 19:01

Don't use \fontspec. It is a command to change locally to another font and its settings will be lost if you switch fonts. If you want to setup the overall document font you should use the optional argument of \setmainfont.

\documentclass{article}
\usepackage{fontspec}
\setmainfont[ItalicFont=Arial]{Linux Libertine O}
\begin{document}

abc {\itshape abc}
\end{document}

-
Thanks very much for the clarification. I think that was the culprit for which I kept having problems with some parts of my document (running headers and footers). Leaving just the \setmainfont[...]{...} as you pointed out, corrected this issue too. Thank you. –  christosc Oct 17 '11 at 10:51