Skip to content

Instantly share code, notes, and snippets.

@aterga
Created December 17, 2020 10:40
Show Gist options
  • Save aterga/8edcf541427a5f65f3150a0cd9168494 to your computer and use it in GitHub Desktop.
Save aterga/8edcf541427a5f65f3150a0cd9168494 to your computer and use it in GitHub Desktop.
Convert ascii Latin chars to Unicode bold Fraktur
%%% This file defines the command \boldfrak{STRING} that maps regular Latin characters to bold Fraktur.
%%% Should work in XeLaTeX with any font that supports Frakturs; if the \mathfrak command works then this
%%% \boldfrak should work as well. I tested this only in math mode.
\newcommand{\boldfraksymb}[1]{%
\ifthenelse{\equal{#1}{a}}{๐–†}{%
\ifthenelse{\equal{#1}{b}}{๐–‡}{%
\ifthenelse{\equal{#1}{c}}{๐–ˆ}{%
\ifthenelse{\equal{#1}{d}}{๐–‰}{%
\ifthenelse{\equal{#1}{e}}{๐–Š}{%
\ifthenelse{\equal{#1}{f}}{๐–‹}{%
\ifthenelse{\equal{#1}{g}}{๐–Œ}{%
\ifthenelse{\equal{#1}{h}}{๐–}{%
\ifthenelse{\equal{#1}{i}}{๐–Ž}{%
\ifthenelse{\equal{#1}{j}}{๐–}{%
\ifthenelse{\equal{#1}{k}}{๐–}{%
\ifthenelse{\equal{#1}{l}}{๐–‘}{%
\ifthenelse{\equal{#1}{m}}{๐–’}{%
\ifthenelse{\equal{#1}{n}}{๐–“}{%
\ifthenelse{\equal{#1}{o}}{๐–”}{%
\ifthenelse{\equal{#1}{p}}{๐–•}{%
\ifthenelse{\equal{#1}{q}}{๐––}{%
\ifthenelse{\equal{#1}{r}}{๐–—}{%
\ifthenelse{\equal{#1}{s}}{๐–˜}{%
\ifthenelse{\equal{#1}{t}}{๐–™}{%
\ifthenelse{\equal{#1}{u}}{๐–š}{%
\ifthenelse{\equal{#1}{v}}{๐–›}{%
\ifthenelse{\equal{#1}{w}}{๐–œ}{%
\ifthenelse{\equal{#1}{x}}{๐–}{%
\ifthenelse{\equal{#1}{y}}{๐–ž}{%
\ifthenelse{\equal{#1}{z}}{๐–Ÿ}{%
\ifthenelse{\equal{#1}{A}}{๐•ฌ}{%
\ifthenelse{\equal{#1}{B}}{๐•ญ}{%
\ifthenelse{\equal{#1}{C}}{๐•ฎ}{%
\ifthenelse{\equal{#1}{D}}{๐•ฏ}{%
\ifthenelse{\equal{#1}{E}}{๐•ฐ}{%
\ifthenelse{\equal{#1}{F}}{๐•ฑ}{%
\ifthenelse{\equal{#1}{G}}{๐•ฒ}{%
\ifthenelse{\equal{#1}{H}}{๐•ณ}{%
\ifthenelse{\equal{#1}{I}}{๐•ด}{%
\ifthenelse{\equal{#1}{J}}{๐•ต}{%
\ifthenelse{\equal{#1}{K}}{๐•ถ}{%
\ifthenelse{\equal{#1}{L}}{๐•ท}{%
\ifthenelse{\equal{#1}{M}}{๐•ธ}{%
\ifthenelse{\equal{#1}{N}}{๐•น}{%
\ifthenelse{\equal{#1}{O}}{๐•บ}{%
\ifthenelse{\equal{#1}{P}}{๐•ป}{%
\ifthenelse{\equal{#1}{Q}}{๐•ผ}{%
\ifthenelse{\equal{#1}{R}}{๐•ฝ}{%
\ifthenelse{\equal{#1}{S}}{๐•พ}{%
\ifthenelse{\equal{#1}{T}}{๐•ฟ}{%
\ifthenelse{\equal{#1}{U}}{๐–€}{%
\ifthenelse{\equal{#1}{V}}{๐–}{%
\ifthenelse{\equal{#1}{W}}{๐–‚}{%
\ifthenelse{\equal{#1}{X}}{๐–ƒ}{%
\ifthenelse{\equal{#1}{Y}}{๐–„}{%
\ifthenelse{\equal{#1}{Z}}{๐–…}{%
<unsupported>
}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
}
\makeatletter
\newcommand{\boldfrak}[1]{%
\@tfor\next:=#1\do{\boldfraksymb{\next}}%
}
\makeatother
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment