<p dir="ltr">You could also try the bidi package, with this package you can switch easily within the same Line by using the packages' \RL{} / \LR{} environments.</p>
<div class="gmail_extra"><br><div class="gmail_quote">Am 06.11.2016 20:55 schrieb "Philip Taylor" <<a href="mailto:P.Taylor@rhul.ac.uk">P.Taylor@rhul.ac.uk</a>>:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<br>
<br>
<div class="m_-9104149471577114997moz-cite-prefix">Mordechai Ben-Ari wrote:<br>
</div>
<blockquote type="cite">
<pre>TeXworks "almost" works OK with Hebrew. The only problem is when I try to enter inline math or English. If I write them on separate lines, they appear OK and compile OK:
אבג
$x^2+1$
דהו
but if I try to type the math on the same line, it appears like this:
x^2+1$$
This also compiles OK but it is very difficulty to read.</pre>
</blockquote>
I (think I) solved the problem by inserting Unicode
direction-switching markers at the appropriate points :<br>
<br>
<tt>\font \hebrewfont = "David"</tt><tt>
</tt>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><tt>\hebrewfont</tt></p>
<tt>
</tt>
<p dir="rtl" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><tt>אבג$x^2+1$דהו</tt></p>
<tt>
</tt>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><tt>\end</tt><br>
</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><br>
</p>
As these are difficult to insert by hand, I inserted them as "[" and
"]" and then used regular-expression search-and-replace to perform
the necessary substitutions :<br>
<br>
\[ -> \x200E<br>
\] -> \x200F<br>
<br>
PhilipTaylor<br>
</div>
</blockquote></div></div>