[Tex/LaTex] Bold symbols in math mode, reliably

bmboldsymbolmath-mode

I'm trying to have a bold \top symbol in math mode. I've tried everything I could find on google (\mathbf, \boldsymbol, \bm) but nothing seems to work properly. Only \pmb{\top} seems to do what I want (even if it's only slightly bold, at least it is), but it doesn't work every time. I'm really surprised by this behavior, because it doesn't seem to depend on what appears in the formula, but instead on what is surrounding the formula. Some examples:

some text, $\pmb{\top}$, more text works fine

some text, $$\pmb{\top}$$ more text also works fine

some text, $\pmb{\top}$ more text doesn't work

In other words, it works fine as long as I put the formula between double dollar symbols, or as long as I have a comma (or a full stop) right after the end of the formula. I haven't checked if it works for other punctuation, but it seems odd to me.

Why does this happen? Am I missing something?

Edit: I was wrong, it does not depend strictly on punctuation. While trying to reduce my document to a minimal working example (for some reason, working from scratch didn't produce this behavior) I saw boldness "come and go", almost every edit fixed some symbols and broke others.

Also, trying to change the surrounding text made the problem disappear: I apologize for the text in Italian, but trying to substitute the actual text with some "placeholder words" was a no-go.

\usepackage[italian]{babel}
\usepackage[latin1]{inputenc}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{latexsym}
\usepackage{mathrsfs}


\begin{document}

Ricordando la definizione della categoria terminale $\pmb{\top}$, \`e facile osservare
che possiamo dotarla di una struttura monoidale ``banale'': per vedere come, possiamo
notare che $\pmb{\top} \times \pmb{\top} \simeq \pmb{\top}$, quindi possiamo definire
il prodotto tensoriale $\otimes : \pmb{\top}\times \pmb{\top} \to \pmb{\top}$ come la
composizione di tale equivalenza di categorie con il funtore identit\`a. In questo caso,
unitori e associatori saranno i morfismi identici (``non abbiamo altra scelta''), e quindi
abbiamo dotato $\pmb{\top}$ di una struttura monoidale strict. \`E bene osservare che,
ovviamente, l'unico oggetto di $\pmb{\top}$ \`e l'elemento neutro della struttura monoidale.

\end{document}

Everything works fine except for the last two \pmb{\top}'s: there, my machine produces no boldness whatsoever.

Edit2: as I pointed out in the comments, I think the problem was with the fonts in my machine. This seems to be the case because after reinstalling all the toolchain (and abandoning my custom "latex + command line tools + makefile", in favor of the more standard "TeXstudio + XeLaTeX") the problem disappeared.

Of course, as suggested by David Carlisle and egreg, I switched back to the \bm package as soon as I could.

I wish I could accept all answers, as each one gave me a hint on what was missing/broken. Since it's not possible, I'll accept Davislor's as it pointed me to the right track (that is, switching to a modern toolchain). Thanks to everyone for your insight.

Best Answer

I would recommend \newcommand\boldtop{\boldsymbol{\top}}, but include an appropriate package to use the bold math font you want.

With the Modern Toolchain

You have a good reason for using legacy 8-bit fonts and encodings and know what you’re doing, but, for the benefit of anyone who wants to do this with the new toolchain, here’s an example that works in XeLaTeX and LuaLaTeX:

% For purposes of an appropriately-sized MWE on TeX.SX only.  Replace with
% the document class you need.
\documentclass[varwidth=10cm, preview]{standalone}
\usepackage{amsmath}
\usepackage{unicode-math}
\usepackage[italian]{babel}
\usepackage{microtype}

\defaultfontfeatures{ Scale = MatchLowercase }
\setmainfont{Libertinus Serif}[ Scale = 1.0, Ligatures = Common ]
\setsansfont{Libertinus Sans}
\setmonofont{Libertinus Mono}
\setmathfont{Libertinus Math}
% The following line is redundant for math fonts that come with a bold version
% (such as Libertinus Math, XITS Math, and Minion Math), as unicode-math will
% load them automatically.
% \setmathfont[version=bold]{Libertinus Math Bold}

\newcommand\boldtop{\boldsymbol{\top}}

\begin{document}
Ricordando la definizione della categoria terminale $\boldtop$, \`e facile osservare
che possiamo dotarla di una struttura monoidale ``banale'': per vedere come, possiamo
notare che $\boldtop \times \boldtop \simeq \boldtop$, quindi possiamo definire
il prodotto tensoriale $\otimes : \boldtop\times \boldtop \to \boldtop$ come la
composizione di tale equivalenza di categorie con il funtore identit\`a. In questo caso,
unitori e associatori saranno i morfismi identici (``non abbiamo altra scelta''), e quindi
abbiamo dotato $\boldtop$ di una struttura monoidale strict. \`E bene osservare che,
ovviamente, l'unico oggetto di $\boldtop$ \`e l'elemento neutro della struttura monoidale.
\end{document}

Font Sample

The \boldmath command David Calisle suggested will also work with this set-up. You could turn it into a command that renders inside a \mbox, but it’s simpler to include amsmath or mathtools before unicode-math, and let the latter redefine \boldsymbol for you.

If you wanted to replace all instances of \top with the bold version, you could do so with the command:

\setmathfont[Scale = MatchUppercase, range = \top]{XITS Math Bold}

Or your bold math font of choice.

With the Legacy Toolchain

In PDFTeX, best practice is to use the bm package,. (This defines \boldsymbol as a synonym of \bm, for compatibility with amsmath.) David Carlisle already posted a great MWE, so there’s no need for me to be redundant.

Related Question