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;
34 InsetMathSubstack::InsetMathSubstack()
39 auto_ptr<Inset> InsetMathSubstack::doClone() const
41 return auto_ptr<Inset>(new InsetMathSubstack(*this));
45 bool 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);
60 void InsetMathSubstack::draw(PainterInfo & pi, int x, int y) const
62 InsetMathGrid::draw(pi, x + 1, y);
66 bool InsetMathSubstack::getStatus(Cursor & cur, FuncRequest const & cmd,
67 FuncStatus & flag) const
70 case LFUN_TABULAR_FEATURE: {
71 string const name("substack");
72 docstring const & s = cmd.argument();
73 if (s == "add-vline-left" || s == "add-vline-right") {
75 from_utf8(N_("Can't add vertical grid lines in '%1$s'")), lyx::from_utf8(name)));
79 return InsetMathGrid::getStatus(cur, cmd, flag);
82 return InsetMathGrid::getStatus(cur, cmd, flag);
87 void InsetMathSubstack::infoize(odocstream & os) const
93 void InsetMathSubstack::write(WriteStream & os) const
96 InsetMathGrid::write(os);
101 void InsetMathSubstack::normalize(NormalStream & os) const
104 InsetMathGrid::normalize(os);
109 void InsetMathSubstack::maple(MapleStream & os) const
112 InsetMathGrid::maple(os);
117 void InsetMathSubstack::validate(LaTeXFeatures & features) const
119 features.require("amsmath");
120 InsetMathGrid::validate(features);