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);
62 switch (spacing_code_) {
69 switch (spacing_code_) {
76 os << '@' << spacing_code_ << '='
77 << from_ascii(spacing_.asLatexString());
80 if (!spacing_.empty())
81 os << "@=" << from_ascii(spacing_.asLatexString());
85 InsetMathGrid::write(os);
90 void InsetMathXYMatrix::infoize(odocstream & os) const
94 switch (spacing_code_) {
98 os << '!' << spacing_code_ << ' ';
101 switch (spacing_code_) {
108 os << spacing_code_ << ' '
109 << from_ascii(spacing_.asLatexString()) << ' ';
112 if (!spacing_.empty())
113 os << from_ascii(spacing_.asLatexString()) << ' ';
116 InsetMathGrid::infoize(os);
120 void InsetMathXYMatrix::normalize(NormalStream & os) const
123 InsetMathGrid::normalize(os);
128 void InsetMathXYMatrix::maple(MapleStream & os) const
131 InsetMathGrid::maple(os);
136 void InsetMathXYMatrix::validate(LaTeXFeatures & features) const
138 features.require("xy");
139 InsetMathGrid::validate(features);
143 void InsetMathXYMatrix::mathmlize(MathStream &) const
145 throw MathExportException();
149 void InsetMathXYMatrix::htmlize(HtmlStream &) const
151 throw MathExportException();