Put a Beth with dagesh in Math mode

I read here how to use hebrew letters in math mode; now my question - which is quite simple - is how to use hebrew letters with Dagesh. I have used the trick found there as

\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{\qof}{\mathord}{hebrewletters}{114}
\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}


This gives correct math mode hebrew letters, but now instead of \beth I need a beth with a dagesh, the one correctly spelled /b/ instead of /v/.

Thank you all.

The encoding file suggests that the dagesh forms are coded starting from around position 129 (the commented lines provide a useful guide to where the file has got to, appearing immediately before the character encoded at that position, so 128 is alefmapiq:

% 128
/alefmapiq
/betdagesh
/gimeldagesh
/daletdagesh
/hedagesh
/.notdef
/zayindagesh
/tetdagesh
% 136
/yoddagesh
/kaffinaldagesh
/kafdagesh
/lameddagesh
/memdagesh
/nundagesh
/samekhdagesh
/pefinaldagesh
% 144
/pedagesh
/qofdagesh
/reshdagesh
/shindagesh
/tavdagesh
/.notdef
/.notdef
% 152
/shin
/shinshindotdagesh
/shinsindotdagesh


So if you use your same trick, you can define commands for them:

\DeclareMathSymbol{\betdagesh}{\mathord}{hebrewletters}{129}% etc


You can discover the codes with the fonttable package, if you know the letter shapes.

\documentclass{article}
\usepackage{amsmath,amssymb}
\usepackage{fonttable}

\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{\qof}{\mathord}{hebrewletters}{114}
\DeclareMathSymbol{\shin}{\mathord}{hebrewletters}{152}

\begin{document}

\xfonttable{U}{rcjhbltx}{m}{n}

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}