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 "LaTeXFeatures.h"
14 #include "InsetMathSubstack.h"
16 #include "MathStream.h"
17 #include "support/std_ostream.h"
19 #include "FuncRequest.h"
20 #include "FuncStatus.h"
23 #include "support/lstrings.h"
28 using support::bformat;
32 InsetMathSubstack::InsetMathSubstack()
37 Inset * InsetMathSubstack::clone() const
39 return new InsetMathSubstack(*this);
43 bool InsetMathSubstack::metrics(MetricsInfo & mi, Dimension & dim) const
45 if (mi.base.style == LM_ST_DISPLAY) {
46 StyleChanger dummy(mi.base, LM_ST_TEXT);
47 InsetMathGrid::metrics(mi, dim);
49 InsetMathGrid::metrics(mi, dim);
58 void InsetMathSubstack::draw(PainterInfo & pi, int x, int y) const
60 InsetMathGrid::draw(pi, x + 1, y);
64 bool InsetMathSubstack::getStatus(Cursor & cur, FuncRequest const & cmd,
65 FuncStatus & flag) const
68 case LFUN_TABULAR_FEATURE: {
69 string const name = "substack";
70 docstring const & s = cmd.argument();
71 if (s == "add-vline-left" || s == "add-vline-right") {
73 from_utf8(N_("Can't add vertical grid lines in '%1$s'")),
78 return InsetMathGrid::getStatus(cur, cmd, flag);
81 return InsetMathGrid::getStatus(cur, cmd, flag);
86 void InsetMathSubstack::infoize(odocstream & os) const
92 void InsetMathSubstack::write(WriteStream & os) const
95 InsetMathGrid::write(os);
100 void InsetMathSubstack::normalize(NormalStream & os) const
103 InsetMathGrid::normalize(os);
108 void InsetMathSubstack::maple(MapleStream & os) const
111 InsetMathGrid::maple(os);
116 void InsetMathSubstack::validate(LaTeXFeatures & features) const
118 features.require("amsmath");
119 InsetMathGrid::validate(features);