Skip to content

engine: \pmb is amsbsy's poor man's bold, and there is a real one here - #155

Merged
tannevaled merged 1 commit into
mainfrom
pmb-boldsymbol
Aug 31, 2026
Merged

engine: \pmb is amsbsy's poor man's bold, and there is a real one here#155
tannevaled merged 1 commit into
mainfrom
pmb-boldsymbol

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

\pmb does not switch font. It typesets its argument three times, offset by a fraction of an ex, so the ink looks heavier:

\def\pmb@#1#2{\setbox8\hbox{$\m@th#1{#2}$}%\mkern-.8mu\copy8 \kern\dimen@\mkern.4mu\raise\pmbraise@\copy8 …}
                                              % amsbsy.sty:40-57

It is the fallback the package offers when no bold math version exists. One exists here: the maths layer renders \boldsymbol, which is amsbsy's own real bold (\mathversion{bold}, amsbsy.sty:28) and which go-tex/math knows (parse.go:443).

So \pmb{x} now expands, on the maths retry path, to the thing \pmb was imitating rather than costing the formula. 348 of the 4172 formulas the arXiv corpus drops are this one command.

Measured — 200 arXiv papers, 200 beamer talks

4 documents change and 2 repaginate — one closer to tectonic (27 → 29 against 33), one further (17 → 18 against 17) — for +3373 glyphs of formulas that were simply absent. The page error against the 157 tectonic renders is 670 → 669. beamer does not move by one glyph.

Test

Added to mathaliases_test.go beside \mathds and \Tilde: $\pmb{\alpha}+\pmb{x}$ must render with neither pmb nor \pmb in the skip tally. Fails on main with map[\pmb:1].

\pmb does not switch font. It typesets its argument THREE times, offset by a
fraction of an ex, so the ink looks heavier:

	\def\pmb@#1#2{\setbox8\hbox{$\m@th#1{#2}$}…
	  \mkern-.8mu\copy8 \kern\dimen@\mkern.4mu\raise\pmbraise@\copy8 …}
	                                                    (amsbsy.sty:40-57)

It is the fallback the package offers when no bold math version exists. One exists
here: the maths layer renders \boldsymbol, which is amsbsy's own real bold
(\mathversion{bold}, amsbsy.sty:28). Aliasing \pmb to it gives the formula the thing
\pmb was imitating instead of dropping it — 348 of the 4172 formulas the arXiv
corpus drops are this one command.

Measured over 200 arXiv papers and 200 beamer talks: 4 documents change and 2
repaginate (one closer to tectonic, one further) for +3373 glyphs of formulas that
were absent. The page error against the 157 tectonic renders is 670 → 669. beamer
does not move.
@tannevaled
tannevaled merged commit 1c09bf2 into main Aug 31, 2026
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant