#include "bufferparams.h"
#include "layout.h"
#include "support/filetools.h"
+#include "support/lstrings.h"
#include "FloatList.h"
#include "language.h"
varioref = false;
prettyref = false;
chess = false;
+ natbib = false;
+ floats = false;
// commands
lyx = false;
boldsymbol = false;
// special features
- LyXParagraphIndent = false;
+ ParagraphIndent = false;
NeedLyXFootnoteCode = false;
NeedLyXMinipageIndent = false;
}
boldsymbol = true;
} else if (name == "binom") {
binom = true;
+ } else if (name == "natbib") {
+ natbib = true;
+ } else if (name == "float") {
+ floats = true;
}
}
packages << "\\usepackage{prettyref}\n";
// float.sty
- // We only need float.sty if we use non builtin floats. This includes
- // modified table and figure floats. (Lgb)
+ // We only need float.sty if we use non builtin floats, or if we
+ // use the "H" modifier. This includes modified table and
+ // figure floats. (Lgb)
if (!usedFloats.empty()) {
- bool use_float = false;
UsedFloats::const_iterator beg = usedFloats.begin();
UsedFloats::const_iterator end = usedFloats.end();
for (; beg != end; ++beg) {
Floating const & fl = floatList.getType((*beg));
if (!fl.type().empty() && !fl.builtin()) {
- use_float = true;
+ const_cast<LaTeXFeatures *>(this)->floats = true;
break;
}
}
- if (use_float)
- packages << "\\usepackage{float}\n";
+ }
+ if (floats) {
+ packages << "\\usepackage{float}\n";
+ }
+
+ // natbib.sty
+ if (natbib) {
+ packages << "\\usepackage[";
+ if (params.use_numerical_citations) {
+ packages << "numbers";
+ } else {
+ packages << "authoryear";
+ }
+ packages << "]{natbib}\n";
}
packages << externalPreambles;
// other
if (NeedLyXMinipageIndent)
macros << minipageindent_def;
- if (LyXParagraphIndent)
+ if (ParagraphIndent)
macros << paragraphindent_def;
if (NeedLyXFootnoteCode)
macros << floatingfootnote_def;
}
-void LaTeXFeatures::getFloatDefinitions(ostream & os) const
+void LaTeXFeatures::getFloatDefinitions(std::ostream & os) const
{
// Here we will output the code to create the needed float styles.
// We will try to do this as minimal as possible.