for (size_t i = 0; i < no_arguments; ++i) {
switch (template_arguments[i]) {
case required:
+ case req_group:
// This argument contains regular LaTeX
handle_ert(os, ert + '{', context);
eat_whitespace(p, os, context, false);
- parse_text(p, os, FLAG_ITEM, outer, context);
+ if (template_arguments[i] == required)
+ parse_text(p, os, FLAG_ITEM, outer, context);
+ else
+ parse_text_snippet(p, os, FLAG_ITEM, outer, context);
ert = "}";
break;
case item:
else
ert += p.verbatim_item();
break;
+ case displaymath:
case verbatim:
// This argument may contain special characters
ert += '{' + p.verbatim_item() + '}';
break;
case optional:
+ case opt_group:
// true because we must not eat whitespace
// if an optional arg follows we must not strip the
// brackets from this one
parse_math(p, os, FLAG_END, MATH_MODE);
os << "\\end{" << name << "}";
end_inset(os);
+ if (is_display_math_env(name)) {
+ // Prevent the conversion of a line break to a space
+ // (bug 7668). This does not change the output, but
+ // looks ugly in LyX.
+ eat_whitespace(p, os, parent_context, false);
+ }
}
else if (unstarred_name == "tabular" || name == "longtable") {
context.check_layout(os);
begin_inset(os, "Formula ");
Token const & n = p.get_token();
- if (n.cat() == catMath && outer) {
+ bool const display(n.cat() == catMath && outer);
+ if (display) {
// TeX's $$...$$ syntax for displayed math
os << "\\[";
parse_math(p, os, FLAG_SIMPLE, MATH_MODE);
os << '$';
}
end_inset(os);
+ if (display) {
+ // Prevent the conversion of a line break to a
+ // space (bug 7668). This does not change the
+ // output, but looks ugly in LyX.
+ eat_whitespace(p, os, context, false);
+ }
}
else if (t.cat() == catSuper || t.cat() == catSub)
parse_math(p, os, FLAG_EQUATION, MATH_MODE);
os << "\\]";
end_inset(os);
+ // Prevent the conversion of a line break to a space
+ // (bug 7668). This does not change the output, but
+ // looks ugly in LyX.
+ eat_whitespace(p, os, context, false);
}
else if (t.cs() == "begin")