The attached patch fixes the \sinx problem. Any objections to applying it?

-- 
Enrico
Log:
Write a space if pendingSpace() is true and it is actually needed

        * src/mathed/MathStream.C
        (operator<<): add a space if pendingSpace() is true and what follows
        begins with a letter. Also update the number of lines written.
Index: src/mathed/MathStream.C
===================================================================
--- src/mathed/MathStream.C     (revision 15623)
+++ src/mathed/MathStream.C     (working copy)
@@ -93,7 +93,19 @@ NormalStream & operator<<(NormalStream &
 
 WriteStream & operator<<(WriteStream & ws, docstring const & s)
 {
+       if (ws.pendingSpace() && s.length() > 0) {
+               if (s[0] < 0x80 && isAlpha(static_cast<char>(s[0])))
+                       ws.os() << ' ';
+               ws.pendingSpace(false);
+       }
        ws.os() << s;
+       int lf = 0;
+       docstring::const_iterator dit = s.begin();
+       docstring::const_iterator end = s.end();
+       for (; dit != end; ++dit)
+               if ((*dit) == '\n')
+                       ++lf;
+       ws.addlines(lf);
        return ws;
 }
 

Reply via email to