math_bigopinset.h \
math_binominset.C \
math_binominset.h \
+ math_cheatinset.C \
+ math_cheatinset.h \
math_charinset.C \
math_charinset.h \
math_cursor.C \
--- /dev/null
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
+#include "math_cheatinset.h"
+#include "support.h"
+#include "support/LOstream.h"
+
+
+
+MathCheatInset::MathCheatInset(double w)
+ : wid_(w)
+{}
+
+
+MathInset * MathCheatInset::clone() const
+{
+ return new MathCheatInset(*this);
+}
+
+
+void MathCheatInset::draw(Painter & pain, int x, int y) const
+{}
+
+
+void MathCheatInset::write(std::ostream &, bool) const
+{}
+
+
+void MathCheatInset::writeNormal(std::ostream &) const
+{}
+
+
+void MathCheatInset::metrics(MathStyles st) const
+{
+ // mimic -.1em
+ mathed_char_dim(LM_TC_CONST, st, 'm', ascent_, descent_, width_);
+ width_ *= wid_;
+}
--- /dev/null
+// -*- C++ -*-
+#ifndef MATH_CHEATINSET_H
+#define MATH_CHEATINSET_H
+
+#include "math_diminset.h"
+
+#ifdef __GNUG__
+#pragma interface
+#endif
+
+/// Some cheating for displaying things like \ll etc
+
+class MathCheatInset : public MathDimInset {
+public:
+ ///
+ explicit MathCheatInset(double wid);
+ ///
+ MathInset * clone() const;
+ ///
+ void draw(Painter &, int x, int y) const;
+ ///
+ void write(std::ostream &, bool fragile) const;
+ ///
+ void writeNormal(std::ostream &) const;
+ ///
+ void metrics(MathStyles st) const;
+private:
+ /// width in em
+ double wid_;
+};
+#endif
{"gamma", LM_TK_SYM, LM_gamma, LMB_NONE},
{"gcd", LM_TK_FUNCLIM, 0, LMB_NONE},
{"geq", LM_TK_SYM, LM_geq, LMB_RELATION},
- {"gg", LM_TK_NOGLYPH, 0, LMB_RELATION},
{"grave", LM_TK_DECORATION, LM_grave, LMB_NONE},
{"hat", LM_TK_DECORATION, LM_hat, LMB_NONE},
{"hbar", LM_TK_NOGLYPH, 0, LMB_NONE},
{"liminf", LM_TK_FUNCLIM, 0, LMB_NONE},
{"limits", LM_TK_LIMIT, 1 , LMB_NONE},
{"limsup", LM_TK_FUNCLIM, 0, LMB_NONE},
- {"ll", LM_TK_NOGLYPH, 0, LMB_RELATION},
{"ln", LM_TK_FUNC, 0, LMB_NONE},
{"log", LM_TK_FUNC, 0, LMB_NONE},
{"longleftarrow", LM_TK_NOGLYPH, 0, LMB_NONE},
#include "math_macrotemplate.h"
#include "math_parser.h"
#include "math_fracinset.h"
+#include "math_cheatinset.h"
+#include "math_charinset.h"
#include "debug.h"
//createTemplate("lint", 4, "\\int_#1^#2#3 d#4");
//createTemplate("silentmult", 0, "\\cdot");
//createTemplate("binom", 2, "\\left(\\frac#1#2\\right)");
+
+ MathMacroTemplate ll("ll", 0);
+ ll.cell(0).push_back(new MathCharInset('<', LM_TC_CONST));
+ ll.cell(0).push_back(new MathCheatInset(-0.9));
+ ll.cell(0).push_back(new MathCharInset('<', LM_TC_CONST));
+ insertTemplate(ll);
+
+ MathMacroTemplate gg("gg", 0);
+ gg.cell(0).push_back(new MathCharInset('>', LM_TC_CONST));
+ gg.cell(0).push_back(new MathCheatInset(-0.9));
+ gg.cell(0).push_back(new MathCharInset('>', LM_TC_CONST));
+ insertTemplate(gg);
}