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 : InsetMathGrid(buf
, 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
57 MathEnsurer
ensurer(os
);
59 switch (spacing_code_
) {
66 os
<< '@' << spacing_code_
<< '='
67 << from_ascii(spacing_
.asLatexString());
70 if (!spacing_
.empty())
71 os
<< "@=" << from_ascii(spacing_
.asLatexString());
74 InsetMathGrid::write(os
);
79 void InsetMathXYMatrix::infoize(odocstream
& os
) const
82 switch (spacing_code_
) {
89 os
<< spacing_code_
<< ' '
90 << from_ascii(spacing_
.asLatexString()) << ' ';
93 if (!spacing_
.empty())
94 os
<< from_ascii(spacing_
.asLatexString()) << ' ';
96 InsetMathGrid::infoize(os
);
100 void InsetMathXYMatrix::normalize(NormalStream
& os
) const
103 InsetMathGrid::normalize(os
);
108 void InsetMathXYMatrix::maple(MapleStream
& os
) const
111 InsetMathGrid::maple(os
);
116 void InsetMathXYMatrix::validate(LaTeXFeatures
& features
) const
118 features
.require("xy");
119 InsetMathGrid::validate(features
);