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(Length const & s, char c)
24 : InsetMathGrid(1, 1), spacing_(s), spacing_code_(c)
28 Inset * InsetMathXYMatrix::clone() const
30 return new InsetMathXYMatrix(*this);
34 int InsetMathXYMatrix::colsep() const
40 int InsetMathXYMatrix::rowsep() const
46 void InsetMathXYMatrix::metrics(MetricsInfo & mi, Dimension & dim) const
48 if (mi.base.style == LM_ST_DISPLAY)
49 mi.base.style = LM_ST_TEXT;
50 InsetMathGrid::metrics(mi, dim);
54 void InsetMathXYMatrix::write(WriteStream & os) const
56 MathEnsurer ensurer(os);
58 switch (spacing_code_) {
65 os << '@' << spacing_code_ << '='
66 << from_ascii(spacing_.asLatexString());
69 if (!spacing_.empty())
70 os << "@=" << from_ascii(spacing_.asLatexString());
73 InsetMathGrid::write(os);
78 void InsetMathXYMatrix::infoize(odocstream & os) const
81 switch (spacing_code_) {
88 os << spacing_code_ << ' '
89 << from_ascii(spacing_.asLatexString()) << ' ';
92 if (!spacing_.empty())
93 os << from_ascii(spacing_.asLatexString()) << ' ';
95 InsetMathGrid::infoize(os);
99 void InsetMathXYMatrix::normalize(NormalStream & os) const
102 InsetMathGrid::normalize(os);
107 void InsetMathXYMatrix::maple(MapleStream & os) const
110 InsetMathGrid::maple(os);
115 void InsetMathXYMatrix::validate(LaTeXFeatures & features) const
117 features.require("xy");
118 InsetMathGrid::validate(features);