Babel makes the character ':' active in french documents, and the listings
package cannot cope with that if it is loaded before babel. If it is loaded
after babel it works. This makes the french EmbeddedObjects manual compilable.
if (pdfoptions().colorlinks)
features.require("color");
}
if (pdfoptions().colorlinks)
features.require("color");
}
+ if (!listings_params.empty()) {
+ // do not test validity because listings_params is
+ // supposed to be valid
+ string par =
+ InsetListingsParams(listings_params).separatedParams(true);
+ // we can't support all packages, but we should load the color package
+ if (par.find("\\color", 0) != string::npos)
+ features.require("color");
+ }
// some languages are only available via polyglossia
if (features.runparams().flavor == OutputParams::XETEX
// some languages are only available via polyglossia
if (features.runparams().flavor == OutputParams::XETEX
- if (!listings_params.empty() || features.isRequired("listings"))
- os << "\\usepackage{listings}\n";
-
- if (!listings_params.empty()) {
- os << "\\lstset{";
- // do not test validity because listings_params is
- // supposed to be valid
- string par =
- InsetListingsParams(listings_params).separatedParams(true);
- // we can't support all packages, but we should load the color package
- if (par.find("\\color", 0) != string::npos)
- features.require("color");
- os << from_utf8(par)
- << "}\n";
- }
if (!features.isProvided("geometry")
&& (use_geometry || nonstandard_papersize)) {
odocstringstream ods;
if (!features.isProvided("geometry")
&& (use_geometry || nonstandard_papersize)) {
odocstringstream ods;
+ atlyxpreamble + "\\makeatother\n\n";
// We try to load babel late, in case it interferes with other packages.
+ atlyxpreamble + "\\makeatother\n\n";
// We try to load babel late, in case it interferes with other packages.
- // Jurabib, hyperref and varioref have to be called after babel, though.
+ // Jurabib, hyperref, varioref and listings (bug 8995) have to be
+ // called after babel, though.
if (use_babel && !features.isRequired("jurabib")
&& !features.isRequired("hyperref")
&& !features.isRequired("varioref")
if (use_babel && !features.isRequired("jurabib")
&& !features.isRequired("hyperref")
&& !features.isRequired("varioref")
features.needBabelLangOptions())) + '\n';
lyxpreamble += from_utf8(features.getBabelPostsettings());
}
features.needBabelLangOptions())) + '\n';
lyxpreamble += from_utf8(features.getBabelPostsettings());
}
+ if (!listings_params.empty() || features.isRequired("listings"))
+ lyxpreamble += "\\usepackage{listings}\n";
+ if (!listings_params.empty()) {
+ lyxpreamble += "\\lstset{";
+ // do not test validity because listings_params is
+ // supposed to be valid
+ string par =
+ InsetListingsParams(listings_params).separatedParams(true);
+ lyxpreamble += from_utf8(par);
+ lyxpreamble += "}\n";
+ }
// xunicode needs to be loaded at least after amsmath, amssymb,
// esint and the other packages that provide special glyphs
// xunicode needs to be loaded at least after amsmath, amssymb,
// esint and the other packages that provide special glyphs