Let take my favorite symbol „equals by definition“, ≝.
Here's what I tried so far to get a short and a long version of this symbol (yes, I wish to have both in the same document):
\documentclass{article}
\pagestyle{empty}
\usepackage[math-style=ISO]{unicode-math}
\setmainfont[Ligatures=TeX]{TeX Gyre Termes}
\setsansfont{TeX Gyre Heros}[Scale=0.88]%%% Somewhat ok scaling.
\setmonofont{TeX Gyre Cursor}%%% No explicit turning on ligatures for the monospaced font.
\setmathfont[Ligatures=TeX]{TeX Gyre Termes Math}
\setmathfont[Ligatures=TeX,Extension=.otf,range={"2A3E},BoldFont=XITSMath-Bold]{XITSMath-Regular}%%% The fat semicolon comes from XITS.
\newcommand*{\longDefiningEquals}{\mathrel{\text{\setmathfont{latinmodern-math.otf}[Ligatures=TeX,Extension=.otf,range={"225D}]$≝$}}}%%% long equality symbol that is used to define stuff
\begin{document}
\begin{gather*}
R⨾\ ≝ \{ (,) \mid ∃ \colon (,) ∈ ∧ (,) ∈ \}\\
R⨾\ \longDefiningEquals\ \{ (,) \mid ∃ \colon (,) ∈ ∧ (,) ∈ \}\\
\end{gather*}
\end{document}
The output (here, from lualatex)
looks o.k., but the input looks cumbersome: to get a single math symbol in an alternative font, we switch to text mode, change the math font, switch to math mode again, and finally issue the symbol itself. Further, in the symbol happens to be needed as a relation, we stuff all this junk into \mathrel{…}. How can be input (in particular, the macro defining the alternative glyph for the symbol) be conceptually or textually simplified (for the purpose of getting an alternative glyph for a symbol already used)?



{\tracingmacros=1 $\longDefiningEquals$}and then check the length of the log (and try also$a\longDefiningEquals b$ $a\longDefiningEquals b$ $a\longDefiningEquals b$– Ulrike Fischer Feb 11 '23 at 22:13Ligatures=TeXis enabled by default. No need to specify it unless your TeX distribution is truly ancient. – Mico Feb 11 '23 at 22:39Ligatures=TeXis enabled by default for\setmainfontand\setmonofont, i.e., right where you are setting the option explicitly. FWIW, settingLigatures=TeXfor a\setmathfontdirective makes no sense. – Mico Feb 12 '23 at 23:57\babelfont? – Feb 13 '23 at 23:08Ligatures=TeXis enabled by default for\setmainfontand\setsansfont; the option is not enabled by default for\setmonofont. My bad. I'm afraid I have no knowledge of\setbabelfont's defaults. – Mico Feb 13 '23 at 23:10