What are TeX codes for Hebrew letters to be used as math-mode symbols?
I can show you how to do this in clear plain TeX and in plain TeX with OPmac. First clear plain TeX:
\newfam\hebfam
\font\tmp=rcjhbltx at10pt \textfont\hebfam=\tmp
\font\tmp=rcjhbltx at7pt \scriptfont\hebfam=\tmp
\font\tmp=rcjhbltx at5pt \scriptscriptfont\hebfam=\tmp
\edef\declfam{\ifcase\hebfam
0\or1\or2\or3\or4\or5\or6\or7\or8\or9\or A\or B\or C\or D\or E\or F\fi}
\mathchardef\shin = "0\declfam 98 % 98 is hexa code of shin
\mathchardef\aleph = "0\declfam 27
\mathchardef\beth = "0\declfam 62
\mathchardef\gimel = "0\declfam 67
\mathchardef\daleth = "0\declfam 64
\mathchardef\lamed = "0\declfam 6C
\mathchardef\mim = "0\declfam 6D
\mathchardef\ayin = "0\declfam 60
\mathchardef\tsadi = "0\declfam 76
\mathchardef\qof = "0\declfam 72
Now I can use $A_\shin, \shin$ or $B^\shin$.
\bye
The solution is based on the font rcjhbltx
which is present in common TeX distributions. The encoding of this font is described in the file cjhebltx.enc
. You can look into this file in order to find another codes you need.
The main disadvantage of clear plain TeX is that the main font size is fixed to 10pt and the math typesetting is set to fixed 10pt/7pt/5pt. On the other hand, OPmac provides arbitrary size of main font (and derived math typesetting). Finally, the declaration of new math family is more simple:
\input opmac
\addto\normalmath {\loadmathfamily 15 rcjhbltx } \normalmath
\addto\boldmath {\loadmathfamily 15 rcjhbltx }
\mathchardef\shin = "0F98 % 98 is hexa code of shin
\mathchardef\aleph = "0F27
\mathchardef\beth = "0F62
\mathchardef\gimel = "0F67
\mathchardef\daleth = "0F64
\mathchardef\lamed = "0F6C
\mathchardef\mim = "0F6D
\mathchardef\ayin = "0F60
\mathchardef\tsadi = "0F76
\mathchardef\qof = "0F72
Now I can use $A_\shin, \shin$ or $B^\shin$. (10pt size)
\typosize[12.3/15]
Now I can use $A_\shin, \shin$ or $B^\shin$. (12.3pt size)
\bye
A LaTeX complement to wipet's excellent answer.
\documentclass{article}
\usepackage{amsmath,amssymb}
\DeclareFontFamily{U}{rcjhbltx}{}
\DeclareFontShape{U}{rcjhbltx}{m}{n}{<->rcjhbltx}{}
\DeclareSymbolFont{hebrewletters}{U}{rcjhbltx}{m}{n}
% remove the definitions from amssymb
\let\aleph\relax\let\beth\relax
\let\gimel\relax\let\daleth\relax
\DeclareMathSymbol{\aleph}{\mathord}{hebrewletters}{39}
\DeclareMathSymbol{\beth}{\mathord}{hebrewletters}{98}\let\bet\beth
\DeclareMathSymbol{\gimel}{\mathord}{hebrewletters}{103}
\DeclareMathSymbol{\daleth}{\mathord}{hebrewletters}{100}\let\dalet\daleth
\DeclareMathSymbol{\lamed}{\mathord}{hebrewletters}{108}
\DeclareMathSymbol{\mem}{\mathord}{hebrewletters}{109}\let\mim\mem
\DeclareMathSymbol{\ayin}{\mathord}{hebrewletters}{96}
\DeclareMathSymbol{\tsadi}{\mathord}{hebrewletters}{118}
\DeclareMathSymbol{\qof}{\mathord}{hebrewletters}{113}
\DeclareMathSymbol{\shin}{\mathord}{hebrewletters}{152}
\begin{document}
Now I can use $A_\shin$, $\shin$ or $B^\shin$.
$X\aleph\beth\gimel\daleth\lamed\mem\ayin\tsadi\qof\shin X$
$\bet\dalet\mim$
\end{document}
We declare a new font family in the generic U
encoding and then assign it a font. Then a math symbol font is defined and the codes assigned to the commands.
The glyphs from amssymb
and Computer Modern (aleph) are disabled and reassigned for uniformity.
I also add a table of the rcjhbltx
font so that codes for other glyphs can be derived.