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 void 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);
54 void InsetMathSubstack::draw(PainterInfo & pi, int x, int y) const
56 InsetMathGrid::draw(pi, x + 1, y);
60 bool InsetMathSubstack::getStatus(Cursor & cur, FuncRequest const & cmd,
61 FuncStatus & flag) const
64 case LFUN_TABULAR_FEATURE: {
65 string const name = "substack";
66 docstring const & s = cmd.argument();
67 if (s == "add-vline-left" || s == "add-vline-right") {
69 from_utf8(N_("Can't add vertical grid lines in '%1$s'")),
74 return InsetMathGrid::getStatus(cur, cmd, flag);
77 return InsetMathGrid::getStatus(cur, cmd, flag);
82 void InsetMathSubstack::infoize(odocstream & os) const
88 void InsetMathSubstack::write(WriteStream & os) const
91 InsetMathGrid::write(os);
96 void InsetMathSubstack::normalize(NormalStream & os) const
99 InsetMathGrid::normalize(os);
104 void InsetMathSubstack::maple(MapleStream & os) const
107 InsetMathGrid::maple(os);
112 void InsetMathSubstack::validate(LaTeXFeatures & features) const
114 features.require("amsmath");
115 InsetMathGrid::validate(features);