How can insert some hebrew characters into a tex
document and then resume in the document's main language?
That is -- I'm working on creating a tex
document that will ultimately be converted into a PDF. This document will contain both english, and hebrew, characters. With the help of some other questions I'm getting closer to my goal, but my lack of general understand of LaTeX syntax seems to be a major roadblock.
I have the following tex
document
\documentclass{article}
\usepackage{fontspec}
\usepackage{polyglossia}
\setdefaultlanguage{english}
\setotherlanguage{hebrew}
\setmainfont{Times New Roman}
\newfontfamily\hebrew{New Peninim MT}
\begin{document}
Hello World
\hebrew{\RL{חַ}}
Goodbye World
\end{document}
When I convert this document to a pdf using xelatex, I get
That is -- Hello World
renders in english (yay!). The hebrew ח renders (yay!). However -- the Goodbye World
renders as square blocks.
Conceptually I suspect I have, (unwittingly), told xelatex to render Goodbye World
in hebrew using New Peninim MT
. However, I'm not sure why that's the case. My naive programmer mind tells me that this
\hebrew{\RL{חַ}}
is telling xelatex that what's inside the brackets should be rendered in hebrew, in right to left mode. However, xelatex seems to stay in hebrew rendering mode when it gets to the Goodbye World
text.
So -- my immediate question: How do I get xelatex to render this single hebrew character inline and render the english text in the main font/typeface/language.
My bigger question: Based on the above -- what don't I understand about LaTeX syntax?
\hebrew
works like a switch, so the first step to understand LaTeX syntax is to believe your own eyes.\hebrewfont
rather than\hebrew
.