math_spaceinset.h \
math_specialcharinset.C \
math_specialcharinset.h \
+ math_splitinset.C \
+ math_splitinset.h \
math_sqrtinset.C \
math_sqrtinset.h \
math_stackrelinset.C \
{}
+
int MathGridInset::RowInfo::skipPixels() const
{
#ifdef WITH_WARNINGS
lyxerr << "positve number of columns expected\n";
if (n <= 0)
lyxerr << "positve number of rows expected\n";
- for (int col = 0; col < m; ++col) {
- colinfo_[col].skip_ = defaultColSpace(col);
- colinfo_[col].align_ = defaultColAlign(col);
- }
+ setDefaults();
}
}
+void MathGridInset::setDefaults()
+{
+ for (int col = 0; col < ncols(); ++col) {
+ colinfo_[col].align_ = defaultColAlign(col);
+ colinfo_[col].skip_ = defaultColSpace(col);
+ }
+}
+
void MathGridInset::halign(string const & hh)
{
virtual int defaultColSpace(int) { return 10; }
///
virtual char defaultColAlign(int) { return 'c'; }
+ ///
+ void setDefaults();
protected:
/// returns proper 'end of line' code for LaTeX
}
-void MathMatrixInset::setDefaults()
-{
- for (int col = 0; col < ncols(); ++col) {
- colinfo_[col].align_ = defaultColAlign(col);
- colinfo_[col].skip_ = defaultColSpace(col);
- }
-}
-
-
void MathMatrixInset::metrics(MathStyles) const
{
size_ = (getType() == LM_OT_SIMPLE) ? LM_ST_TEXT : LM_ST_DISPLAY;
MathInsetTypes getType() const;
private:
- ///
- void setDefaults();
///
void setType(MathInsetTypes t);
///
#include "math_sqrtinset.h"
#include "math_scriptinset.h"
#include "math_specialcharinset.h"
+#include "math_splitinset.h"
#include "math_sqrtinset.h"
#include "debug.h"
#include "support.h"
m->halign(halign);
parse_lines(m, false, false);
array.push_back(m);
+ } else if (name == "split") {
+ MathSplitInset * m = new MathSplitInset(1);
+ parse_lines(m, false, false);
+ array.push_back(m);
} else
lyxerr[Debug::MATHED] << "unknow math inset begin '" << name << "'\n";
}
--- /dev/null
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
+#include "math_splitinset.h"
+#include "support/LOstream.h"
+
+
+MathSplitInset::MathSplitInset(int n)
+ : MathGridInset(2, n)
+{
+ setDefaults();
+}
+
+
+MathInset * MathSplitInset::clone() const
+{
+ return new MathSplitInset(*this);
+}
+
+
+void MathSplitInset::write(std::ostream & os, bool fragile) const
+{
+ if (fragile)
+ os << "\\protect";
+ os << "\\begin{split}";
+ MathGridInset::write(os, fragile);
+ if (fragile)
+ os << "\\protect";
+ os << "\\end{split}\n";
+}
--- /dev/null
+// -*- C++ -*-
+#ifndef MATH_SPLITINSET_H
+#define MATH_SPLITINSET_H
+
+#include "math_gridinset.h"
+
+#ifdef __GNUG__
+#pragma interface
+#endif
+
+
+class MathSplitInset : public MathGridInset {
+public:
+ ///
+ explicit MathSplitInset(int n);
+ ///
+ MathInset * clone() const;
+ ///
+ void write(std::ostream &, bool fragile) const;
+ ///
+ int defaultColSpace(int) { return 0; }
+ ///
+ char defaultColAlign(int) { return 'l'; }
+};
+
+#endif