We continue How to get two versions of the same math Unicode symbol from different fonts with XeLaTeX or LuLaTeX?, where we found out how to get ≝ in which “=” has roughly the same width as “def” using a math font.
We sometimes use “def“ also over the equivalence symbol. Is there a way to get similar and pleasant look of ≝ (in which “def” and “=” are roughly equally wide) such that it appears in the text layer of the PDF as a single symbol and also looks similar to “def” over “⇔”? Any other font besides Latin Modern Math, perhaps?
Here is some code to play with:
\documentclass{article}
\pagestyle{empty}
\usepackage[math-style=ISO]{unicode-math}
\setmainfont{TeX Gyre Termes}
\setsansfont{TeX Gyre Heros}[Scale=0.88]
\setmonofont{TeX Gyre Cursor}
\setmathfont{TeX Gyre Termes Math}
\newfontface{\latinmodernmath}{latinmodern-math.otf}% thx to Ulrike and egreg!!!
\newcommand*{\definingEquals}{\mathrel{\text{\latinmodernmath ≝}}}% thx to Ulrike and egreg!!!
\newcommand*{\definingEquiv}{\stackrel{\text{def}}{\Leftrightarrow}}
\begin{document}
\begin{align*}
𝑇\quad&\definingEquals\quad\{(𝐽, 𝑀) : 𝐽 ∈ ℤ ∧ 𝑀 ∈ ℕ_+ ∧ 𝑀 ≤ 12\}\\
(𝐽, 𝑀) ⪯ (𝐽′,𝑀′) \quad&\definingEquiv\quad 𝐽 < 𝐽′ ∨ (𝐽 = 𝐽′ ∧ 𝑀 ≤ 𝑀′)
\end{align*}
\end{document}
As you see, these def symbols don't look well together, but at least the upper one gets into the PDF text layer.
We are reluctant to take “⇔” from a non-main math font (i.e., we don't wish to deviate from TeX Gyre Termes Math much), since then, in a non-minimal document, we'd have to take also the left and right double arrows from that other font for visually pleasant looks, and this would possibly incur changing more and more characters. The publisher's guideline mentions “Times”, and we interpret this as “Times-like”.
What we could hypothetically do is replace “def“ above “⇔” by \textsmaller[2]{def}
using the relsize
package, though I'm really not sure whether this would be visually the best option: already now “def” above “=” is hardly visible, and we are reluctant to making “def” above “⇔” also hardly visible.
A font with a better ≝ (where “def” is Times-like) would be probably preferred, if it exists.
PS. The best scaling+stacking version so far is, IMHO, https://tex.stackexchange.com/a/35409. Related: A better long ≝ (defining equals, equals to by definition) without bumps .
def
is ≝ so if you want the same look with different symbols don't use ≝ use\stackrel
or similar to stackdef
in the same way for all\text{def}
in the first argument of\stackrel
with\text{\tiny def}
?=
or\Leftrightarrow
only if it is put in the definition environment or declared to be defined as follows.