2

I want to use polyglossia to write a Hebrew document with some English. The definition of the english font families only applies to English text included within Hebrew text (the word Corona), but not to standalone English text.

\documentclass[12pt]{article}
\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}

\newfontfamily\hebrewfont{David}
\newfontfamily\englishfont{Palatino Linotype}
\newfontfamily\englishfontsf{Lucida Sans}
\newfontfamily\englishfonttt{Lucida Sans Typewriter}
\parindent=0pt
\begin{document}
\begin{LTR}
\selectlanguage{english}
\textrm{The quick brown fox jumped over the lazy dog}\\
\textsf{The quick brown fox jumped over the lazy dog}\\
\texttt{The quick brown fox jumped over the lazy dog}\\
\end{LTR}
\begin{RTL}
לצערי ההרצאה בוטלה בגלל ה-
\textenglish{Corona}.
\end{RTL}
\end{document}
Mico
  • 506,678
Moti
  • 91
  • I've taken the liberty of adding the 'fontspec' tag to your posting, as polyglossia automatically loads fontspec. – Mico Jun 04 '20 at 11:28

1 Answers1

2

I think you just need to set it in a different environment. Here are several examples. Note that I changed the English font.

\documentclass[12pt]{article}

\usepackage{polyglossia} \setdefaultlanguage{hebrew} \setotherlanguage{english} \newfontfamily\hebrewfont[Script=Hebrew]{David} \newfontfamily{\englishfont}{Linux Libertine O} \newfontfamily{\englishfontrm}{Linux Libertine O} \newfontfamily{\englishfontsf}{Linux Biolinum O} \newfontfamily{\englishfonttt}{Libertinus Mono}

\parindent=0pt

\begin{document}

\begin{english} \begin{englishfontrm} The quick brown fox jumped over the lazy dog. \end{englishfontrm}

\begin{englishfontsf}

The quick brown fox jumped over the lazy dog. \end{englishfontsf}

\begin{englishfonttt}

The quick brown fox jumped over the lazy dog. \end{englishfonttt} \end{english}

\begin{hebrew} לצערי ההרצאה בוטלה בגלל ה- \begin{english}\englishfontrm{Corona}\end{english}.

לצערי ההרצאה בוטלה בגלל ה- \begin{english}\englishfontsf{Corona}\end{english}.

לצערי ההרצאה בוטלה בגלל ה- \begin{english}\englishfonttt{Corona}\end{english}. \end{hebrew}

\end{document}

enter image description here

AML
  • 2,265
  • Thanks. I'll play around with your example. – Moti Aug 01 '20 at 08:33
  • Upvote and accept if it works for you. – AML Aug 03 '20 at 01:27
  • @AML Upvote for your answer, but you defined twice the roman font for English: once in \newfontfamily{\englishfont}{...} and then in \newfontfamily{\englishfontrm}{...}. I don't see any reason for defining two different commands, \englishfont and \englishfontrm to insert English text in roman face, altogether when you use the same font face for both. – tush Jan 10 '22 at 18:28