#include "Floating.h"
#include "FloatList.h"
#include "Language.h"
+#include "Layout.h"
#include "Lexer.h"
#include "LyXRC.h"
#include "support/docstream.h"
#include "support/filetools.h"
-#include "frontends/controllers/frontend_helpers.h"
-
-namespace lyx {
-
-using support::isSGMLFilename;
-using support::libFileSearch;
-using support::makeRelPath;
-using support::onlyPath;
-
using std::endl;
using std::find;
using std::string;
using std::ostringstream;
using std::set;
+
+namespace lyx {
+
+using support::isSGMLFilename;
+using support::libFileSearch;
+using support::makeRelPath;
+using support::onlyPath;
+
/////////////////////////////////////////////////////////////////////
//
// Strings
}
-void LaTeXFeatures::useLayout(string const & layoutname)
+void LaTeXFeatures::useLayout(docstring const & layoutname)
{
// Some code to avoid loops in dependency definition
static int level = 0;
if (level > maxlevel) {
lyxerr << "LaTeXFeatures::useLayout: maximum level of "
<< "recursion attained by layout "
- << layoutname << endl;
+ << to_utf8(layoutname) << endl;
return;
}
TextClass const & tclass = params_.getTextClass();
if (tclass.hasLayout(layoutname)) {
// Is this layout already in usedLayouts?
- list<string>::const_iterator cit = usedLayouts_.begin();
- list<string>::const_iterator end = usedLayouts_.end();
+ list<docstring>::const_iterator cit = usedLayouts_.begin();
+ list<docstring>::const_iterator end = usedLayouts_.end();
for (; cit != end; ++cit) {
if (layoutname == *cit)
return;
}
- Layout_ptr const & lyt = tclass[layoutname];
+ LayoutPtr const & lyt = tclass[layoutname];
if (!lyt->depends_on().empty()) {
++level;
useLayout(lyt->depends_on());
usedLayouts_.push_back(layoutname);
} else {
lyxerr << "LaTeXFeatures::useLayout: layout `"
- << layoutname << "' does not exist in this class"
+ << to_utf8(layoutname) << "' does not exist in this class"
<< endl;
}
"latexsym",
"pifont",
"subfigure",
- "floatflt",
"varioref",
"prettyref",
+ /*For a successful cooperation of the `wrapfig' package with the
+ `float' package you should load the `wrapfig' package *after*
+ the `float' package. See the caption package documentation
+ for explanation.*/
"float",
+ "wrapfig",
"booktabs",
"dvipost",
"fancybox",
"calc",
- "nicefrac",
+ "units",
"tipa",
"framed",
"pdfcolmk",
"txfonts",
"mathrsfs",
"ascii",
+ "url",
};
int const nb_simplefeatures = sizeof(simplefeatures) / sizeof(char const *);
params_.use_esint != BufferParams::package_off)
packages << "\\usepackage{esint}\n";
- // url.sty
- if (mustProvide("url"))
- packages << "\\IfFileExists{url.sty}{\\usepackage{url}}\n"
- " {\\newcommand{\\url}{\\texttt}}\n";
-
// natbib.sty
if (mustProvide("natbib")) {
packages << "\\usepackage[";
tcpreamble << tclass.preamble();
- list<string>::const_iterator cit = usedLayouts_.begin();
- list<string>::const_iterator end = usedLayouts_.end();
+ list<docstring>::const_iterator cit = usedLayouts_.begin();
+ list<docstring>::const_iterator end = usedLayouts_.end();
for (; cit != end; ++cit) {
tcpreamble << tclass[*cit]->preamble();
}
- CharStyles::iterator cs = tclass.charstyles().begin();
- CharStyles::iterator csend = tclass.charstyles().end();
- for (; cs != csend; ++cs) {
- if (isRequired(cs->name))
- tcpreamble << cs->preamble;
+ InsetLayouts const & insetlayouts = tclass.insetlayouts();
+ InsetLayouts::const_iterator cit2 = insetlayouts.begin();
+ InsetLayouts::const_iterator end2 = insetlayouts.end();
+ for (; cit2 != end2; ++cit2) {
+ if (isRequired(to_utf8(cit2->first))) {
+ tcpreamble << from_utf8(cit2->second.preamble);
+ }
}
return tcpreamble.str();