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 "MathStream.h"
17 #include "LaTeXFeatures.h"
18 #include "MetricsInfo.h"
25 InsetMathXYMatrix::InsetMathXYMatrix(Buffer * buf, Length const & s, char c,
26 bool e) : InsetMathGrid(buf, 1, 1), spacing_(s), spacing_code_(c),
32 Inset * InsetMathXYMatrix::clone() const
34 return new InsetMathXYMatrix(*this);
38 int InsetMathXYMatrix::colsep() const
44 int InsetMathXYMatrix::rowsep() const
50 void InsetMathXYMatrix::metrics(MetricsInfo & mi, Dimension & dim) const
52 if (mi.base.style == LM_ST_DISPLAY)
53 mi.base.style = LM_ST_TEXT;
54 InsetMathGrid::metrics(mi, dim);
58 void InsetMathXYMatrix::write(WriteStream & os) const
60 MathEnsurer ensurer(os);
62 bool open = os.startOuterRow();
65 switch (spacing_code_) {
72 switch (spacing_code_) {
79 os << '@' << spacing_code_ << '='
80 << from_ascii(spacing_.asLatexString());
83 if (!spacing_.empty())
84 os << "@=" << from_ascii(spacing_.asLatexString());
88 InsetMathGrid::write(os);
96 void InsetMathXYMatrix::infoize(odocstream & os) const
100 switch (spacing_code_) {
104 os << '!' << spacing_code_ << ' ';
107 switch (spacing_code_) {
114 os << spacing_code_ << ' '
115 << from_ascii(spacing_.asLatexString()) << ' ';
118 if (!spacing_.empty())
119 os << from_ascii(spacing_.asLatexString()) << ' ';
122 InsetMathGrid::infoize(os);
126 void InsetMathXYMatrix::normalize(NormalStream & os) const
129 InsetMathGrid::normalize(os);
134 void InsetMathXYMatrix::maple(MapleStream & os) const
137 InsetMathGrid::maple(os);
142 void InsetMathXYMatrix::validate(LaTeXFeatures & features) const
144 features.require("xy");
145 InsetMathGrid::validate(features);
149 void InsetMathXYMatrix::mathmlize(MathStream &) const
151 throw MathExportException();
155 void InsetMathXYMatrix::htmlize(HtmlStream &) const
157 throw MathExportException();