2 * \file InsetMathXYMatrix.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 #include "InsetMathXYMatrix.h"
15 #include "LaTeXFeatures.h"
16 #include "MathStream.h"
23 InsetMathXYMatrix::InsetMathXYMatrix(Buffer * buf, Length const & s, char c,
24 bool e) : InsetMathGrid(buf, 1, 1), spacing_(s), spacing_code_(c),
30 Inset * InsetMathXYMatrix::clone() const
32 return new InsetMathXYMatrix(*this);
36 int InsetMathXYMatrix::colsep() const
42 int InsetMathXYMatrix::rowsep() const
48 void InsetMathXYMatrix::metrics(MetricsInfo & mi, Dimension & dim) const
50 if (mi.base.style == LM_ST_DISPLAY)
51 mi.base.style = LM_ST_TEXT;
52 InsetMathGrid::metrics(mi, dim);
56 void InsetMathXYMatrix::write(WriteStream & os) const
58 MathEnsurer ensurer(os);
60 bool open = os.startOuterRow();
63 switch (spacing_code_) {
70 switch (spacing_code_) {
77 os << '@' << spacing_code_ << '='
78 << from_ascii(spacing_.asLatexString());
81 if (!spacing_.empty())
82 os << "@=" << from_ascii(spacing_.asLatexString());
86 InsetMathGrid::write(os);
94 void InsetMathXYMatrix::infoize(odocstream & os) const
98 switch (spacing_code_) {
102 os << '!' << spacing_code_ << ' ';
105 switch (spacing_code_) {
112 os << spacing_code_ << ' '
113 << from_ascii(spacing_.asLatexString()) << ' ';
116 if (!spacing_.empty())
117 os << from_ascii(spacing_.asLatexString()) << ' ';
120 InsetMathGrid::infoize(os);
124 void InsetMathXYMatrix::normalize(NormalStream & os) const
127 InsetMathGrid::normalize(os);
132 void InsetMathXYMatrix::maple(MapleStream & os) const
135 InsetMathGrid::maple(os);
140 void InsetMathXYMatrix::validate(LaTeXFeatures & features) const
142 features.require("xy");
143 InsetMathGrid::validate(features);
147 void InsetMathXYMatrix::mathmlize(MathStream &) const
149 throw MathExportException();
153 void InsetMathXYMatrix::htmlize(HtmlStream &) const
155 throw MathExportException();