Created
January 4, 2018 19:50
-
-
Save vyuh/321db24e5208c1781dc858026df2f136 to your computer and use it in GitHub Desktop.
A nice plain tex macro for tryin control sequences in math mode.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\magnification=1200 | |
\def\endmathwords{$$} | |
\def\trymathwords#1{% | |
$$ | |
\begingroup | |
\edef\@tempa{#1\space}% | |
\expandafter\endgroup | |
\expandafter\readwords\@tempa\relax | |
} | |
\def\readwords#1 #2\relax{% | |
\doword{#1}% #1 = substr, #2 = rest of string | |
\begingroup | |
\ifx\relax#2\relax % is #2 empty? | |
\def\next{\endgroup\endmathwords}% your own end-macro if required | |
\else | |
\def\next{\endgroup\readwords#2\relax}% | |
\fi | |
\next | |
} | |
\def\doword#1{\csname#1\endcsname\quad} | |
\trymathwords{ | |
alpha beta gamma | |
delta epsilon varepsilon | |
zeta eta theta | |
vartheta pi rho | |
varrho sigma varsigma | |
tau upsilon phi | |
varphi chi psi | |
omega | |
} | |
\trymathwords{ | |
aleph prime | |
hbar emptyset | |
forall exists | |
imath jmath | |
nabla neg | |
surd | |
ell wp | |
top bot | |
} | |
\trymathwords{ | |
flat natural sharp | |
Re Im partial infty | |
| angle triangle backslash | |
clubsuit diamondsuit heartsuit spadesuit | |
} | |
\bye |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment