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"
24 InsetMathXYMatrix::InsetMathXYMatrix(Length const & s, char c)
25 : InsetMathGrid(1, 1), spacing_(s), spacing_code_(c)
29 Inset * InsetMathXYMatrix::clone() const
31 return new InsetMathXYMatrix(*this);
35 int InsetMathXYMatrix::colsep() const
41 int InsetMathXYMatrix::rowsep() const
47 void InsetMathXYMatrix::metrics(MetricsInfo & mi, Dimension & dim) const
49 if (mi.base.style == LM_ST_DISPLAY)
50 mi.base.style = LM_ST_TEXT;
51 InsetMathGrid::metrics(mi, dim);
55 void InsetMathXYMatrix::write(WriteStream & os) const
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);