} else if (ws.pendingSpace()) {
if (isAlphaASCII(s[first]))
ws.os() << ' ';
+ else if (s[first] == '[' && ws.useBraces())
+ ws.os() << "{}";
else if (s[first] == ' ' && ws.textMode())
ws.os() << '\\';
ws.pendingSpace(false);
+ } else if (ws.useBraces()) {
+ if (s[first] == '\'')
+ ws.os() << "{}";
+ ws.useBraces(false);
}
ws.os() << s.substr(first);
int lf = 0;
}
-void TeXMathStream::pendingSpace(bool how)
+void TeXMathStream::pendingSpace(bool space)
{
- pendingspace_ = how;
+ pendingspace_ = space;
+ if (!space)
+ usebraces_ = false;
+}
+
+
+void TeXMathStream::useBraces(bool braces)
+{
+ usebraces_ = braces;
}
} else if (ws.pendingSpace()) {
if (isAlphaASCII(c))
ws.os() << ' ';
+ else if (c == '[' && ws.useBraces())
+ ws.os() << "{}";
else if (c == ' ' && ws.textMode())
ws.os() << '\\';
ws.pendingSpace(false);
+ } else if (ws.useBraces()) {
+ if (c == '\'')
+ ws.os() << "{}";
+ ws.useBraces(false);
}
ws.os() << c;
if (c == '\n')