-
#ifdef __GNUG__
-#pragma implementation
+#pragma implementation
#endif
#include <config.h>
#include "LaTeXFeatures.h"
#include "debug.h"
-
MathSymbolInset::MathSymbolInset(const latexkeys * l)
: sym_(l), h_(0)
{}
// << "' in font: '" << sym_->inset
// << "' drawn as: '" << sym_->draw
// << "'\n";
+
+ int const em = mathed_char_width(mi.base.font, 'M');
MathFontSetChanger dummy(mi.base, sym_->inset.c_str());
mathed_string_dim(mi.base.font, sym_->draw, dim_);
// correct height for broken cmex and wasy font
dim_.a += h_;
dim_.d -= h_;
}
- if (isRelOp())
- dim_.w += 6;
// seperate things a bit
- dim_.w += 2;
+ if (isRelOp())
+ dim_.w += static_cast<int>(0.5*em+0.5);
+ else
+ dim_.w += static_cast<int>(0.1667*em+0.5);
scriptable_ = false;
if (mi.base.style == LM_ST_DISPLAY)
// << "' in font: '" << sym_->inset
// << "' drawn as: '" << sym_->draw
// << "'\n";
+ int const em = mathed_char_width(pi.base.font, 'M');
if (isRelOp())
- x += 3;
- x += 1;
+ x += static_cast<int>(0.25*em+0.5);
+ else
+ x += static_cast<int>(0.0833*em+0.5);
+
MathFontSetChanger dummy(pi.base, sym_->inset.c_str());
drawStr(pi, pi.base.font, x, y - h_, sym_->draw);
}
void MathSymbolInset::normalize(NormalStream & os) const
{
- os << "[symbol " << name() << "]";
+ os << "[symbol " << name() << ']';
}
os << name();
}
+void MathSymbolInset::maximize(MaximaStream & os) const
+{
+ if (name() == "cdot")
+ os << '*';
+ else if (name() == "infty")
+ os << "INF";
+ else
+ os << name();
+}
+
+
void MathSymbolInset::mathematicize(MathematicaStream & os) const
{
if ( name() == "pi") { os << "Pi"; return;}