Using $\mathfrak$ for digits in XeTeX

I'm working on a XeTeX document and want to typeset digits or to be more precise, 1 and 0 as truth values in Fraktur via \mathfrak. I tried several tweaks and none helped. Would anyone know a workaround? Thank you in advance for your help!\

Edit: Sorry for my impreciseness. Here some additional information: I tried to switch back to Computer New Modern in the document but it didn't work for the digits such as they would be in Fraktur. Here my command for CMR:

\newcommand{\lmr}{\fontfamily{lmr}\selectfont}


Then I tried

\usepackage[math-style=TeX, bold-style=TeX]{unicode-math}
\setmathfont[]{XITSMath-Regular.otf}


Letters in Fraktur seem to be no problem, but digits just won't work.

• Welcome to the TeX.SE. community. What are your "several tweaks"? Can you edit your question putting a minimal working example, please? Oct 23 at 21:09
• Welcome to TeX.SE. Do you already have an OpenType Fraktur font ready at hand, to work with the Fraktur-type digits 0 and 1?
– Mico
Oct 23 at 21:10
• Thank you for your replies! I just edited my question. Hope that's a bit more helpful. Regarding an OpenType font, I just tried the one's my question. Do you know one that would fit my needs better? Oct 23 at 21:29

Since you're using XeLaTeX, I will assume that you've already chosen a suitable Fraktur text font that includes numerals, not just letters. If that's not the case, I can suggest the UnifrakturMaguntia fonts.

In the following example, \true and \false are defined as macros that access the (text mode) Fraktur numerals 1 and 0.

% !TEX TS-program = xelatex
\documentclass{article}
\usepackage{amsmath,unicode-math}
\setmainfont{Latin Modern Roman}[Numbers=OldStyle]
\setmathfont{Latin Modern Math}

\newfontfamily{\fraktur}{UnifrakturMaguntia21}[Scale=MatchUppercase]
\newcommand\true{\text{\fraktur 1}}
\newcommand\false{\text{\fraktur 0}}

\begin{document}
0123456789 ABCDXYZ abcdxyz

{\fraktur
0123456789 ABCDXYZ abcdxyz}

$\true$ $\false$
\end{document}

• Thank your very much for your excellent help! You solution works like a charm for my project! Oct 23 at 21:42
• In PDFLaTeX, you could use the fonts from oldgerm or blacklettert1. Oct 23 at 22:35
• You can also \setmathfont{UnifrakturMaguntia}[range=frak, Scale=MatchUppercase] in unicode-math to make the same font your \mathfrak alphabet. Oct 23 at 22:38
• @Davislor - range=frak would be fine for uppercase and lowercase letters, but does it extend to numerals as well?
– Mico
Oct 23 at 23:11
• @Mico No, you would still need to use the other command for numerals. But it would give you matching \mathfrak{F}. However, and alternative would be \setmathfontface\unifrak{UnifrakturMaguntia}[Scale=MatchUppercase] to use $\unifrak{2}$. Oct 24 at 0:15