646

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?

2
  • 21
    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. Commented Aug 26, 2012 at 21:45
  • 1
    bm{x} = [X_1, \dots, X_D] worked for me! instead of \bf. Seems I didn't have to import anything on my overleaf. The issues with \bf was that it bolded EVERYTHING inside my $$ which was too much. Commented Oct 20, 2021 at 16:40

14 Answers 14

552

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).

14
  • 42
    I would vote for the bm package surely!
    – yo'
    Commented Aug 26, 2012 at 11:11
  • 37
    It looks like that \boldsymbol (from amsbsy) is obsolete and \bm (package bm) should be used (ref).
    – Atcold
    Commented Jul 26, 2016 at 19:13
  • 19
    "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
    Commented Sep 1, 2017 at 8:19
  • 11
    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
    Commented Feb 5, 2019 at 15:03
  • 6
    @CharlieParker I'm sure you got your answer by now, but for posterity's sake, add \usepackage{bm} before the start of your document and then \bm{the math you want to bold}
    – Matias
    Commented Feb 8, 2021 at 4:42
308

In my experience, there is no single best way. Therefore Table 582 on page 270 of the Comprehensive LaTeX Symbol List comes in really handy. (Visited June 4, 2023)

bold math sym

9
  • 2
    ehm bm ehm. Can you underline "experience" with facts about problems of bm?
    – yo'
    Commented Feb 21, 2013 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
    Commented Feb 21, 2013 at 17:48
  • 3
    You can always use \boldsymbol{}, but this will only work if there exists a bold version of the symbol in the current font.
    – sinner
    Commented Jan 15, 2015 at 4:44
  • 9
    @Szczypawka Most universal ... probably. But also a measure of last resort.
    – Christian
    Commented May 11, 2015 at 18:06
  • 2
    @Christian How to make bm work in titles (section, article, etc.) ? Commented Sep 27, 2019 at 7:05
75

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{XITSMath-Regular.otf}
% or a different font:
%\setmathfont{texgyrepagella-math.otf}
\begin{document}
\( AaBb∇αβγ \) \par
\( \symbf{AaBb∇αβγ} \) \par
\( \symrm{AaBb∇αβγ} \)
\end{document}

enter image description here

7
  • 1
    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? Commented May 31, 2016 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 Commented May 31, 2016 at 17:07
  • 5
    @OrestesMas There were some updates to unicode-math recently, use \symbf instead of \mathbf. Commented May 31, 2016 at 18:25
  • 1
    @relG I guess that could be caused by how you've set up up your document. If you want to know why it didn't work, I suggest posting a new question with a minimal working example. Commented Mar 26, 2020 at 6:09
  • 1
    @relG Of course that's entirely up to you. (The problem mentioned in previous comments were caused by an update to the unicode-math package I think, the answer has been updated since. I do see that the latest version of XITS on CTAN doesn't actually have a file called xits-math.otf, so I think I'll update the answer with different file names. Apart from that, the code in the answer works fine.) Commented Mar 28, 2020 at 17:43
51

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

6
  • 8
    Why is \boldsymbol preferred over \boldmath?
    – drs
    Commented May 18, 2013 at 1:18
  • 7
    @drs \boldsymbol is included in the package amsmath, which is ubiquitous, while \boldmath is not.
    – glarrain
    Commented Jan 9, 2014 at 19:24
  • 2
    I don't know why but $\boldmath{\phi}$ does not work for me, yet $\boldsymbol{\phi}$ does. Commented Apr 12, 2017 at 15:26
  • 3
    @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.
    Commented Feb 26, 2019 at 12:45
  • 1
    The comment by @glarrain appears to be wrong as \boldmath is provided by LaTeX itself (it simply does \mathversion{bold}) so is always available, but must be used outside of math mode. And amsmath's \boldsymbol is a math-mode only command which exits math mode temporarily to execute \mathversion{bold} then re-enters math mode. And limits its action to the duration of its argument.
    – user691586
    Commented Dec 18, 2023 at 13:04
37

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

27

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

2
8

Use the command \boldsymbol{YOUR_SYMBOL}

1
  • this worked for me! thank you
    – jrjrjr
    Commented Apr 23, 2020 at 15:18
7

In order to have just one command for both bold text and bold math, one can use the solution suggested on LaTeX Community. 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}
1
  • 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
    Commented Jul 7, 2019 at 21:16
6

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

2
  • Thanks for the minimal example that works, but in a complicated thesis template, I only get the 2nd type irrespective of the command used. How to identify the conflicting pkg that causes this?
    – Elod
    Commented Jul 12, 2022 at 14:11
  • You need to copy all your code to a new .tex file, then start recursively deleting all the unnecessary text (starting with the rest of the body of your thesis). When you have only one paragraph of writing, start removing the packages, while still compiling the file to check the output. There may be one package that swings it. Feel free to share code at pastebin.com , excluding intellectual property.
    – ahorn
    Commented Jul 19, 2022 at 7:04
5

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.

2
  • 1
    Very good option if you want to enable bold math globally.
    – koalo
    Commented Jan 31, 2018 at 19:20
  • 1
    Thank you. I was really looking for a global option Commented Jul 31, 2023 at 18:33
5

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

3
  • $\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
    Commented Nov 11, 2018 at 4:44
  • Just one bit of trouble: $x_{0}$ is now bold in the toc. Oh well.
    – schremmer
    Commented Nov 11, 2018 at 4:55
  • These cant’t be nested. Perhaps wrap in a \mbox?
    – Davislor
    Commented Jan 24, 2019 at 22:33
5

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

1
  • 3
    It doesn't work for lowercase Greek letters.
    – tvk
    Commented May 9, 2019 at 17:09
4

The unicode-math package supports several commands for bold symbols beyond what have been mentioned in previous answers, including \mathbf, \symbf, \symbfup, \symbfit and \boldsymbol. It requires LuaLaTeX or XeLaTeX.

If you load a math font that has a bold version, unicode-math will load it as version=bold. There are now several, including XITS Math, Libertinus Math, and KP Math. 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.

5
  • Requires LuaLaTeX or XeLateX. Commented Nov 1, 2020 at 9:49
  • @BenjaminMcKay Looking back, I saw some things I said had gotten out of date, so I revised that paragraph. It now mentions LuaTeX and XeTeX, in case someone doesn’t already know.
    – Davislor
    Commented Nov 1, 2020 at 16:30
  • Huh, I left out a \neg in my example.
    – Davislor
    Commented Nov 1, 2020 at 16:33
  • I am getting warnings which (probably) say that the bold font was not found. Can you please look in to this? I am using an updated TeX Live 2022. This is the image link to warnings and the output: imgur.com/a/bidrDN9 Commented Dec 13, 2022 at 11:17
  • 1
    For some reason, instead of defining fonts manually, if I use \usepackage[libertinus]{fontsetup}, then I get the correct output. (ignoring the mathtools warnings) Commented Dec 13, 2022 at 11:24
0

Like in some other answers, I use \mathversion{bold}, but I've never had to use \mathversion{normal} to reset the font. In particular, I use the following commands:

\newcommand{\allbf}[1]{\textbf{\mathversion{bold}#1}}

to get bold characters for both text and math.

And with the article class, to get bold math in addition to the usual bold text in any section title (at any section level):

\let\B@startsection\@startsection
\renewcommand{\@startsection}[6]{\B@startsection
{#1}{#2}{#3}{#4}{#5}{\mathversion{bold}#6}}

You must log in to answer this question.

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