\bold in math environment

Some options, but not all, I think, to use bold math in LaTeX:

\boldmath is your friend if there's a longer portion of bold math fonts needed, not just a few symbols. Don't forget to use \unboldmath later on.

\mathbf{...} is the math bold version of \textbf, i.e. the font is roman and upright letters usually.

The package bm provides the \bm command, amongst other features.

The \boldsymbol command keeps the usual italic shaped letters of the math environments.

The \bold command is from AMS-TeX and works if the package amsfonts or amssymb is loaded, but there's a warning that \bold is deprecated:

Package amsfonts Warning: Obsolete command \bold; \mathbf should be used instea
d on input line 24


\documentclass{article}


\usepackage{amsfonts}

\usepackage{bm}

\newcommand{\foo}{E=mc^{2}}


\begin{document}
Not bold: $\foo$

From now on all bold with \verb!\boldmath!: \boldmath $\foo$ 

or $E^{2} = p^{2}c^{2} + m^{2}c^{4}$\unboldmath 

-- from here the enduring effect of \verb!\boldmath! has been removed with \verb!\unboldmath!

Local bold math with font change by \verb!\mathbf!: $\mathbf{\foo}$

Local bold math with \verb!\bm! from package \texttt{bm}: $\bm{\foo}$


With \verb!\bold! command:  $\bold{\foo}$ 

\end{document}

There's also \boldsymbol from amsmath and \pmb("poor man's bold"), the latter being a last resort method for symbols which have no true bold version in the font.


Before answering your main question, I’ll deal with the additional one: at least in TeX Live, there is a command-line utility program called texdef by means of which you can easily see how, and sometimes where, a command is defined, or, more generally, what is its meaning.

The basic syntax is

texdef -t <format> <cs>

where <format> is the name of a TeX format, e.g., latex, and <cs> is any control sequence (not necessarily a command or a macro name). There are also a full bunch of command-line options, among which I’d recall:

  • -c <class>, for specifying a <class> different from the default article class;

  • -p <package>, or more generally -p [<options>]{<package>}, to load a certain <package>, possibly with <options>;

  • -s, to (try to) show an extract of the source file where a certain command is defined;

  • -h (help) is very useful too, of course!

For example—and I am coming, now, to your main question—if you try

texdef -t latex -p amssymb -s \bold

the answer you get, namely

% amsfonts.sty, line 115:
\DeclareRobustCommand{\bold}[1]{%
  {\@subst@obsolete{amsfonts}\bold\mathbf{#1}}}

tells you that \bold is defined on line 115 of the file amsfonts.sty, as syntactic sugar to support an old, and now deprecated, command, effectively converting it into \mathbf.

Tags:

Fonts

Macros

Bold