405

To make Latin-letter variables bold I can use e.g. \mathbf{a}, but while putting Greek letters or symbols such as \nabla inside \mathbf doesn't cause any errors or warnings, it also doesn't do anything else.

What is the best way to make bold math symbols, in particular Greek letters and \nabla?

  • 14
    warning: if the default computer modern fonts are used, the weight of bold lowercase greek will not appear as bold as that of bold lowercase roman, and it isn't. default bold math (\mathbf} with computer modern fonts uses the font cmbx* which is an extended font. \boldsymbol or bm use the only cm font that is usually available in bold, cmmib10, which is not an extended font. thus the bold greek letters are indeed not as "bold" as the roman. – barbara beeton Aug 26 '12 at 21:45

13 Answers 13

358

The AMS Short Math Guide recommends the \boldsymbol and \pmb commands (and suggests that you use the bm package for the former to get a more powerful version than provided by amsmath).

  • 16
    I would vote for the bm package surely! – yo' Aug 26 '12 at 11:11
  • 20
    It looks like that \boldsymbol (from amsbsy) is obsolete and \bm (package bm) should be used (ref). – Atcold Jul 26 '16 at 19:13
  • Maybe it's just me, and maybe it's just temporary, but the AMS Short Math Guide link is not working for me. – TMM Dec 6 '16 at 17:13
  • 3
    "It looks like that \boldsymbol (from amsbsy) is obsolete and \bm (package bm) should be used" — Though the poor souls that are using Mathjax e.g., in a Jupyter notebook, that implements all of AMS math and none of bm will find that they have no alternatives to \boldsymbol – gboffi Sep 1 '17 at 8:19
  • 2
    Please add a short summary of the link you provide, eg how to use \bm ? This prevents the answer from being useless when the link is dead (and it is now) – MappaM Feb 5 at 15:03
185

In my experience, there is no single best way. Therefore Table 528 on page 225 of the Comprehensive LaTeX Symbol List comes in really handy. (Visited March 8, 2019 )

bold math sym

  • 2
    ehm bm ehm. Can you underline "experience" with facts about problems of bm? – yo' Feb 21 '13 at 17:32
  • 3
    @tohecz No, unfortunately not. I don't have the particular example anymore. I just happened to stumble on this old question and I thought I'd add this list since I did encounter tricky cases where it was helpful to be able to try different approaches. bm should surely be the first package to try though. I will add examples where it doesn't work when it ever happens again. – Christian Feb 21 '13 at 17:48
  • 1
    You can always use \boldsymbol{}, but this will only work if there exists a bold version of the symbol in the current font. – sinner Jan 15 '15 at 4:44
  • In my personal experience, \pmb (the faked bold) is the most universal – Dr_Zaszuś May 11 '15 at 16:57
  • 6
    @Szczypawka Most universal ... probably. But also a measure of last resort. – Christian May 11 '15 at 18:06
53

