5
\documentclass{article}
\usepackage{fontspec}

\setmainfont[BoldItalicFont={Times New Roman}]{DejaVu Sans}

\begin{document}

    1. This is normal as expected.

    \textit{2. This is in italic as expected.}

    \textbf{3. This is in bold as expected.}

    \textit{\textbf{4. This is NOT in italic and bold as expected.}}

    \textbf{\textit{5. This is NOT in bold and italic as expected.}}

\end{document}

The output is as below:

enter image description here

What is the correct way to make \setmainfont[BoldItalicFont={Times New Roman}]{DejaVu Sans} take effect?

7

Technical answer:
You are telling fontspec that whenever a bold italic font is requested, it should use upright regular Times New Roman.
You should write BoldItalicFont={Times New Roman Bold Italic} instead.

Stylish comment:
Using both bold and italic is generally considered a bad practice (and, in my opinion, Times New Roman Bold Italic is absolutely ugly). It also matches very poorly Dejavu Sans, so please consider a different serif/sans serif font couple.

\documentclass{article}
\usepackage{fontspec}

\setmainfont[BoldItalicFont={Times New Roman Bold Italic}]{DejaVu Sans}

\begin{document}
    1. This is normal as expected.
    \textit{2. This is in italic as expected.}
    \textbf{3. This is in bold as expected.}
    \textit{\textbf{4. This is in italic and bold as expected.}}
    \textbf{\textit{5. This is in bold and italic as expected.}}
\end{document}

File preview

|improve this answer|||||

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.