#include "frontends/Painter.h"
-#include "support/lassert.h"
#include "support/debug.h"
+#include "support/lassert.h"
+#include "support/textutils.h"
#include <ostream>
#include <vector>
docstring MathMacro::name() const
{
- if (displayMode_ == DISPLAY_UNFOLDED)
+ if (displayMode_ == DISPLAY_UNFOLDED
+ && (name_.size() > 1 || (name_[0] != '_' && name_[0] != '^')))
return asString(cell(0));
- else
- return name_;
+
+ return name_;
}
// non-normal mode
if (displayMode_ != DISPLAY_NORMAL) {
os << "\\" << name();
- os.pendingSpace(true);
+ if (name().size() != 1 || isAlphaASCII(name()[0]))
+ os.pendingSpace(true);
return;
}