4

Consider the following MWE:

\documentclass{article}
\usepackage[sc]{mathpazo}
\usepackage{bbold}

\begin{document}    
Hello world $\mathbb{012345}$    
\end{document}

This gives me

enter image description here

While removing the mathpazo package I get

enter image description here

How can I have it both ways? I would like to use the Palatino font, but at the same time use blackboard-bold numbers.

3

There are several options.

The mathalpha Package

This package contains both a pazo and a px blackboard bold alphabet, matching mathpazo.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{mathpazo}
\usepackage[bb=pazo]{mathalpha}

\begin{document}
\( ABC \mathbb{ABC} \)
\end{document}

Pazo font sample

You could also replace the mathalpha option bb=pazo with bb=px. The latter comes with a bold double-struck alphabet usable as \mathbbb. Since mathpazo is a fork of Adobe’s version of Palatino, any font package matching Palatino matches it. See the mathalpha package documentation for the complete list of alphabets.

The newpxmath Package

This is essentially an upgrade to mathpazo. It still uses legacy 8-bit fonts, instead of the more modern Unicode and OpenType, but it’s compatible with PDFLaTeX. It includes a much broader repertoire of symbols, including several double-struck alphabets.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{newpxtext, newpxmath}
\usepackage{parskip}

\begin{document}
\( ABC \mathbb{ABC} \\
   \varmathbb{ABC} \)
\end{document}

Newpx font sample

This comes with three different blackboard-bold alphabets, which are controlled by package options to newpxmath. If you like the letters on the second line, you can make those the default with \usepackage[varbb]{newpxmath}, or you can substitute math alphabets with mathalpha.

Since newpx, like mathpazo, is a clone of Palatino, you can match it with any other Palatino clone (such as tgpagella) or a font matching Palatino (such as Hermann Zapf’s other masterpieces, Optima and Euler).

The Modern Toolchain

If you are able to use unicode-math and a modern TeX engine, I personally recommend it. Asana Math is a modern, Unicode math font based on mathpazo. TeX Gyre Pagella Math is also similar.

\documentclass{article}
\usepackage{unicode-math}
\usepackage{parskip}

\defaultfontfeatures{Scale=MatchLowercase}
\setmainfont{TeX Gyre Pagella}[Scale = 1.0]
\setmathfont{Asana Math}

\begin{document}
\( ABCabc \\
   \mathbb{ABCabc}
\)
\end{document}

Asana Math sample

\documentclass{article}
\usepackage{unicode-math}
\usepackage{parskip}

\defaultfontfeatures{Scale=MatchLowercase}
\setmainfont{TeX Gyre Pagella}[Scale = 1.0]
\setmathfont{TeX Gyre Pagella Math}

\begin{document}
\( ABCabc \\
   \mathbb{ABCabc}
\)
\end{document}

TeX Gyre Pagella Math sample

If you wanted to use just the blackboard-bold alphabets of TeX Gyre Pagella Math, and other symbols from Asana Math, you can do that with

\setmathfont{Asana Math}
\setmathfont[range={bb,bbit}]{TeX Gyre Pagella Math}

Or vice versa. If you have an authentic copy of Palatino on your system, you can also use that as your text font instead of the clone, Pagella.

4
\documentclass{article}
\usepackage{bbold}
\let\altmathbb\mathbb
\usepackage[sc]{mathpazo}

\begin{document}    
Hello world $\altmathbb{012345}$    
\end{document}

enter image description here

To restore the original so that no syntax variant is required:

\documentclass{article}
\usepackage{bbold}
\let\altmathbb\mathbb
\usepackage[sc]{mathpazo}
\AtBeginDocument{\let\mathbb\altmathbb}
\begin{document}    
Hello world $\mathbb{012345}$  
\end{document}
  • so is the reason that mathpazo overwrites the definitions in bbold? Is there a reason for this? – glS Oct 10 '19 at 17:41
  • @glS I did not actually look, but presumed this to be the case. And the MWE seems to bear that out. – Steven B. Segletes Oct 10 '19 at 17:42
  • I see, thanks. I thought that if that was the case, including bbold after mathpazo would have fixed it. Anyway, is there a way to still use \mathbb instead of having to use a new syntax (altmathbb in your answer)? – glS Oct 10 '19 at 17:43
  • 1
    @glS See edit.. – Steven B. Segletes Oct 10 '19 at 17:47

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.