}
else if (t.cs() == "cfrac") {
- // Here allowed formats are \cfrac[pos]{num}{denom}
- MathData ar;
- parse(ar, FLAG_OPTION, mode);
- if (ar.size()) {
- cell->push_back(MathAtom(new InsetMathFrac(InsetMathFrac::CFRAC, 3)));
- cell->back().nucleus()->cell(2) = ar;
- } else {
- cell->push_back(MathAtom(new InsetMathFrac(InsetMathFrac::CFRAC)));
- }
+ // allowed formats are \cfrac[pos]{num}{denom}
+ docstring const arg = getArg('[', ']');
+ //lyxerr << "got so far: '" << arg << "'" << endl;
+ if (arg == "l")
+ cell->push_back(MathAtom(new InsetMathFrac(InsetMathFrac::CFRACLEFT)));
+ else if (arg == "r")
+ cell->push_back(MathAtom(new InsetMathFrac(InsetMathFrac::CFRACRIGHT)));
+ else if (arg.empty() || arg == "c")
+ cell->push_back(MathAtom(new InsetMathFrac(InsetMathFrac::CFRAC)));
+ else {
+ error("found invalid optional argument");
+ break;
+ }
parse(cell->back().nucleus()->cell(0), FLAG_ITEM, mode);
parse(cell->back().nucleus()->cell(1), FLAG_ITEM, mode);
}