}
+bool InsetMathHull::outerDisplay() const
+{
+ switch (type_) {
+ case hullEquation:
+ case hullEqnArray:
+ case hullAlign:
+ case hullFlAlign:
+ case hullGather:
+ case hullMultline:
+ return true;
+ case hullNone:
+ case hullSimple:
+ case hullAlignAt:
+ case hullXAlignAt:
+ case hullXXAlignAt:
+ case hullUnknown:
+ case hullRegexp:
+ break;
+ }
+ return false;
+}
+
+
Inset::DisplayType InsetMathHull::display() const
{
switch (type_) {
if (ams())
features.require("amsmath");
- switch(type_) {
- case hullNone:
- case hullSimple:
- case hullAlignAt:
- case hullXAlignAt:
- case hullXXAlignAt:
- case hullUnknown:
- break;
-
- case hullEquation:
- case hullEqnArray:
- case hullAlign:
- case hullFlAlign:
- case hullGather:
- case hullMultline:
- if (features.inDeletedInset() && !features.mustProvide("ct-dvipost"))
- features.require("ct-tikz-math-sout");
- break;
-
- case hullRegexp:
+ if (type_ == hullRegexp) {
features.require("color");
docstring frcol = from_utf8(lcolor.getLaTeXName(Color_regexpframe));
docstring bgcol = from_ascii("white");
+ bgcol + "}{\\ensuremath{\\mathtt{#1}}}}");
features.addPreambleSnippet(
from_ascii("\\newcommand{\\endregexp}{}"));
- break;
+ } else if (outerDisplay() && features.inDeletedInset()
+ && !features.mustProvide("ct-dvipost")) {
+ features.require("ct-tikz-math-sout");
}
// Validation is necessary only if not using AMS math.
break;
case hullSimple:
+ if (os.ulemCmd())
+ os << "\\mbox{";
os << '$';
os.startOuterRow();
if (cell(0).empty())
case hullEquation:
if (os.strikeoutMath()) {
- os << "\\\\\\mbox{}\\\\\n"
- << "\\lyxmathsout{\\parbox{\\columnwidth}{";
- }
+ if (os.ulemCmd() == WriteStream::UNDERLINE)
+ os << "\\raisebox{1ex}{";
+ os << "\\lyxmathsout{\\parbox{\\columnwidth}{";
+ } else if (os.ulemCmd() == WriteStream::UNDERLINE)
+ os << "\\raisebox{-1ex}{\\parbox[b]{\\columnwidth}{";
+ else if (os.ulemCmd() == WriteStream::STRIKEOUT)
+ os << "\\parbox{\\columnwidth}{";
os << "\n";
os.startOuterRow();
if (n)
case hullGather:
case hullMultline:
if (os.strikeoutMath()) {
- os << "\\\\\\mbox{}\\\\\n"
- << "\\lyxmathsout{\\parbox{\\columnwidth}{";
- }
+ if (os.ulemCmd() == WriteStream::UNDERLINE)
+ os << "\\raisebox{1ex}{";
+ os << "\\lyxmathsout{\\parbox{\\columnwidth}{";
+ } else if (os.ulemCmd() == WriteStream::UNDERLINE)
+ os << "\\raisebox{-1ex}{\\parbox[b]{\\columnwidth}{";
+ else if (os.ulemCmd() == WriteStream::STRIKEOUT)
+ os << "\\parbox{\\columnwidth}{";
os << "\n";
os.startOuterRow();
os << "\\begin{" << hullName(type_) << star(n) << "}\n";
case hullSimple:
os << '$';
+ if (os.ulemCmd())
+ os << "}";
break;
case hullEquation:
os << "\\end{equation" << star(n) << "}\n";
else
os << "\\]\n";
- if (os.strikeoutMath())
+ if (os.strikeoutMath()) {
+ if (os.ulemCmd() == WriteStream::UNDERLINE)
+ os << "}";
os << "}}\\\\\n";
+ } else if (os.ulemCmd() == WriteStream::UNDERLINE)
+ os << "}}\\\\\n";
+ else if (os.ulemCmd() == WriteStream::STRIKEOUT)
+ os << "}\\\\\n";
break;
case hullEqnArray:
os << "\n";
os.startOuterRow();
os << "\\end{" << hullName(type_) << star(n) << "}\n";
- if (os.strikeoutMath())
+ if (os.strikeoutMath()) {
+ if (os.ulemCmd() == WriteStream::UNDERLINE)
+ os << "}";
+ os << "}}\\\\\n";
+ } else if (os.ulemCmd() == WriteStream::UNDERLINE)
os << "}}\\\\\n";
+ else if (os.ulemCmd() == WriteStream::STRIKEOUT)
+ os << "}\\\\\n";
break;
case hullAlignAt: