1

I write LaTeX on a Ubuntu Linux system using emacs. I have a LaTeX document where I would like to have some characters from other various numeral systems (cuneiform, hieroglyphic, Chinese, and others, see numeral systems). Most of my document is English in a default LaTeX font and math typeset as usual in LaTeX. Initial research has suggested that XeLaTeX might be better than pdfLaTeX. Many of the answers I have found are for including just one family of unicode characters (just cuneiform or just hieroglyphics). They often suggested installing new fonts which I do not know how to do. Many of these answers also suggest setting the main font to be one which includes the desired unicode characters. Since I would like a diverse range of characters and I do not want to change the font for the main body of my text, how do I accomplish this?

2
  • There may exist dedicated packages for each numeral system, e. g. ctan.org/tex-archive/fonts/hieroglyph
    – Fii
    May 26, 2021 at 15:33
  • 3
    well if you want to show glyphs you need a font which has them. So the first step is to decide which fonts you want to use. If you have a current tex system you could use albatross to find out which fonts on your system supports the needed glyphs. tex.stackexchange.com/a/575584/2388 May 26, 2021 at 15:37

2 Answers 2

3

XeTeX is not the only option. You may use also LuaTeX, which provides some additional and useful features. With babel you can switch the fonts based on the Unicode ranges, as the following example shows. You need also some fonts with the required characters, and a complete solution is Noto.

\documentclass{article}

\usepackage[english]{babel}

% Declare the locales:
\babelprovide[onchar=fonts]{chinese}
\babelprovide[onchar=fonts]{hieroglyphic}
\babelprovide[onchar=fonts]{cuneiform}

% Declare the fonts:
\babelfont{rm}{FreeSerif}
\babelfont[chinese]{rm}{FandolSong}
\babelfont[hieroglyphic]{rm}{NotoSansEgyptianHieroglyphs-Regular.ttf}
\babelfont[cuneiform]{rm}{NotoSansCuneiform-Regular.ttf}

% The Chinese range is predefined by babel, but not the
% following:
\babelcharproperty{"13000}["1342F]{locale}{hieroglyphic}
\babelcharproperty{"12000}["12474]{locale}{cuneiform}

\begin{document}

Text 𓀀𓀀𓀁𓀂𓀃 text 𒐀𒐁𒐂𒐃 text δΈ€δΊŒδΈ‰ε››δΊ”.

\end{document}

enter image description here

3

With xelatex and ucharclasses one can set what fonts to use and when.

% !TeX program = xelatex
% !TeX encoding = UTF-8 Unicode
\documentclass[xetex,a4paper]{article}
\usepackage{fontspec}
\setmainfont[Ligatures=TeX]{Symbola}
\newfontfamily{\defaultfont}{Symbola}
\newfontfamily{\Egyptfont}{Noto Sans Egyptian Hieroglyphs}
\newfontfamily{\Cuneifont}{Noto Sans Cuneiform}
\newfontfamily{\cjkfont}{Noto Sans CJK TC}
\usepackage{polyglossia}
\setdefaultlanguage[variant=british]{english}
\usepackage[Latin, CJK, EgyptianHieroglyphs, NumberForms]{ucharclasses}
\setDefaultTransitions{\defaultfont}{}
\setTransitionsFor{NumberForms}{\defaultfont}{}
\setTransitionsFor{Cuneiform}{\Cuneifont}{\defaultfont}
\setTransitionsFor{EgyptianHieroglyphs}{\Egyptfont}{\defaultfont}
\setTransitionsForCJK{\cjkfont}{\defaultfont}
\usepackage{unicode-math}
\setmathfont[Ligatures=TeX]{STIX Two Math}

\begin{document}

東南θ₯ΏεŒ—ι›ΆδΈ€δΊŒδΈ‰ε››δΊ”ε…­δΈƒε…«δΉεη™Ύεƒθ¬ε„„

ō α β γ δ Ρ ϝ ΢ η θ ι 

𓀺𓁖𓂉𓁓𓃝𓀛

{\Cuneifont 𒐀𒐁𒐂𒐃}

{\fontspec{STIX Two Text}0123456789 β‚€β‚β‚‚β‚ƒβ‚„β‚…β‚†β‚‡β‚ˆβ‚‰}

\end{document}

Link to fonts:

symbola, Noto Egyptian, Noto Cunei, Han Sans

numbers

12
  • You've specified \oldstylenums for STIX Two Text, but the digits certainly don't look old style to me. I see only STIX Two Math loaded explicitly, but maybe the text part is loaded somewhere else, just not accessed properly? (All the rest looks quite nice.) May 26, 2021 at 18:50
  • Its just example on how to load other that predefined font.
    – Oni
    May 27, 2021 at 1:23
  • Thanks for fixing. May 27, 2021 at 1:29
  • Can you please link to some instructions for installing the necessary fonts? I get the following message when I run xelatex on this example:! Package fontspec Error: The font "Symbola" cannot be found. If I simply hit return it tries kpathsea: Running mktextfm Symbola many times with no success. May 28, 2021 at 15:20
  • My other question is how do I use Computer Modern as my default font so the standard text in my document looks the same as it did before? May 28, 2021 at 15:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .