char const * const known_tex_extensions[] = {"tex", 0};
/// spaces known by InsetSpace
-char const * const known_spaces[] = { " ", "space", ",", "thinspace", "quad",
-"qquad", "enspace", "enskip", "negthinspace", "hfill", "dotfill", "hrulefill",
-"leftarrowfill", "rightarrowfill", "upbracefill", "downbracefill", 0};
+char const * const known_spaces[] = { " ", "space", ",",
+"thinspace", "quad", "qquad", "enspace", "enskip",
+"negthinspace", "negmedspace", "negthickspace", "textvisiblespace",
+"hfill", "dotfill", "hrulefill", "leftarrowfill", "rightarrowfill",
+"upbracefill", "downbracefill", 0};
/// the same as known_spaces with .lyx names
char const * const known_coded_spaces[] = { "space{}", "space{}",
"thinspace{}", "thinspace{}", "quad{}", "qquad{}", "enspace{}", "enskip{}",
-"negthinspace{}", "hfill{}", "dotfill{}", "hrulefill{}", "leftarrowfill{}",
-"rightarrowfill{}", "upbracefill{}", "downbracefill{}", 0};
+"negthinspace{}", "negmedspace{}", "negthickspace{}", "textvisiblespace{}",
+"hfill{}", "dotfill{}", "hrulefill{}", "leftarrowfill{}", "rightarrowfill{}",
+"upbracefill{}", "downbracefill{}", 0};
/// These are translated by LyX to commands like "\\LyX{}", so we have to put
/// them in ERT. "LaTeXe" must come before "LaTeX"!
Context context(true, parent_context.textclass);
context.font = parent_context.font;
+ // FIXME, the inset layout should be plain, not standard, see bug #7846
+
// If we have no inner box the contens will be read with the outer box
if (!inner_type.empty())
parse_text(p, os, inner_flags, outer, context);
p.skip_spaces();
}
+ else if (unstarred_name == "sidewaysfigure"
+ || unstarred_name == "sidewaystable") {
+ eat_whitespace(p, os, parent_context, false);
+ parent_context.check_layout(os);
+ if (unstarred_name == "sidewaysfigure")
+ begin_inset(os, "Float figure\n");
+ else
+ begin_inset(os, "Float table\n");
+ os << "wide " << convert<string>(is_starred)
+ << "\nsideways true"
+ << "\nstatus open\n\n";
+ parse_text_in_inset(p, os, FLAG_END, outer, parent_context);
+ end_inset(os);
+ // We don't need really a new paragraph, but
+ // we must make sure that the next item gets a \begin_layout.
+ parent_context.new_paragraph(os);
+ p.skip_spaces();
+ }
+
else if (name == "minipage") {
eat_whitespace(p, os, parent_context, false);
parse_box(p, os, 0, FLAG_END, outer, parent_context, "", "", name);
os << "\n\\" << t.cs() << " default\n";
}
+ // FIXME, the inset layout should be plain, not standard, see bug #7846
+ else if (t.cs() == "phantom" || t.cs() == "hphantom" ||
+ t.cs() == "vphantom") {
+ context.check_layout(os);
+ if (t.cs() == "phantom")
+ begin_inset(os, "Phantom Phantom\n");
+ if (t.cs() == "hphantom")
+ begin_inset(os, "Phantom Hhantom\n");
+ if (t.cs() == "vphantom")
+ begin_inset(os, "Phantom Vhantom\n");
+ os << "status open\n";
+ parse_text_in_inset(p, os, FLAG_ITEM, outer, context);
+ end_inset(os);
+ }
+
else if (t.cs() == "lyxline") {
// swallow size argument (it is not used anyway)
p.getArg('{', '}');
end_inset(os);
}
+ else if (t.cs() == "rule") {
+ string offset = "";
+ string width;
+ string thickness;
+ if (p.hasOpt())
+ offset = p.getArg('[', ']');
+ width = p.getArg('{', '}');
+ thickness = p.getArg('{', '}');
+
+ context.check_layout(os);
+ begin_command_inset(os, "line", "rule");
+ if (!offset.empty())
+ os << "offset \"" << translate_len(offset) << "\"\n";
+ os << "width \"" << translate_len(width) << "\"\n"
+ "height \"" << translate_len(thickness) << "\"\n";
+ end_inset(os);
+ }
+
else if (is_known(t.cs(), known_phrases) ||
(t.cs() == "protect" &&
p.next_token().cat() == catEscape &&
}
else if (t.cs() == "printnomenclature") {
+ string width = "";
+ string width_type = "";
context.check_layout(os);
begin_command_inset(os, "nomencl_print", "printnomenclature");
+ // case of a custom width
+ if (p.hasOpt()) {
+ width = p.getArg('[', ']');
+ width = translate_len(width);
+ width_type = "custom";
+ }
+ // case of no custom width
+ // the case of no custom width but the width set
+ // via \settowidth{\nomlabelwidth}{***} cannot be supported
+ // because the user could have set anything, not only the width
+ // of the longest label (which would be width_type = "auto")
+ string label = convert_command_inset_arg(p.getArg('{', '}'));
+ if (label.empty() && width_type.empty())
+ width_type = "none";
+ os << "set_width \"" << width_type << "\"\n";
+ if (width_type == "custom")
+ os << "width \"" << width << '\"';
end_inset(os);
skip_spaces_braces(p);
}