I am trying to use the mathastext
package to replace alphabet letters in math with the default fonts in the document, and gfsdidot
(udidot
) for greek. I can either get everything relevant except greek working, or get greek working but break latin.
I use pdfLaTeX, and I think I have enough math alphabets, so that shouldn't be the issue. I also know that GFS Didot comes in all desired weights and shapes. How does an alphabet in mathastext
know that it is only meant for greek and why does it not contain \mathrm
? What is its relation to \mathnormal
(which currently is equally broken)?
\Mathrm
may seem like a syntax error but it is defined internally in mathastext.sty
, though I am not sure how (or if) to properly use it.
If it's any help to convey what I am looking to do: something akin to what unicode-range
does in CSS, to use one font for one range of characters, and another font for another range. For pdfLaTeX this seems to get harder because fonts are not in unicode, but it should indeed be possible, because mathastext
does so properly for the default math alphabet. How?
\documentclass{article}
\usepackage[LGR,T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{ebgaramond}
\usepackage[LGRgreek,italic]{mathastext}
\DeclareSymbolFont{mycustom}{LGR}{udidot}{normal}{n}
\SetSymbolFont {mycustom}{normal}{LGR}{udidot}{\rmdefault}{n}%
\DeclareSymbolFontAlphabet{\Mathrm}{mycustom}%%% disable this to break greek but fix latin
\MTgreekfont{udidot}
\MTitgreek
\MTitGreek
\Mathastext
\newcommand*{\GRALPH}{\alpha \beta \gamma \delta \epsilon
\zeta \eta \theta \iota \kappa \lambda \mu \nu \xi o \pi
\rho \sigma \tau \upsilon \phi \chi \psi \omega \varsigma}
\newcommand*{\gralph}{A B \Gamma \Delta E Z H \Theta I K
\Lambda M N \Xi O \Pi P \Sigma T \Upsilon \Phi X \Psi \Omega}
\begin{document}
\noindent
\( \GRALPH - \mathrm{\GRALPH} \)\\
\( \gralph - \mathrm{\gralph} \)\\
so far it looks good, but now also latin turns up as greek:\\
\( abcdefghijklmnopqrstuvwxyz - \mathrm{abcdefghijklmnopqrstuvwxyz} \)
\end{document}