With unicode-math you can use \symbf{<characters>} which works for both Greek and Latin letters. (In versions of unicode-math older than 0.8 the \symXXX macros didn't exist, but you could \mathbf{<characters>} directly.)

Compile with xelatex or lualatex.

\documentclass{article}
\usepackage{unicode-math}
\setmathfont{xits-math.otf}
\begin{document}
\( AaBb∇αβγ \) \par
\( \symbf{AaBb∇αβγ} \) \par
\( \symrm{AaBb∇αβγ} \)
\end{document}

enter image description here

  • Does not work for me. Bold latin symbols appear OK, but greek ones (from nabla onwards) don't show. I have XITS Math font correctly installed on my system (linux), and I compiled this MWE with both xelatexand lualatex, with no luck. What am I doing wrong? – Orestes Mas May 31 '16 at 16:44
  • 1
    Update to my previous comment: I managed to make it work doing the following. 1) Specify math font as \setmathfont{XITS Math} (I'm on a linux system and that is the name of the font my system reports) and 2) Adding \usepackage{bm} AFTER setting the math font. Without step 2), greek bold characters don't show up and latin bold appears to be typeset in Latin Modern Bold – Orestes Mas May 31 '16 at 17:07
  • 4
    @OrestesMas There were some updates to unicode-math recently, use \symbf instead of \mathbf. – Torbjørn T. May 31 '16 at 18:25
38

Another possibility is \boldmath, though I would prefer \boldsymbol of amsmath as well. \unboldmath switches back to the normal math font.

  • 6
    Why is \boldsymbol preferred over \boldmath? – drs May 18 '13 at 1:18
  • 5
    @drs \boldsymbol is included in the package amsmath, which is ubiquitous, while \boldmath is not. – glarrain Jan 9 '14 at 19:24
  • 2
    I don't know why but $\boldmath{\phi}$ does not work for me, yet $\boldsymbol{\phi}$ does. – displayname Apr 12 '17 at 15:26
  • @displayname \boldmath is a declaration, so you want to use it like this: {\boldmath $\phi$}. Also \(\phi\) is recommended. See tex.stackexchange.com/questions/510/… – L. F. Feb 26 at 12:45
29

If you use the package bm you can do $\bm{a}=\bm{\alpha}$ etc.

23

While \bm and \boldmath are some good options in LaTeX, modern packages for XeLaTex can give a lot more control over the fonts from the very beginning, without the need to use commands different from the standard \mathbf that every one expects naively to work the first time one tries to write bold italic characters.

In XeLaTeX (part of TeXLive), the package fontspec gives a lot of freedom when dealing with fonts. If you want even more flexibility for mathematical input, you can try using the package unicode-math (that is built on fontspec). Nevertheless you will find the \bm and \boldsymbol traditional commands don't work. You can nonetheless specify how you want it to deal with your bold math symbols using an option while loading the unicode-math package. \usepackage[bold-style=ISO]{unicode-math} will give the recommended italic bold math symbols for both greek and latin characters, while \usepackage[bold-style=TeX]{unicode-math} will give upright latin characters. This is explained in the unicode-math documentation .

This minimal working example:

%run this with XeLaTeX!!
\documentclass{article}
\usepackage[bold-style=ISO]{unicode-math}
%\usepackage[bold-style=TeX]{unicode-math}
\setmainfont{XITS}
\setmathfont{XITS Math}


\begin{document}

This is common math $O(\log n)+O(\lambda,\,\epsilon)$

This is bold and italic $\mathbf{O(\log n)}+\mathbf{O(\lambda,\,\epsilon)}$ where it must :)
\end{document}

gives

enter image description here

5

