+ else if (t.cs() == "unit") {
+ // Allowed formats \unit[val]{unit}
+ MathData ar;
+ parse(ar, FLAG_OPTION, mode);
+ if (ar.size()) {
+ cell->push_back(MathAtom(new InsetMathFrac(InsetMathFrac::UNIT)));
+ cell->back().nucleus()->cell(0) = ar;
+ parse(cell->back().nucleus()->cell(1), FLAG_ITEM, mode);
+ } else {
+ cell->push_back(MathAtom(new InsetMathFrac(InsetMathFrac::UNIT, 1)));
+ parse(cell->back().nucleus()->cell(0), FLAG_ITEM, mode);
+ }
+ }
+ else if (t.cs() == "unitfrac") {
+ // Here allowed formats are \unitfrac[val]{num}{denom}
+ MathData ar;
+ parse(ar, FLAG_OPTION, mode);
+ if (ar.size()) {
+ cell->push_back(MathAtom(new InsetMathFrac(InsetMathFrac::UNITFRAC, 3)));
+ cell->back().nucleus()->cell(2) = ar;
+ } else {
+ cell->push_back(MathAtom(new InsetMathFrac(InsetMathFrac::UNITFRAC)));
+ }
+ parse(cell->back().nucleus()->cell(0), FLAG_ITEM, mode);
+ parse(cell->back().nucleus()->cell(1), FLAG_ITEM, mode);
+ }
+