2 * \file InsetMathSubstack.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 "InsetMathSubstack.h"
15 #include "LaTeXFeatures.h"
17 #include "MathStream.h"
19 #include "FuncRequest.h"
20 #include "FuncStatus.h"
23 #include "support/lstrings.h"
29 using support::bformat;
33 InsetMathSubstack::InsetMathSubstack()
38 Inset * InsetMathSubstack::clone() const
40 return new InsetMathSubstack(*this);
44 void InsetMathSubstack::metrics(MetricsInfo & mi, Dimension & dim) const
46 if (mi.base.style == LM_ST_DISPLAY) {
47 StyleChanger dummy(mi.base, LM_ST_TEXT);
48 InsetMathGrid::metrics(mi, dim);
50 InsetMathGrid::metrics(mi, dim);
55 void InsetMathSubstack::draw(PainterInfo & pi, int x, int y) const
57 InsetMathGrid::draw(pi, x + 1, y);
61 bool InsetMathSubstack::getStatus(Cursor & cur, FuncRequest const & cmd,
62 FuncStatus & flag) const
65 case LFUN_TABULAR_FEATURE: {
66 string const name = "substack";
67 docstring const & s = cmd.argument();
68 if (s == "add-vline-left" || s == "add-vline-right") {
70 from_utf8(N_("Can't add vertical grid lines in '%1$s'")),
75 return InsetMathGrid::getStatus(cur, cmd, flag);
78 return InsetMathGrid::getStatus(cur, cmd, flag);
83 void InsetMathSubstack::infoize(odocstream & os) const
89 void InsetMathSubstack::write(WriteStream & os) const
92 InsetMathGrid::write(os);
97 void InsetMathSubstack::normalize(NormalStream & os) const
100 InsetMathGrid::normalize(os);
105 void InsetMathSubstack::maple(MapleStream & os) const
108 InsetMathGrid::maple(os);
113 void InsetMathSubstack::validate(LaTeXFeatures & features) const
115 features.require("amsmath");
116 InsetMathGrid::validate(features);