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"
21 InsetMathXYMatrix::InsetMathXYMatrix(Length const & s, char c)
22 : InsetMathGrid(1, 1), spacing_(s), spacing_code_(c)
26 Inset * InsetMathXYMatrix::clone() const
28 return new InsetMathXYMatrix(*this);
32 int InsetMathXYMatrix::colsep() const
38 int InsetMathXYMatrix::rowsep() const
44 void InsetMathXYMatrix::metrics(MetricsInfo & mi, Dimension & dim) const
46 if (mi.base.style == LM_ST_DISPLAY)
47 mi.base.style = LM_ST_TEXT;
48 InsetMathGrid::metrics(mi, dim);
52 void InsetMathXYMatrix::write(WriteStream & os) const
55 switch (spacing_code_) {
62 os << '@' << spacing_code_ << '='
63 << from_ascii(spacing_.asLatexString());
66 if (!spacing_.empty())
67 os << "@=" << from_ascii(spacing_.asLatexString());
70 InsetMathGrid::write(os);
75 void InsetMathXYMatrix::infoize(odocstream & os) const
78 switch (spacing_code_) {
85 os << spacing_code_ << ' '
86 << from_ascii(spacing_.asLatexString()) << ' ';
89 if (!spacing_.empty())
90 os << from_ascii(spacing_.asLatexString()) << ' ';
92 InsetMathGrid::infoize(os);
96 void InsetMathXYMatrix::normalize(NormalStream & os) const
99 InsetMathGrid::normalize(os);
104 void InsetMathXYMatrix::maple(MapleStream & os) const
107 InsetMathGrid::maple(os);
112 void InsetMathXYMatrix::validate(LaTeXFeatures & features) const
114 features.require("xy");
115 InsetMathGrid::validate(features);