+ if (name == "ref") {
+ InsetCommandParams icp(REF_CODE);
+ // FIXME UNICODE
+ InsetCommand::string2params(to_utf8(str), icp);
+ Encoding const * const utf8 = encodings.fromLyXName("utf8");
+ OutputParams op(utf8);
+ mathed_parse_cell(ar, icp.getCommand(op));
+ } else if (name == "mathspace") {
+ InsetSpaceParams isp(true);
+ InsetSpace::string2params(to_utf8(str), isp);
+ InsetSpace is(isp);
+ TexRow texrow;
+ odocstringstream ods;
+ otexstream os(ods, texrow);
+ Encoding const * const ascii = encodings.fromLyXName("ascii");
+ OutputParams op(ascii);
+ is.latex(os, op);
+ mathed_parse_cell(ar, ods.str());
+ if (ar.size() == 2) {
+ // remove "{}"
+ if (ar[1].nucleus()->asBraceInset())
+ ar.pop_back();
+ }
+ } else