2

In pdflatex, I'd like to use \mathbb{1} in a way suggested in How do you get \mathbb{1} to work?; that is:

\usepackage[bb=dsserif]{mathalpha}
\def\1\mathbb{1}
\[\1\]

But, a side effect (for me) is that it also changes other fonts such as \mathbb{R}

Is there any way I can just import a single symbol \mathbb{1} from dsserif, defining it as \1 without changing other fonts?


EDIT: Based on user202729's comment, I figured out a way:

\documentclass[10pt]{article}
%\DeclareFontFamily{U}{DSSerif}{\skewchar \font =45}% openface
%\DeclareFontShape{U}{DSSerif}{m}{n}{<-> s*[1]  DSSerif}{}
%\DeclareFontSubstitution{U}{DSSerif}{m}{n}
%\DeclareMathAlphabet{\mathbbbb}{U}{DSSerif}{m}{n}
\def\1{{\usefont{U}{DSSerif}{m}{n}1}}
\begin{document}
\1
\end{document}

My follow up questions are:

  1. is the four lines commented out above really unnecessary? It seems that \1 works well without those four lines, but just want to make sure.
  2. \1 works well when I use it in a text mode, but it fails to work once I use it in a math mode (e.g., \[\1\]). Why and how to fix it?

0 Answers0