#include "support/filetools.h"
-#include "support/std_sstream.h"
+#include <sstream>
using lyx::support::IsSGMLFilename;
using lyx::support::MakeRelPath;
using std::ostringstream;
using std::set;
+namespace biblio = lyx::biblio;
-LaTeXFeatures::LaTeXFeatures(Buffer const & b, BufferParams const & p)
- : buffer_(b), params_(p)
+
+LaTeXFeatures::LaTeXFeatures(Buffer const & b, BufferParams const & p, bool n)
+ : buffer_(&b), params_(p), nice_(n)
{}
"wasy",
"dvipost",
"fancybox",
- "calc"
+ "calc",
};
int const nb_simplefeatures = sizeof(simplefeatures) / sizeof(char const *);
// natbib.sty
if (isRequired("natbib") && ! tclass.provides(LyXTextClass::natbib)) {
packages << "\\usepackage[";
- if (params_.use_numerical_citations) {
+ if (params_.cite_engine == biblio::ENGINE_NATBIB_NUMERICAL) {
packages << "numbers";
} else {
packages << "authoryear";
packages << "]{natbib}\n";
}
+ // jurabib -- we need version 0.6 at least.
+ if (isRequired("jurabib")) {
+ packages << "\\usepackage{jurabib}[2004/01/25]\n";
+ }
+
+ // bibtopic -- the dot provides the aux file naming which
+ // LyX can detect.
+ if (isRequired("bibtopic")) {
+ packages << "\\usepackage[dot]{bibtopic}\n";
+ }
+
return packages.str();
}
macros << mathcircumflex_def << '\n';
// other
- if (isRequired("NeedLyXMinipageIndent"))
- macros << minipageindent_def;
if (isRequired("ParagraphLeftIndent"))
macros << paragraphleftindent_def;
if (isRequired("NeedLyXFootnoteCode"))
if (isRequired("lyxgreyedout"))
macros << lyxgreyedout_def;
+ if (isRequired("lyxdot"))
+ macros << lyxdot_def << '\n';
+
// floats
getFloatDefinitions(macros);
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;
+ }
+
return tcpreamble.str();
}
Buffer const & LaTeXFeatures::buffer() const
{
- return buffer_;
+ return *buffer_;
+}
+
+
+void LaTeXFeatures::setBuffer(Buffer const & buffer)
+{
+ buffer_ = &buffer;
}