541

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}
4
  • 100
    It is very simple: DO NOT USE \bf IN MODERN LaTeX DOCUMENTS! It is deprecated. Use \bfseries instead, which will work properly under the New Font Selection Scheme (NFSS) of LaTeX2e. About \textbf vs. \bfseries: There is no real difference, except that the latter will not read the text as argument and therefore work with verbatim content, but there you hardly use bold font anyway. See Does it matter if I use \textit or \it and Will two-letter font style commands (\bf , \it , …) ever be resurrected in LaTeX?. Commented Jan 20, 2012 at 11:36
  • 3
    tl;dr: use \textbf/\textit/\emph.
    – user541686
    Commented Mar 7, 2021 at 17:22
  • 4
    As much as I respect the incredible help that experts on TeX.SE provide, I don't find commandments we must use such and such newer function helpful. The deprecated functions have been deprecated for many years, and as far as I can tell they are not going away. I do appreciate answers such as some of those here that spell out the tradeoffs between older and newer functions.
    – Mars
    Commented May 28, 2022 at 23:11
  • 2
    To continue, a fundamental drawback of newer commands like \textbf is that they clutter up the text that I am actually editing, compared to the old, short commands. I do appreciate the benefits of the new commands, and I can define abbreviations for them. But that's a necessary step for me. And everyone else can define other abbreviations, so the advantage of LaTeX as a lingua franca of technical writing (as opposed to that other ... thing--Word) is reduced.
    – Mars
    Commented May 28, 2022 at 23:14

3 Answers 3

489

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.

2
  • 24
    See above: Don't use \bf or \it. Commented Jan 20, 2012 at 12:57
  • 44
    Rather than nesting \textit{...} you should use \emph{...} which correctly reverts to roman inside of italics. Commented Apr 28, 2015 at 15:50
131

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>

2
  • 10
    \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
    Commented Jan 20, 2012 at 9:57
  • 6
    See above: DONT USE \bf - they come from LaTeX 2.09, which is OBSOLETE. Commented Jan 20, 2012 at 12:56
62

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .