diff --git a/src/ChangeLog b/src/ChangeLog index ea75c3ad25..2c31bbfd44 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2002-05-10 Dekel Tsur + + * buffer.C (makeLaTeXFile): Put language options after loading babel. + + * LaTeXFeatures.C (getBabelOptions): New method. + 2002-05-08 Lars Gullik Bjønnes * BufferView_pimpl.C (Dispatch): work around missing argument for diff --git a/src/LaTeXFeatures.C b/src/LaTeXFeatures.C index 8af355106c..40365029b5 100644 --- a/src/LaTeXFeatures.C +++ b/src/LaTeXFeatures.C @@ -311,14 +311,22 @@ string const LaTeXFeatures::getMacros() const // floats getFloatDefinitions(macros); + return macros.str().c_str(); +} + + +string const LaTeXFeatures::getBabelOptions() const +{ + ostringstream tmp; + for (LanguageList::const_iterator cit = UsedLanguages.begin(); cit != UsedLanguages.end(); ++cit) if (!(*cit)->latex_options().empty()) - macros << (*cit)->latex_options() << '\n'; + tmp << (*cit)->latex_options() << '\n'; if (!params.language->latex_options().empty()) - macros << params.language->latex_options() << '\n'; + tmp << params.language->latex_options() << '\n'; - return macros.str().c_str(); + return tmp.str().c_str(); } diff --git a/src/LaTeXFeatures.h b/src/LaTeXFeatures.h index 92279ebfc0..616e3702a8 100644 --- a/src/LaTeXFeatures.h +++ b/src/LaTeXFeatures.h @@ -50,6 +50,8 @@ public: string const getPackages() const; /// The macros definitions needed by the document string const getMacros() const; + /// + string const getBabelOptions() const; /// The definitions needed by the document's textclass string const getTClassPreamble() const; /// The sgml definitions needed by the document (dobook/linuxdoc) diff --git a/src/buffer.C b/src/buffer.C index 882f9ffc9c..059b768223 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -2446,8 +2446,6 @@ void Buffer::makeLaTeXFile(string const & fname, + params.preamble + '\n'; } - preamble += "\\makeatother\n"; - // Itemize bullet settings need to be last in case the user // defines their own bullets that use a package included // in the user-defined preamble -- ARRae @@ -2489,8 +2487,6 @@ void Buffer::makeLaTeXFile(string const & fname, texrow.newline(); } - ofs << preamble; - // We try to load babel late, in case it interferes // with other packages. if (use_babel) { @@ -2500,10 +2496,14 @@ void Buffer::makeLaTeXFile(string const & fname, tmp = string("\\usepackage[") + language_options.str().c_str() + "]{babel}"; - ofs << tmp << "\n"; - texrow.newline(); + preamble += tmp + "\n"; + preamble += features.getBabelOptions(); } + preamble += "\\makeatother\n"; + + ofs << preamble; + // make the body. ofs << "\\begin{document}\n"; texrow.newline();