In order to use Unicode maths in pdflatex as well as in LuaTeX, in preamble of my document I have:
\usepackage{ifxetex,ifluatex}
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{textcomp} % provide euro and other symbols
\usepackage{newunicodechar}
\newunicodechar{ρ}{\rho}
\newunicodechar{∈}{\in}
\newunicodechar{μ}{\mu}
\newunicodechar{≠}{\neq}
% ... and more of these \newunicodechar
%
\else % if luatex or xetex
\usepackage{unicode-math}
\defaultfontfeatures{Scale=MatchLowercase}
\defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
\fi
This allows one to have an arxiv.org-submittable document (arxiv.org does not do LuaTeX).
However, I wonder whether there is actually a package I can use instead of manually writing out all these \newunicodechar{...}{...}
, as it looks pretty standard to me.
\in
is imho much faster. Side remark: in current latex neither textcomp nor inputenc is needed.\mathscr
and\mathcal
mean the same font in Unicode, and emojic things like red heart are just begging for troubles. (C) I sometimes want some flexibilities; for instance\def†#1†{\text{#1}}
and\def…{,\allowbreak\dotsc,\allowbreak}
. So a good interface is all I need.iftex
package you can use\iftutex
which is true in xetex and luatex rather than teh nested\ifnum
game.unicode-math
package with luatex as well) but if you do want this you can inputunicode-math
package'sunicode-math-table.tex
with a suitable definition of\UnicodeMathSymbol
which defines the definitions in the "reverse" definition.