Bold symbols in math mode, reliably

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.

• Welcome to TeX.SX! I get the same symbol each time. Can you please make a minimal example starting from \documentclass up to \end{document}? By the way, $$should never be used in LaTeX and \pmb is a last resort. – egreg Jan 24 at 17:20 • If you use pdflatex only, then pdf specials are an option. For example, see tex.stackexchange.com/questions/458207/… – Steven B. Segletes Jan 24 at 17:21 • @StevenB.Segletes I don't use pdflatex, I use the latex command in conjunction with some other command line tools, all bundled in a makefile. @egreg I checked editing the document I'm working on, I'll try to post a minimal working example as soon as I can. I know \pmb should be a last resort, and I used it only when nothing else worked. I didn't know anything about not using$$, on the other hand: thanks for the info! – LorenzoPerticone Jan 24 at 17:29
• I have no problem with your document and example. Up-to-date TeXLive 2018 – user2478 Jan 24 at 19:26
• @Herbert typing latex --version in my command line yields this as the version: pdfTeX 3.14159265-2.6-1.40.19 (TeX Live 2018/Arch Linux). Also, before posting this, I tried to update my system: there was an update, but nothing changed. – LorenzoPerticone Jan 24 at 21:39

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
% \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}

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.

• When using PDFTeX, I tried using the bm package without success. Anyhow, as I have no real reason to use the "legacy toolchain", I decided to switch to a more modern toolchain, as you implicitly suggested (XeLaTeX with TeXstudio) and the problem disappeared. – LorenzoPerticone Jan 25 at 11:21

I can't reproduce the issue. On the other hand, \pmb should be the last resort.

I propose either \bm{\top} or \mathsf{T} (after all, it is a T).

Anyhow, you should definitely define a command for the object, so you can change the appearance of the symbol globally by acting on a single place.

When you have decided what shape you prefer, fill in the blank in the preamble.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[italian]{babel}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{bm}
\usepackage{mathrsfs}

\newcommand{\term}{} % use the best

\begin{document}

\section{\texttt{\string\pmb}}

\renewcommand{\term}{\pmb{\top}}

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

\section{\texttt{\string\bm}}

\renewcommand{\term}{\bm{\top}}

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

\section{\texttt{\string\mathsf}}

\renewcommand{\term}{\mathsf{T}}

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

\end{document}

• As I mentioned in another comment, odds are you couldn't reproduce the issue because something was broken in my fonts. After reinstalling the toolchain and switching to XeLaTeX fixed the issue. Also, I didn't define a command for the term because I couldn't make it work. As soon as it worked again, of course I defined \boldtop as \bm{\top}. – LorenzoPerticone Jan 25 at 11:18

You haven't said what did not work, or what error you got. Bold \top is available without any packages using \boldmath or if you want bold and non bold in the same formula the bm package may be used.

\documentclass{article}

\usepackage{bm}

\begin{document}

$\top$ {\boldmath $\top$}

% this one requires bm package
$\top\bm{\top}$

\end{document}
• I'm sorry for not being clear: no errors appeared in the compilation process, and sometimes \pmb{\top} didn't show as bold. I'm starting to think that something was broken in my fonts, because switching to XeLaTeX solved the issue: at that point, \bm worked again. – LorenzoPerticone Jan 25 at 11:15