biblio_style = "plain";
use_bibtopic = false;
use_indices = false;
+ save_transient_properties = true;
track_changes = false;
output_changes = false;
use_default_options = true;
frontend::Alert::warning(_("Document class not available"),
msg, true);
}
+ } else if (token == "\\save_transient_properties") {
+ lex >> save_transient_properties;
} else if (token == "\\origin") {
lex.eatLine();
origin = lex.getString();
// The top of the file is written by the buffer.
// Prints out the buffer info into the .lyx file given by file
- // the document directory
- // use realPath() instead of absFileName() for comparing
- // so we can catch also eventually used symbolic parts of the path.
- string filepath = buf->fileName().onlyPath().realPath();
- string const sysdir = package().system_support().realPath();
+ os << "\\save_transient_properties "
+ << convert<string>(save_transient_properties) << '\n';
+
+ // the document directory (must end with a path separator)
+ // realPath() is used to resolve symlinks, while addPath(..., "")
+ // ensures a trailing path separator.
+ string filepath = addPath(buf->fileName().onlyPath().realPath(), "");
+ string const sysdir = addPath(package().system_support().realPath(), "");
string const relpath =
to_utf8(makeRelPath(from_utf8(filepath), from_utf8(sysdir)));
if (!prefixIs(relpath, "../") && !FileName::isAbsolute(relpath))
filepath = addPath("/systemlyxdir", relpath);
- else if (!lyxrc.save_origin)
+ else if (!save_transient_properties || !lyxrc.save_origin)
filepath = "unavailable";
os << "\\origin " << quoteIfNeeded(filepath) << '\n';
}
}
- os << "\\tracking_changes " << convert<string>(track_changes) << '\n'
- << "\\html_math_output " << html_math_output << '\n'
+ os << "\\tracking_changes "
+ << (save_transient_properties ? convert<string>(track_changes) : "false")
+ << '\n';
+
+ os << "\\output_changes "
+ << (save_transient_properties ? convert<string>(output_changes) : "false")
+ << '\n';
+
+ os << "\\html_math_output " << html_math_output << '\n'
<< "\\html_css_as_file " << html_css_as_file << '\n'
- // \output_changes is output at a distance from \tracking changes as a
- // workaround to bug #9841: both parameters can be seen as per-user
- // preferences and therefore can cause undesirable merge conflicts, in a
- // multi-author setting, if it were treated as a single block by the
- // version control system.
- << "\\output_changes " << convert<string>(output_changes) << '\n'
<< "\\html_be_strict " << convert<string>(html_be_strict) << '\n';
if (html_math_img_scale != 1.0)
}
// some languages are only available via polyglossia
- if ((features.runparams().flavor == OutputParams::XETEX
- || features.runparams().flavor == OutputParams::LUATEX)
- && (features.hasPolyglossiaExclusiveLanguages()
- || useNonTeXFonts))
- features.require("polyglossia");
+ if (features.hasPolyglossiaExclusiveLanguages())
+ features.require("polyglossia");
if (useNonTeXFonts && fontsMath() != "auto")
features.require("unicode-math");
os << from_ascii(ams);
if (useNonTeXFonts) {
- os << "\\usepackage{fontspec}\n";
+ if (!features.isProvided("fontspec"))
+ os << "\\usepackage{fontspec}\n";
if (features.mustProvide("unicode-math")
&& features.isAvailable("unicode-math"))
os << "\\usepackage{unicode-math}\n";
// koma's own caption commands are used instead of caption. We
// use \PassOptionsToPackage here because the user could have
// already loaded subfig in the preamble.
- if (features.isRequired("subfig")) {
+ if (features.mustProvide("subfig")) {
atlyxpreamble += "\\@ifundefined{showcaptionsetup}{}{%\n"
" \\PassOptionsToPackage{caption=false}{subfig}}\n"
"\\usepackage{subfig}\n";
}
if (features.isRequired("bicaption"))
lyxpreamble += "\\usepackage{bicaption}\n";
- if (!listings_params.empty() || features.isRequired("listings"))
+ if (!listings_params.empty() || features.mustProvide("listings"))
lyxpreamble += "\\usepackage{listings}\n";
if (!listings_params.empty()) {
lyxpreamble += "\\lstset{";