1

I've got a problem with the quality of the number, as can be seen, it's like it's got a pixel or something like that. How can I fix it?

enter image description here

There has to be a workaround for this issue. In TeX everything is possible. mwe:

\documentclass{article}
\usepackage{bbm}
\begin{document}
\[ \mathbbm{1} \]
\end{document}

This could be a workaround but it's not the same. Here I am using the cmathhbb package:

enter image description here

4
  • 5
    The code you posted doesn't give rise to the accompanying screenshot. Please clarify.
    – Mico
    Nov 11, 2020 at 17:29
  • 2
    My crystal ball tells me that you are using the bbm package. Sadly, those fonts exist indeed only as bitmap fonts.
    – campa
    Nov 11, 2020 at 20:49
  • @campa Thank you. What a shame that it cannot be fixed :(
    – NaveganTeX
    Nov 11, 2020 at 23:17
  • @Mico I just updated it. Done!
    – NaveganTeX
    Nov 11, 2020 at 23:21

1 Answer 1

3

You’re using a package only available in METAFONT. There are many alternatives that come in outline fonts, such as unicode-math in LuaLaTeX and XeLaTeX. In PDFTeX, you can use any of the fonts in mathalpha that support \mathbb{1}, or cmathbb (which as of November 2020 is too new for mathalpha to support, but is excellent).

Here is a MWE that works with LuaLaTeX or XeLaTeX:

\documentclass{article}
\usepackage[default]{fontsetup} % Loads New Computer Modern Book.

\begin{document}
\[1 \in \mathbb{1} \]
\end{document}

New Computer Modern Math Book sample

Here is a version that uses New Computer Modern Math only for the blackboard-bold numerals:

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

\setmathfont{Latin Modern Math}
\setmathfont{NewCMMath-Book}[
   range={\Bbbzero-\Bbbnine},
  Scale=MatchUppercase]

\begin{document}
\[1 \in \Bbbone \]
\end{document}

I would recommend you use Unicode in LuaLaTeX when you can, and legacy 8-bit fonts in PDFTeX when you have to.

In the comment, you say that you want only this one symbol from another font package. Unlike unicode-math, there’s no standard way to do this with legacy fonts, but you might be able to find the correct font map in the package documentation or copy-and-paste the relevant lines from the .sty file.

Here, for example, is how you can get just that one symbol from cmathbb:

\documentclass{article}
\usepackage{amssymb}

\DeclareMathAlphabet\CMath{U}{cmath}{m}{n}
\newcommand\Bbbone{\CMath{1}}

\begin{document}
\[1 \in \Bbbone \]
\end{document}

cmathbb font sample

3
  • Could you share a mwe? I only need to define a command for number 1. Using the package you're making mention of, meaning, cmathbb
    – NaveganTeX
    Nov 11, 2020 at 23:38
  • If I use mathalpha or cmathbb it will affect all the equations. How can I define a command for printing the number 1, only ?
    – NaveganTeX
    Nov 11, 2020 at 23:40
  • @NaveganTeX Okay, added.
    – Davislor
    Nov 12, 2020 at 0:02

You must log in to answer this question.

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