Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

It's a small, small matter, but when something has to be made both bold and italic, is there any reason to prefer

\textbf{\textit{text}}

over

\textit{\textbf{text}}

?

share|improve this question

3 Answers 3

up vote 19 down vote accepted

There is no difference in the font choice or italic correction applied and for common variants like bold and italic, it's probable that the fonts are preloaded so it makes no difference at all, however in principle

\textit{\textbf{text}}

first loads the italic font (and will generate warnings and substitutions if this font is not available) and only then loads the bold font (after any font substitutions have happened.

\textbf{\textit{text}}

of course is the reverse, and so loads the bold non-italic font as an intermediate step.

In normal usage this is no concern, but if using special font families only available in restricted variants it is possible to switch all the attributes without loading intermediate fonts

{\fontshape{\itdefault}\fontseries{\bfdefault}\selectfont text\/}

for example selects the default italic and bold attributes then selects the font specified for that combination. But then you need to do the italic correction manually.

share|improve this answer

There is a difference. \textit and \textbf change independent font attributes, the shape and the series. If the font is changed in two steps, then the first step might cause a LaTeX Font Warning depending on the current font attributes, if the combination in this step is not available.

Example:

\documentclass{article}

\makeatletter
\DeclareRobustCommand\bfseriesitshape{%
  \not@math@alphabet\itshapebfseries\relax
  \fontseries\bfdefault
  \fontshape\itdefault
  \selectfont
}
\makeatother

\DeclareTextFontCommand{\textbfit}{\bfseriesitshape}

\begin{document}

\scshape % now the current font shape is small caps

\textit{\textbf{f}}f

\textbf{\textit{f}}f %% causes LaTeX Font Warning

{\fontseries\bfdefault\textit{f}f}

\textbfit{f}f

\end{document}

Result

Here \textbf{\textit{f}} causes:

LaTeX Font Warning: Font shape `OT1/cmr/bx/sc' undefined
(Font)              using `OT1/cmr/bx/n' instead on input line 20.

The intermediate bold small caps font does not exist. Therefore it is better in general to switch the font in one step. This can be done without the need for a manual italic correction as shown in the example above.

The example also defines the font switching macros \bfseriesitshape and \textbfit to hide the font switching internals. If the first command is not needed, the latter macro can also be defined without the first command:

\DeclareTextFontCommand{\textbfit}{%
  \fontseries\bfdefault % change series without selecting the font yet
  \itshape
}
share|improve this answer

I think there is no difference, since most modern fonts provide a unique shape for bolditalic. So if your font has this shape, there is no difference. otherwise, you have to choose between one of them.

Some programs like MsWord build the shape when it is missing, however the result is unsatisfactory. And of course this is not the way LaTeX does.

share|improve this answer

Your Answer

 
discard

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.