# Declare Font for specific Language

I am using two very different languages mixed in a document: Hebrew and German. For the Hebrew text I want to use the EzraSIL font, for German Linux Libertine. I don't want to use something like \begin{hebrew}…\end{hebrew} because it messes things up. The Hebrew parts are already "tagged" with \RL{} so perhabs one can define, that everything between \RL{} will use the EzraSIL-font?

• Jul 31, 2017 at 10:02

\documentclass{article}

\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage{german}
\setotherlanguage{hebrew}
\newfontfamily\hebrewfont[Script=Hebrew]{Linux Libertine O}
\setmainfont{Fontin Sans} %just for contrast

\newcommand{\hb}[1]{\texthebrew{#1}}

\begin{document}
Dies ist ein Text auf deutsch.

\texthebrew{זהו טקסט עברי.}

\hb{עוד טקסט בעברית}

\end{document}


Note that Linux Libertine already has Hebrew characters, so using a single font for both languages would be much easier.

• Thanks!!! (The Linux Libertine Hebrew font is not that nice) Jul 31, 2017 at 16:46
• Leah, if it worked for you, you might consider accepting it as an answer.
– user9424
Jul 31, 2017 at 20:44
• @לאהפּאַסטעך You can change the lines to \newfontfamily\hebrewfont[Script=Hebrew]{Ezra SIL} and \setmainfont{Linux Biolinum O}. שָׁנָה טוֹבָה. Sep 19, 2017 at 5:15