<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<br>
<br>
<div class="moz-cite-prefix">Philip Taylor wrote:<br>
</div>
<blockquote type="cite"
cite="mid:0c01abed-b3fa-5355-8a13-50d3f0daa059@Rhul.Ac.Uk">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
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; -qt-block-indent:0; 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; -qt-block-indent:0;
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; -qt-block-indent:0; text-indent:0px;"><tt>\end</tt>
</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</blockquote>
A subsidiary question : does not your multi-line solution lead to
unwanted spaces ? I found that to replicate the appearance of the
typeset output of my inline version, I had to hide two end-of-line
markers in your multi-line original, as in :<br>
<br>
<blockquote type="cite">
<meta name="qrichtext" content="1">
<meta name="qrichtext" content="1">
<meta name="qrichtext" content="1">
<p dir="rtl" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">אבג%</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">$x^2+1$%</p>
<p dir="rtl" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">דהו</p>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
p, li { white-space: pre-wrap; }
</style></blockquote>
<br>
</body>
</html>