#include "frontends/FontLoader.h"
+#include "Buffer.h"
+#include "BufferParams.h"
#include "Encoding.h"
#include "LyX.h" // use_gui
#include "OutputParams.h"
MathAtom createInsetMath(docstring const & s, Buffer * buf)
{
//lyxerr << "creating inset with name: '" << to_utf8(s) << '\'' << endl;
+ if ((s == "ce" || s == "cf") && buf
+ && buf->params().use_mhchem == BufferParams::package_off)
+ return MathAtom(new MathMacro(buf, s));
+
latexkeys const * l = in_word_set(s);
if (l) {
docstring const & inset = l->inset;
if (s.substr(0, 8) == "xymatrix") {
char spacing_code = '\0';
Length spacing;
+ bool equal_spacing = false;
size_t const len = s.length();
size_t i = 8;
if (i < len && s[i] == '@') {
++i;
- if (i < len) {
+ if (i < len && s[i] == '!') {
+ equal_spacing = true;
+ ++i;
+ if (i < len) {
+ switch (s[i]) {
+ case '0':
+ case 'R':
+ case 'C':
+ spacing_code = static_cast<char>(s[i]);
+ }
+ }
+ } else if (i < len) {
switch (s[i]) {
case 'R':
case 'C':
++i;
break;
}
- }
- if (i < len && s[i] == '=') {
- ++i;
- spacing = Length(to_ascii(s.substr(i)));
+ if (i < len && s[i] == '=') {
+ ++i;
+ spacing = Length(to_ascii(s.substr(i)));
+ }
}
}
- return MathAtom(new InsetMathXYMatrix(buf, spacing, spacing_code));
+ return MathAtom(new InsetMathXYMatrix(buf, spacing, spacing_code,
+ equal_spacing));
}
if (s == "xrightarrow" || s == "xleftarrow")
return MathAtom(new InsetMathXArrow(buf, s));
- if (s == "split" || s == "gathered" || s == "aligned" || s == "alignedat")
+ if (s == "split" || s == "alignedat")
return MathAtom(new InsetMathSplit(buf, s));
if (s == "cases")
return MathAtom(new InsetMathCases(buf));