2 * \file InsetMathSubstack.C
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;
34 InsetMathSubstack::InsetMathSubstack()
39 auto_ptr<InsetBase> InsetMathSubstack::doClone() const
41 return auto_ptr<InsetBase>(new InsetMathSubstack(*this));
45 void InsetMathSubstack::metrics(MetricsInfo & mi, Dimension & dim) const
47 if (mi.base.style == LM_ST_DISPLAY) {
48 StyleChanger dummy(mi.base, LM_ST_TEXT);
49 InsetMathGrid::metrics(mi, dim);
51 InsetMathGrid::metrics(mi, dim);
57 void InsetMathSubstack::draw(PainterInfo & pi, int x, int y) const
59 InsetMathGrid::draw(pi, x + 1, y);
63 bool InsetMathSubstack::getStatus(LCursor & cur, FuncRequest const & cmd,
64 FuncStatus & flag) const
67 case LFUN_TABULAR_FEATURE: {
68 string const name("substack");
69 docstring const & s = cmd.argument();
70 if (s == "add-vline-left" || s == "add-vline-right") {
72 from_utf8(N_("Can't add vertical grid lines in '%1$s'")), lyx::from_utf8(name)));
76 return InsetMathGrid::getStatus(cur, cmd, flag);
79 return InsetMathGrid::getStatus(cur, cmd, flag);
84 void InsetMathSubstack::infoize(odocstream & os) const
90 void InsetMathSubstack::write(WriteStream & os) const
93 InsetMathGrid::write(os);
98 void InsetMathSubstack::normalize(NormalStream & os) const
101 InsetMathGrid::normalize(os);
106 void InsetMathSubstack::maple(MapleStream & os) const
109 InsetMathGrid::maple(os);
114 void InsetMathSubstack::validate(LaTeXFeatures & features) const
116 features.require("amsmath");
117 InsetMathGrid::validate(features);