In order to have just one command for both bold text and bold math, one can use the solution suggested on LaTeX Community (/forum/viewtopic.php?t=10866&f=44#p42084, link not allowed). Editing this solution slightly in order to incorporate the bm package, one could use the following.

\usepackage{bm}
\newcommand*{\B}[1]{\ifmmode\bm{#1}\else\textbf{#1}\fi}
  • Wonderful answer. I would like to point out the following, in case anyone deals with the same situation: I have been using \mathbf{} throughout a project only to find out that it does not work with greek letters. I modified your solution to: \renewcommand*{\mathbf}[1]{\ifmmode\bm{#1}\else\textbf{#1}\fi} (notice the renew rather than new) and everything worked perfectly without any other changes. I am relatively novice with LaTex, so if what I am describing is worthless or trivial or anything, feel free to edit or remove. – kyriakosSt Jul 7 at 21:16
3

My solution (the one that I use) is the \mathversion{bold} and \mathversion{normal} commands.

This piece of code is not a MWE —however, it shows how to use them:

\mathversion{bold}
\section{Behavior of $f$ as a function of $\lambda$}\label{sec:1}
\mathversion{normal}

And now, imagine that \mathversion{bold}\textbf{we want to put some
text in bold, and that this text contains some inline equation such as
$\sum_{j=0}^{t-1}{{p_\mathrm{y}(\lambda=2)}^j}$.}\mathversion{normal}

Hope it helps.

  • 1
    Very good option if you want to enable bold math globally. – koalo Jan 31 '18 at 19:20
3

Another option:

\documentclass{article}
\newcommand{\boldm}[1] {\mathversion{bold}#1\mathversion{normal}}
\begin{document}

There is a normal symbol, $p_1$. Now, a bold symbol: {\boldm $p_2$}. It works!

\end{document}

Output:

Rendered example of using bold and math in LaTeX

  • $\boldsymbol{x_0}$ was not working for me in either \chapter{title} or \section{title} (but did in \subsection{title}, go figure) but your {\boldm $x_{0}$} saved my day. And no need for any additional package. Totally amazing. – schremmer Nov 11 '18 at 4:44
  • Just one bit of trouble: $x_{0}$ is now bold in the toc. Oh well. – schremmer Nov 11 '18 at 4:55
  • These cant’t be nested. Perhaps wrap in a \mbox? – Davislor Jan 24 at 22:33
3

Use the command \boldsymbol{YOUR_SYMBOL}

3

You can use physics package and write any math symbol in boldface by using command \vb{} inside mathmode, e.g. $\vb{\Psi}$ will yield Ψ.

  • It doesn't work for lowercase Greek letters. – Fang Jing May 9 at 17:09
2

Observe how ugly \pmb is in the following example, compared to \bm:

\documentclass{article}
\usepackage{amsmath, bm}
\begin{document}
$$\Psi_n \pmb{\Psi_n} \bm{\Psi_n} \boldsymbol{\Psi_n} \Psi_n$$
\end{document}

enter image description here

0

The unicode-math package supports several commands for bold symbols beyond what have been mentioned in previous answers, including \mathbf, \symbf, \symbfup, \symbfit, \boldmath and \mathversion{bold}. If you load amsmath or mathtools first, it will also redefine \boldsymbol.

If you load a math font that has a bold version, unicode-math will load it as version=bold. The ones that ship with TeX Live 2018 are Khaled Hosny’s XITS Math Bold and Libertinus Math Bold, and there is a Minion Math Bold as well. It is also possible to load any math font with \setmathfont[version=bold].

Here’s a brief MWE that uses \boldmath, \symbf and \boldsymbol. Note that \mathbf will use the bold weight of the main text font, \symbf will use the mathematical bold letters and numerals defined in the Unicode Mathematical Alphenumeric Characters block, and \boldmath, \mathversion{bold} and \boldsymbol will use the bold math font (if there is one).

\documentclass[varwidth = 10cm, preview]{standalone}
\usepackage{mathtools}
\usepackage[math-style=ISO]{unicode-math}
\usepackage{microtype}

\defaultfontfeatures{ Scale = MatchUppercase }
\setmainfont{Libertinus Serif}[Scale = 1.0, Ligatures = Common]
\setsansfont{Libertinus Sans}
\setmonofont{Libertinus Mono}
\setmathfont{Libertinus Math}

\begin{document}
\section*{\boldmath Reasoning from \(\symbf{A} \vee \symbf{B}\)}

If we have \(\symbf{A} \vee \symbf{B}\) and \(\symbf{A}\), disjunctive syllogism
(classically known as \textbf{\textit{modus ponendo tollens}}, and also known
as \textbf{disjunction elimination} or {\boldmath \(\vee E\)}) is the rule
that lets us conclude \(\boldsymbol\therefore \symbf{B}\).

\end{document}

Font sample

There are several ways to tweak this behavior. By default, \mathbf renders bold capital letters upright and bold lowercase letters italic, but [math-style=ISO] makes italic the default for everything, including regular-weight uppercase Greek. You can change only the behavior of bold uppercase letters with bold-style=ISO] or [bold-style=upright]. You can also specify \symbfup for bold upright or \symbfit for bold italic.

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.