tex2lyx: register required packages for boxes

This commit is contained in:
Uwe Stöhr 2015-05-19 00:17:08 +02:00
parent bcc423c7ea
commit 0471fe366a
2 changed files with 9 additions and 1 deletions

View File

@ -183,7 +183,7 @@ const char * const known_lyx_packages[] = {"amsbsy", "amsmath", "amssymb",
"float", "fontspec", "graphicx", "hhline", "ifthen", "longtable", "makeidx",
"multirow", "nomencl", "pdfpages", "prettyref", "refstyle", "rotating",
"rotfloat", "splitidx", "setspace", "subscript", "textcomp", "tipa", "tipx",
"tone", "ulem", "url", "varioref", "verbatim", "wrapfig", "xunicode", 0};
"tone", "ulem", "url", "varioref", "verbatim", "wrapfig", "xcolor", "xunicode", 0};
// used for the handling of \newindex
int index_number = 0;

View File

@ -1229,6 +1229,13 @@ void parse_box(Parser & p, ostream & os, unsigned outer_flags,
if (shadow_size != "")
shadow_size = "";
}
// all boxes except of Frameless and Shaded require calc
if (!(outer_type.empty() || outer_type == "mbox") &&
!((outer_type == "shaded" && inner_type.empty()) ||
(outer_type == "minipage" && inner_type == "shaded") ||
(outer_type == "parbox" && inner_type == "shaded")))
preamble.registerAutomaticallyLoadedPackage("calc");
}
@ -1684,6 +1691,7 @@ void parse_environment(Parser & p, ostream & os, bool outer,
eat_whitespace(p, os, parent_context, false);
parse_outer_box(p, os, FLAG_END, outer, parent_context, name, "");
p.skip_spaces();
preamble.registerAutomaticallyLoadedPackage("framed");
}
else if (name == "lstlisting") {