First, the difference between \Phi
and \phi
corresponds to the upper and lower cases of the letter. It is available for almost all the greek letters (the ones that are different from the latin uppercase).
There are however more alternative forms for specific letters; these alternative forms are available for the most common glyph variants of the greek letters. The use of one or the other is then either aesthetic or a question of norms/habits in a field (\varpi
tends to be used for example for some variables in physics, and its meaning is completely different from the classical meaning of \pi
).
This solution demonstrates how an \includegraphics
approach could be made to work conveniently.
If the new symbol should conform to the vertical extent of an existing glyph, then this approach will work handily. In the MWE, I make the symbol \schtreber
conform to the height of a "b" and then a "g", respectively. It will scale with math style.
If the symbol is a relation or operator, the definition could include a \mathrel
or \mathop
.
\documentclass{article}
\usepackage{scalerel}
\begin{document}
\def\schtreber{\scalerel*{\includegraphics{schtreber}}{b}}
$ab\schtreber c \scriptscriptstyle ab\schtreber c$
$ y = x^{\schtreber}$
\def\schtreber{\scalerel*{\includegraphics{schtreber}}{g}}
$ab\schtreber c \scriptscriptstyle ab\schtreber c$
$ y = x^{\schtreber}$
\end{document}
If the vertical extent is to be arbitrary, a \rule
may be used for the target size, where \LMpt
(local-mathstyle pts) or \LMex
(local-mathstyle ex's) are used to define the dimensions of the rule. Here I place the image in a \savebox
initially, in the event that some flavors of TeX don't save a local copy from \includegraphics
.
\documentclass{article}
\usepackage{scalerel}
\newsavebox\schtreberbox
\savebox\schtreberbox{\includegraphics{schtreber}}
\def\schtreber{\scalerel{\usebox{\schtreberbox}}{\rule[-2\LMpt]{0pt}{8\LMpt}}}
\begin{document}
$ab\schtreber c \scriptscriptstyle ab\schtreber c$\par
$ y = x^{\schtreber}$
\end{document}
The advantage of the former, rather than the latter approach is that the method will also work in both text and math mode, as expected:
\documentclass{article}
\usepackage{scalerel}
\newsavebox\schtreberbox
\savebox\schtreberbox{\includegraphics{schtreber}}
\def\schtreber{\scalerel*{\usebox{\schtreberbox}}{b}}
\begin{document}
$ab\schtreber c \scriptscriptstyle ab\schtreber c$\par
$ y = x^{\schtreber}$
In text\schtreber, \LARGE text\schtreber.
\end{document}
Best Answer