352

Is either of these considered better/more readable/more "proper"/more conventional than the other for making text bold? If so, what is the reason?

I like my text \textbf{bold}

versus:

I like my text {\bf bold}
347

Marc van Dongen gave a great answer. I'll throw in another reason:

\it and \bf do not play well together. That is, they do not nest as one would intuitively expect:

Whereas \textit and \textbf do play well together:

This is nice. However, you may notice that it still fails to handle nested style adjustments to small caps, since the Computer Modern fonts do not contain slanted or bold small caps:

If this is a problem for you, then use the slantsc package in combination with the lmodern package. slantsc provides, among other things, \rmfamily (roman), \ttfamily (typewriter/​teletype), \sffamily (sans-serif), \bfseries (boldface), \itshape (italics), \slshape (slant/​oblique), and \scshape (small caps). With these, small caps can obtained in slanted form:

As a bonus, slantsc fixes \textsl to behave properly with \textsc, so you can continue using those if you like.

Alas, I haven't yet found a package which fixes the behavior of nested instances of \textit. In typesetting, when you nest italics, you're supposed to come back out of italics to roman. For example, the word "Titanic" below is in nested italics (which should ideally render as roman, not italics):

Tanaka, Shelly. On Board the Titanic: What It Was Like When the Great Liner Sank. New York, NY: Hyperion/​Madison Press, 1998.

As a workaround, one can usually write \textrm to temporarily return to non-italics in those cases, but of course this is only valid if you know the exact number of nested italic levels, which may not always be the case, especially inside a macro.

Update:

As others have pointed out, \textit and \textsl do automatic italic correction, whereas \it, \itshape, \sl, and \slshape do not. Thus, you can write \textit{stuff}, but you must write {\it stuff\/} or {\itshape stuff\/} to get the same effect.

  • 20
    See above: Don't use \bf or \it. – Martin Schröder Jan 20 '12 at 12:57
  • 30
    Rather than nesting \textit{...} you should use \emph{...} which correctly reverts to roman inside of italics. – John Tang Boyland Apr 28 '15 at 15:50
109

In general the command (\textbf/\textit) approach is more useful if the text is followed by more text on the same line and isn't followed by a small punctuation symbol. If the text is in a paragraph on its own or is followed by a small punctuation symbol, it doesn't matter really. In that case the declarations (\bf/\bfseries and \it/\itshape) are equivalent to the commands. As pointed out be others, the declarations \bf and \it are deprecated and should be avoided.

To see why the commands should be preferred, notice that \textit inserts an italic correction at the end, which adds a small horizontal compensation if the text ends in letters with long ascenders that would otherwise run into the next character. The declarations (\it and \itshape) don't insert an italic correction.

The fourth, fifth, and sixth row in the following shows why the commands may differ from the declarations. In the fourth row you get a proper italic correction, in the fifth and the sixth you don't and this results in the ff ligature running in to the h.

\documentclass{article}

\usepackage{booktabs}

\begin{document}
  \Huge
  \begin{tabular}{lll}
    \toprule
    \verb|\textbf{fluff} hair|    & \textbf{fluff} hair
  \\\verb|{\bf fluff} hair|       & {\bf fluff} hair
  \\\verb|{\bfseries fluff} hair| & {\bfseries fluff} hair
  \\\midrule
    \verb|\textit{fluff} hair|    & \textit{fluff} hair
  \\\verb|{\itshape fluff} hair|  & {\itshape fluff} hair
  \\\verb|{\it fluff} hair|       & {\it fluff} hair
  \\\bottomrule
  \end{tabular}
\end{document}

<code>\textbf</code>, <code>\textit</code> vs <code>\bfseries</code>, <code>\itshape</code> and <code>\bf</code>, <code>\it</code>

  • 8
    \documentclass{memoir}\begin{document}\bf bold results in an error. Classes are not required to support the two letter commands, so I think it's better to avoid them altogether. – egreg Jan 20 '12 at 9:57
  • 5
    See above: DONT USE \bf - they come from LaTeX 2.09, which is OBSOLETE. – Martin Schröder Jan 20 '12 at 12:56
50

First of all you should not use the obsolete \bf or \it macros from LaTeX2.0. They do not use the new font selection scheme (NFSS) of LaTeX2e. So \bf will do bold and bold only, but will not mix with an italic setting, which makes bold-italic impossible. Use the new \bfseries macro instead.

There is not much practical difference between \textbf{<content>} and {\bfseries <content>}. I would say most people use (for short texts) the first usage because it follows the common \somemacro{<content>} LaTeX style. The latter should be used if you want to make the rest of an environment/group bold, of course.

You should note that \textbf uses \bfseries internal, so the latter is a more fundamental macro. The definition of \textbf is:

\ifmmode
  \nfss@text {\bfseries #1}%
\else
  \hmode@bgroup
  \text@command {#1}%
  \bfseries \check@icl #1\check@icr
  \expandafter
  \egroup
\fi

So \textbf switches to text mode inside math mode, while \bfseries apparently doesn't. It also adds checks for italic correction before and after the content, which is a great feature of LaTeX2e.

One benefit of \bfseries is that it doesn't read the content as an argument, which would interfere with catcode changes required by verbatim content and other special code.

In summary I recommend \textbf for smaller texts, mainly because of the italic correction, and in math mode. \bfseries is IMHO more intended for environments and larger texts. One notable exception is if you have bold and italic (etc.) combinations, then you could write \textit{\bfseries <content>}, to avoid two sets of braces, but this is more a fashion choice. You should not use \bf in modern LaTeX documents.

protected by user156344 Apr 26 at 4:50

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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