0

How to invoke Hebrew letters, for example Shin, as mathematical symbols, in the NewCM08-Regular.otf file of the newcomputermodern package which is not invoked? By the way, the Hebrew letters in the package is the most compatible with computer modern fonts and have the most suitable line weights. And an minimal working example is as follows which is compiled by XeLaTeX.

\documentclass{article}
\usepackage{amsmath,amsfonts,amssymb}
\usepackage{mathspec}%invoke some fonts on the computer

\begin{document}

\end{document}

M. Logic
  • 4,214

1 Answers1

1

The main letters in Hebrew are encoded in Unicode from U05D0 to U05EA. (You can see the mapping in unicode.org/charts) If you need for example the letter lamed, this is U05DC. So if you just need to enter this character as a Math symbol you can do \textrm{\char"05DC} when the textfont is NewCM10-Regular or -Book. This can be easily done if you use

\usepackage[default]{fontsetup}

in case you want NewCM as the default font.

Of course you can make a custom command such as

\newcommand\lamed{\textrm{\char"05DC}}

So a minimal working example is

\documentclass{article}
\usepackage{fontspec}
\newfontfamily\hebfont{NewCM10-Book.otf}
\newcommand\lamed{\textrm{\hebfont\char"05DC}}
\begin{document}
$\lamed$
\end{document}

I hope that helps.

Antonis
  • 266
  • Thanks for your work, Antonis. But I don't want to invoke the whole newcomputermodern package or use NewCM as the default font. – M. Logic Dec 07 '21 at 15:50
  • OK, I modified the above accordingly. You can use NewCM10-Regular.otf instead of the Book version if you prefer. – Antonis Dec 07 '21 at 15:59
  • Is there anyway not to use \textrm command? And by the way, since they are used as mathematical symbols, it's better to add \mathrel command. – M. Logic Dec 08 '21 at 01:25
  • But it is not a relation. Is it? – Antonis Dec 08 '21 at 10:04
  • As for escaping \textrm, some how you need to temporarily enable text mode. The glyphs are in the text font for proper Hebrew support. So an \hbox will also do. – Antonis Dec 08 '21 at 10:14
  • Antonis Tsolomitis is my name (first name is Antonis). I would like to see your work if you eventually used NewCM. So drop me an email (check the documentation of newcm on ctan) or anything similar. Thanks. – Antonis Nov 25 '22 at 14:07
  • I used Hebrew letters of the "newcomputermodern" package. For normal letters, I used a font improved by myself. – M. Logic Nov 25 '22 at 14:11