static char const * const tex_graphics[] = {
- "default", "dvips", "dvitops", "emtex",
- "ln", "oztex", "textures", "none", ""
+ "default", "dvialw", "dvilaser", "dvipdf", "dvipdfm", "dvipdfmx",
+ "dvips", "dvipsone", "dvitops", "dviwin", "dviwindo", "dvi2ps", "emtex",
+ "ln", "oztex", "pctexhp", "pctexps", "pctexwin", "pctex32", "pdftex",
+ "psprint", "pubps", "tcidvi", "textures", "truetex", "vtex", "xdvi",
+ "xetex", "none", ""
};
BranchList::const_iterator it = branchlist().begin();
BranchList::const_iterator end = branchlist().end();
for (; it != end; ++it) {
- os << "\\branch " << to_utf8(it->getBranch())
- << "\n\\selected " << it->getSelected()
- << "\n\\color " << lyx::X11hexname(it->getColor())
+ os << "\\branch " << to_utf8(it->branch())
+ << "\n\\selected " << it->isSelected()
+ << "\n\\color " << lyx::X11hexname(it->color())
<< "\n\\end_branch"
<< "\n";
}
}
}
- if (pdfoptions().use_hyperref)
+ if (pdfoptions().use_hyperref) {
features.require("hyperref");
+ // due to interferences with babel and hyperref, the color package has to
+ // be loaded after hyperref when hyperref is used with the colorlinks
+ // option, see http://bugzilla.lyx.org/show_bug.cgi?id=5291
+ if (pdfoptions().colorlinks)
+ features.require("color");
+ }
if (language->lang() == "vietnamese")
features.require("vietnamese");
// handle inputenc etc.
writeEncodingPreamble(os, features, texrow);
- if (!listings_params.empty()) {
+ if (!listings_params.empty() || features.isRequired("listings")) {
os << "\\usepackage{listings}\n";
texrow.newline();
+ }
+ 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);
- os << from_ascii(par);
+ // 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);
// count the number of newlines
for (size_t i = 0; i < par.size(); ++i)
if (par[i] == '\n')
texrow.newline();
}
- // If we use hyperref, jurabib, japanese, or vietnamese, we have to call babel here.
+ // Now insert the LyX specific LaTeX commands...
+ docstring lyxpreamble;
+
+ // due to interferences with babel and hyperref, the color package has to
+ // be loaded (when it is not already loaded) before babel when hyperref
+ // is used with the colorlinks option, see
+ // http://bugzilla.lyx.org/show_bug.cgi?id=5291
+ // we decided therefore to load color always before babel, see
+ // http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg144349.html
+ lyxpreamble += from_ascii(features.getColorOptions());
+
+ // If we use hyperref, jurabib, japanese, or vietnamese, we have to call babel before them.
if (use_babel
&& (features.isRequired("jurabib")
|| features.isRequired("hyperref")
|| features.isRequired("vietnamese")
|| features.isRequired("japanese") ) ) {
- // FIXME UNICODE
- os << from_utf8(babelCall(language_options.str()))
- << '\n'
- << from_utf8(features.getBabelOptions());
- texrow.newline();
+ // FIXME UNICODE
+ lyxpreamble += from_utf8(babelCall(language_options.str())) + '\n';
+ lyxpreamble += from_utf8(features.getBabelOptions()) + '\n';
}
- // Now insert the LyX specific LaTeX commands...
-
// The optional packages;
- docstring lyxpreamble(from_ascii(features.getPackages()));
+ lyxpreamble += from_ascii(features.getPackages());
// Line spacing
lyxpreamble += from_utf8(spacing().writePreamble(tclass.provides("SetSpace")));
pdfoptions().writeLaTeX(oss, documentClass().provides("hyperref"));
lyxpreamble += oss.str();
}
-
+
// Will be surrounded by \makeatletter and \makeatother when needed
docstring atlyxpreamble;
else
lyxpreamble += '\n' + atlyxpreamble;
- // We try to load babel late, in case it interferes
- // with other packages.
+ // We try to load babel late, in case it interferes with other packages.
// Jurabib and Hyperref have to be called after babel, though.
if (use_babel && !features.isRequired("jurabib")
&& !features.isRequired("hyperref")