-/* This file is part of
- * ======================================================
+/**
+ * \file LaTeXFeatures.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
*
- * LyX, The Document Processor
+ * \author José Matos
+ * \author Lars Gullik Bjønnes
+ * \author Jean-Marc Lasgouttes
+ * \author Jürgen Vigna
+ * \author André Pönitz
*
- * Copyright 1995 Matthias Ettrich
- * Copyright 1995-2001 the LyX Team.
- *
- * ====================================================== */
+ * Full author contact details are available in file CREDITS.
+ */
#include <config.h>
#include "LaTeXFeatures.h"
#include "debug.h"
#include "lyx_sty.h"
-#include "lyxrc.h"
#include "bufferparams.h"
+#include "Floating.h"
#include "FloatList.h"
#include "language.h"
#include "encoding.h"
-#include "LString.h"
-#include "Lsstream.h"
+#include "support/std_sstream.h"
#include "support/filetools.h"
-#include "support/lstrings.h"
using namespace lyx::support;
}
-void LaTeXFeatures::addExternalPreamble(string const & pream)
+void LaTeXFeatures::addExternalPreamble(string const & preamble)
{
- externalPreambles += pream;
+ FeaturesList::const_iterator begin = preamble_snippets.begin();
+ FeaturesList::const_iterator end = preamble_snippets.end();
+ if (find(begin, end, preamble) == end)
+ preamble_snippets.push_back(preamble);
}
packages << "]{natbib}\n";
}
- packages << externalPreambles;
-
return STRCONV(packages.str());
}
{
ostringstream macros;
+ if (!preamble_snippets.empty())
+ macros << '\n';
+ FeaturesList::const_iterator pit = preamble_snippets.begin();
+ FeaturesList::const_iterator pend = preamble_snippets.end();
+ for (; pit != pend; ++pit) {
+ macros << *pit << '\n';
+ }
+
if (isRequired("LyX"))
macros << lyx_def << '\n';