]> git.lyx.org Git - features.git/commitdiff
better fix for bug #17652
authorAndré Pönitz <poenitz@gmx.net>
Sun, 1 Apr 2007 13:06:41 +0000 (13:06 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Sun, 1 Apr 2007 13:06:41 +0000 (13:06 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17676 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/InsetMathSymbol.C

index 9f1e654998b35eca9c4a5dd81099034421c4f4fb..4066dba4ef9b98350fa17e5130fd348dd9751335 100644 (file)
@@ -20,6 +20,7 @@
 #include "LaTeXFeatures.h"
 #include "debug.h"
 
+#include <cctype>
 
 namespace lyx {
 
@@ -215,8 +216,13 @@ void InsetMathSymbol::octave(OctaveStream & os) const
 void InsetMathSymbol::write(WriteStream & os) const
 {
        os << '\\' << name();
-       if (name().size() == 1 && name()[0] < '0') // $,#, etc
+
+       // $,#, etc. In theory the restriction based on catcodes, but then
+       // we do not handle catcodes very well, let alone cat code changes,
+       // so being outside the alpha range is good enough.
+       if (name().size() == 1 && !std::isalpha(name()[0]))
                return;
+
        os.pendingSpace(true);
 }