5

I'd like to use in LuaLaTeX. Unfortunately it seems none of the most commonly used fonts and china2e from 1997 - the only package I found which supposedly supports this symbol - isn't even available in the latest TeXlive distro.

\documentclass{scrartcl}
\usepackage{microtype}

\begin{document}
   L B bar = U+2114 = ℔
\end{document}

When using TeX Gyre Bonum as main font via fontspec, I get the following error:

Gives: Missing character: There is no ℔ (U+2114) in font TeXGyreBonum:mode=node;language=dflt;+tlig;!

Now I am left with two options (I think, please correct me if there are more):

  1. find a way to make use of a 23 year old package (china2e)
  2. find a font which supports this exact symbol

How can I achieve either (I am leaning toward the second option, however)?

18

Using the new tool in texlive albatross on the command with

albatross 0x2114

gives me quite a number of fonts on my system which has it. Including for example dejavu which is also in texlive:

\documentclass{scrartcl}
\usepackage{microtype}
\usepackage{fontspec}
\setmainfont{dejavusans}
\begin{document}
   L B bar = U+2114 = ℔
\end{document}

enter image description here

1
  • 7
    @0xC0000022L It was added about 10 days ago, so you need a quite up-to-date system Dec 19 '20 at 0:07
12

You can take the symbol from any font that contains it. A good method of doing this that does not change the main font is to set the character active with \newunicodechar.

\documentclass{article}
\tracinglostchars=2
\usepackage{fontspec}
\usepackage{newcomputermodern}
\usepackage{newunicodechar}

\newfontfamily\symbolfont{Junicode}[Scale=MatchUppercase]

\newcommand\lbbar{{\symbolfont\symbol{"2114}}}
\newunicodechar{^^^^2114}{\lbbar} % ℔

\begin{document}
lb ℔
\end{document}

Junicode sample

Free fonts that contain this glyph include: Cardo, Code2000, DejaVu Sans, Everson Mono, FreeSerif, FreeSans, Junicode, Linux Libertine, Noto Sans, Noto Serif and Symbola. The Noto fonts are especially useful, since they come in many widths and weights, so it’s likely that at least one of them will match your other fonts.

0
7

You can use fontspec's fallback mechanism in LuaTeX to merge multiple fonts together. When a character is missing, it will automatically search this character in Noto Sans, where this character is present. You can set up more fallback fonts as well. In this way, you do not have to change the main font of your document.

\documentclass{scrartcl}
\usepackage{fontspec}
\usepackage{microtype}

\directlua{luaotfload.add_fallback("genericfallback",
    {
      "NotoSans:mode=node;"
    })
}

\setmainfont{TeX Gyre Bonum}[RawFeature={fallback=genericfallback}]

\begin{document}
    the brown fox jumped over the lazy dog ℔
\end{document}
1
  • 2
    fallback is not from fontspec, but from luaotfload. Dec 19 '20 at 0:11

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.