TransWikia.com

Using uncommon Unicode symbols

TeX - LaTeX Asked on December 8, 2020

I’m trying to refer to a function named Γ⊢ε⦂τ-⇒-Γok in my paper, but looks like the Unicode characters get stripped off, and I get --ok instead.

What I’ve tried:

  • pdflatex with usepackage[T1]{fontenc} and usepackage[utf8]{inputenc},
  • xelatex with usepackage{fontspec} (this actually gives some progress, and I can see the uppercase gamma, resulting in --Γok!),
  • lualatex with either usepackage{fontspec} or usepackage{luatextra} or both — same result.

From what I’ve understand, the font that’s used just doesn’t have the corresponding glyphs, but what can I do about that, preferably in an easily reproducible way, as I plan to eventually submit my paper somewhere?

One Answer

documentclass{article}
tracinglostchars=2
usepackage{unicode-math}

pagestyle{empty} % To format the MWE on TeX.SX

defaultfontfeatures{ Scale=MatchLowercase, Ligatures=TeX }
newfontfamilysymbolfont{STIX Two Math}

newcommandfunctionname[1]{textnormal{symbolfont #1}}

begin{document}
In text mode, functionname{Γ⊢ε⦂τ-⇒-Γok} is a function.

In math mode, (functionname{Γ⊢ε⦂τ-⇒-Γok}).
end{document}

STIX Two Math sample

Using a more conventional name is not a bad idea.

Some general tips:

It’s always a good idea to add tracinglostchars=2 near the top of your document. This will at least warn you when a font you use is missing a symbol, instead of logging the error silently.

You need to select a font that contains the symbols you want. DejaVu Sans, XITS Math, STIX Two Math and Code2000 are especially comprehensive. FileFormat.info also gives you a list of common fonts that support a given Unicode symbol.

Correct answer by Davislor on December 8, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP