better fix for bug #17652

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17676 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2007-04-01 13:06:41 +00:00
parent 83b326d204
commit 15b343d8f3

View 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);
}