h_tocdepth = "3";
h_tracking_changes = "false";
h_use_bibtopic = "false";
+ h_use_indices = "false";
h_use_geometry = "false";
h_use_amsmath = "1";
h_use_default_options = "false";
else if (is_known(name, known_old_language_packages)) {
// known language packages from the times before babel
// if they are found and not also babel, they will be used as
- // cutom language package
+ // custom language package
h_language_package = "\\usepackage{" + name + "}";
}
- else if (name == "makeidx")
- ; // ignore this
-
else if (name == "prettyref")
- ; // ignore this
+ ; // ignore this FIXME: Use the package separator mechanism instead
else if (name == "varioref")
- ; // ignore this
+ ; // ignore this FIXME: Use the package separator mechanism instead
else if (name == "verbatim")
- ; // ignore this
-
- else if (name == "nomencl")
- ; // ignore this
+ ; // ignore this FIXME: Use the package separator mechanism instead
else if (name == "textcomp")
- ; // ignore this
+ ; // ignore this FIXME: Use the package separator mechanism instead
- else if (name == "url")
- ; // ignore this
+ else if (name == "lyxskak") {
+ // ignore this and its options
+ if (!options.empty())
+ options.clear();
+ }
- else if (name == "color" || name == "subscript" || name == "ulem") {
+ else if (name == "array" || name == "booktabs" || name == "float" ||
+ name == "color" || name == "hhline" || name == "longtable" ||
+ name == "makeidx" || name == "nomencl" || name == "splitidx" ||
+ name == "setspace" || name == "subscript" || name == "ulem" ||
+ name == "url") {
if (!in_lyx_preamble)
h_preamble << package_beg_sep << name
<< package_mid_sep << "\\usepackage{"
}
else if (name == "graphicx")
- ; // ignore this
-
- else if (name == "setspace")
- ; // ignore this
+ ; // ignore this FIXME: Use the package separator mechanism instead
else if (name == "geometry")
handle_geometry(options);
else if (name == "rotfloat")
- ; // ignore this
+ ; // ignore this FIXME: Use the package separator mechanism instead
else if (name == "wrapfig")
- ; // ignore this
+ ; // ignore this FIXME: Use the package separator mechanism instead
else if (name == "subfig")
- ; // ignore this
+ ; // ignore this FIXME: Use the package separator mechanism instead
else if (is_known(name, known_languages))
h_language = name;
}
-bool Preamble::writeLyXHeader(ostream & os)
+bool Preamble::writeLyXHeader(ostream & os, bool subdoc)
{
// translate from babel to LyX names
h_language = babel2lyx(h_language);
else if (is_known(h_language, known_english_quotes_languages))
h_quotes_language = "english";
+ if (contains(h_float_placement, "H"))
+ registerAutomaticallyLoadedPackage("float");
+ if (h_spacing != "single" && h_spacing != "default")
+ registerAutomaticallyLoadedPackage("setspace");
+
// output the LyX file settings
os << "#LyX file created by tex2lyx " << PACKAGE_VERSION << "\n"
<< "\\lyxformat " << LYX_FORMAT << '\n'
<< "\\begin_document\n"
<< "\\begin_header\n"
<< "\\textclass " << h_textclass << "\n";
- string const raw = h_preamble.str();
+ string const raw = subdoc ? empty_string() : h_preamble.str();
if (!raw.empty()) {
os << "\\begin_preamble\n";
for (string::size_type i = 0; i < raw.size(); ++i) {
<< "\\use_undertilde " << h_use_undertilde << "\n"
<< "\\cite_engine " << h_cite_engine << "\n"
<< "\\use_bibtopic " << h_use_bibtopic << "\n"
+ << "\\use_indices " << h_use_indices << "\n"
<< "\\paperorientation " << h_paperorientation << '\n'
<< "\\suppress_date " << h_suppress_date << '\n'
<< "\\use_refstyle " << h_use_refstyle << '\n';
<< authors_
<< "\\end_header\n\n"
<< "\\begin_body\n";
- // clear preamble for subdocuments
- h_preamble.str("");
return true;
}
h_font_default_family = family.erase(0,1);
}
+ // remove the lyxdot definition that is re-added by LyX
+ // if necessary
+ if (name == "\\lyxdot")
+ in_lyx_preamble = true;
+
// Add the command to the known commands
add_known_command(name, opt1, !opt2.empty(), from_utf8(body));