]> git.lyx.org Git - features.git/commitdiff
Purely mechanical: move fragile into LatexRunParams.
authorAngus Leeming <leeming@lyx.org>
Thu, 22 May 2003 22:44:30 +0000 (22:44 +0000)
committerAngus Leeming <leeming@lyx.org>
Thu, 22 May 2003 22:44:30 +0000 (22:44 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7016 a592a061-630c-0410-9148-cb99ea01b6c8

85 files changed:
src/ChangeLog
src/buffer.C
src/bufferparams.C
src/bufferparams.h
src/graphics/ChangeLog
src/graphics/PreviewLoader.C
src/insets/ChangeLog
src/insets/inset.h
src/insets/insetbibtex.C
src/insets/insetbibtex.h
src/insets/insetcaption.C
src/insets/insetcaption.h
src/insets/insetcite.C
src/insets/insetcite.h
src/insets/insetcollapsable.C
src/insets/insetcollapsable.h
src/insets/insetcommand.C
src/insets/insetcommand.h
src/insets/insetenv.C
src/insets/insetenv.h
src/insets/inseterror.h
src/insets/insetert.C
src/insets/insetert.h
src/insets/insetexternal.C
src/insets/insetexternal.h
src/insets/insetfloat.C
src/insets/insetfloat.h
src/insets/insetfloatlist.C
src/insets/insetfloatlist.h
src/insets/insetfoot.C
src/insets/insetfoot.h
src/insets/insetgraphics.C
src/insets/insetgraphics.h
src/insets/insethfill.C
src/insets/insethfill.h
src/insets/insetinclude.C
src/insets/insetinclude.h
src/insets/insetlabel.C
src/insets/insetlabel.h
src/insets/insetlatexaccent.C
src/insets/insetlatexaccent.h
src/insets/insetlist.C
src/insets/insetlist.h
src/insets/insetmarginal.C
src/insets/insetmarginal.h
src/insets/insetminipage.C
src/insets/insetminipage.h
src/insets/insetnewline.C
src/insets/insetnewline.h
src/insets/insetnote.h
src/insets/insetoptarg.C
src/insets/insetoptarg.h
src/insets/insetparent.C
src/insets/insetparent.h
src/insets/insetquotes.C
src/insets/insetquotes.h
src/insets/insetref.C
src/insets/insetref.h
src/insets/insetspace.C
src/insets/insetspace.h
src/insets/insetspecialchar.C
src/insets/insetspecialchar.h
src/insets/insettabular.C
src/insets/insettabular.h
src/insets/insettext.C
src/insets/insettext.h
src/insets/insettheorem.C
src/insets/insettheorem.h
src/insets/inseturl.C
src/insets/inseturl.h
src/insets/insetwrap.C
src/insets/insetwrap.h
src/latexrunparams.h
src/mathed/ChangeLog
src/mathed/formula.C
src/mathed/formula.h
src/mathed/formulamacro.C
src/mathed/formulamacro.h
src/paragraph.C
src/paragraph_funcs.C
src/paragraph_funcs.h
src/paragraph_pimpl.C
src/paragraph_pimpl.h
src/tabular.C
src/tabular.h

index 1af9be28677820c94bfc1e5b47fe2f2496ff426c..b6a2ac92c8d4112cfd65bdc3b4d48a1ed4dbba97 100644 (file)
@@ -1,3 +1,23 @@
+2003-05-22  Angus Leeming  <leeming@lyx.org>
+
+       * latexrunparams.h: add fragile and use_babel variables.
+
+       * bufferparams.[Ch] (writeLaTeX): return use_babel.
+       * buffer.C (makeLaTeXFile): store this returned value in
+       runparams.use_babel, thus passing it to the inset::latex methods.
+
+       * paragraph.C (simpleTeXOnePar): no need to pass 'moving_arg' to
+       simpleTeXSpecialChars as it is now stored in runparams.fragile.
+
+       * paragraph_funcs.[Ch] (TeXOnePar, latexParagraphs): TeXOnePar no
+       longer has a fragile arg, as it is stored in runparams.fragile.
+
+       * paragraph_pimpl.[Ch] (simpleTeXSpecialChars): no longer has a
+       moving_arg parameter as the data is stored in runparams.fragile.
+
+       * tabular.[Ch] (TeXLongtableHeaderFooter, TeXRow): no longer have
+       a fragile parameter as the data is stored in runparams.fragile.
+
 2003-05-22  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
        * paragraph.C (Paragraph): initialize next_par_ and prev_par_
index 00ec0e569b7524ea73a346aee574d564297fd29f..074487376a3715e265a069f5eaced4c847476521 100644 (file)
@@ -1030,7 +1030,7 @@ void Buffer::makeLaTeXFile(ostream & os,
                }
 
                // Write the preamble
-               params.writeLaTeX(os, features, texrow);
+               runparams.use_babel = params.writeLaTeX(os, features, texrow);
 
                if (only_preamble)
                        return;
index 4e5d89f43bd3d4aef0a4b363f0d5900cb4741853..f4bfd76fef46979b6637b4e1db9f427cdb165dcc 100644 (file)
@@ -459,7 +459,7 @@ void BufferParams::writeFile(ostream & os) const
 }
 
 
-void BufferParams::writeLaTeX(ostream & os, LaTeXFeatures & features,
+bool BufferParams::writeLaTeX(ostream & os, LaTeXFeatures & features,
                              TexRow & texrow) const
 {
        os << "\\documentclass";
@@ -846,6 +846,7 @@ void BufferParams::writeLaTeX(ostream & os, LaTeXFeatures & features,
        }
 
        os << lyxpreamble;
+       return use_babel;
 }
 
 void BufferParams::setPaperStuff()
index cc81d5f8164a78655763d295efee694c0fe365eb..02e49186d48ad0a2a2dfa465d300884afe1b4421 100644 (file)
@@ -116,8 +116,11 @@ public:
        ///
        void writeFile(std::ostream &) const;
 
-       ///
-       void writeLaTeX(std::ostream &, LaTeXFeatures &, TexRow &) const;
+       /** \returns true if the babel package is used (interogates
+           the BufferParams and a LyXRC variable).
+           This returned value can then be passed to the insets...
+        */
+       bool writeLaTeX(std::ostream &, LaTeXFeatures &, TexRow &) const;
 
        ///
        void setPaperStuff();
index 85b4c670adf7ad99272fdff943f73ef8d3b65f8f..16e88ec2ffd6c7b8df10d95227a119c2feb84dd6 100644 (file)
@@ -1,3 +1,8 @@
+2003-05-22  Angus Leeming  <leeming@lyx.org>
+
+       * PreviewLoader.C (dumpPreamble): no longer pass a fragile arg to
+       the inset::latex method.
+
 2003-05-22  Angus Leeming  <leeming@lyx.org>
 
        * PreviewLoader.C (dumpPreamble): the 'nice' param passed to
index 9b90e0aff774dfdd6b62169926efb9232da4bf77..9db9fdfd6b7ddb5a9114a4c08f1cc8f8decb6f33 100644 (file)
@@ -567,6 +567,7 @@ void PreviewLoader::Impl::dumpPreamble(ostream & os) const
        LatexRunParams runparams;
        runparams.flavor = LatexRunParams::LATEX;
        runparams.nice = true;
+       runparams.fragile = true;
        tmp.makeLaTeXFile(os, buffer_.filePath(), runparams, false, true);
 
        // FIXME! This is a HACK! The proper fix is to control the 'true'
@@ -588,7 +589,7 @@ void PreviewLoader::Impl::dumpPreamble(ostream & os) const
 
        for (; it != end; ++it)
                if (it->lyxCode() == Inset::MATHMACRO_CODE)
-                       it->latex(&buffer_, os, runparams, true, true);
+                       it->latex(&buffer_, os, runparams, true);
 
        // All equation lables appear as "(#)" + preview.sty's rendering of
        // the label name
index 162b2f64f946ee5a0282bb3f4cdc2c02cd2dfb61..55c9e991bb7c69bc97db002260a43162f58b128b 100644 (file)
@@ -1,3 +1,11 @@
+2003-05-22  Angus Leeming  <leeming@lyx.org>
+
+       * inset*.[Ch] (latex): no longer has a fragile arg. Data is now passed
+       through the LatexRunParams arg.
+
+       * insetquotes.C (latex): accesses use_babel through the LatexRunParams
+       arg rather than through a global var.
+
 2003-05-22  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
        * insetspecialchar.C (dimension): use a string.
index 7be16485230ecff91a237bb672271eae084c638b..5119b1fa291a3cf72c0da150e8e5f1b34ad4e823 100644 (file)
@@ -189,14 +189,11 @@ public:
        ///
        virtual void read(Buffer const *, LyXLex & lex) = 0;
        /** returns the number of rows (\n's) of generated tex code.
-           fragile == true means, that the inset should take care about
-           fragile commands by adding a \protect before.
            If the free_spc (freespacing) variable is set, then this inset
            is in a free-spacing paragraph.
        */
        virtual int latex(Buffer const *, std::ostream &,
                          LatexRunParams const &,
-                         bool fragile,
                          bool free_spc) const = 0;
        ///
        virtual int ascii(Buffer const *,
index 3d2531f3452791a7cdb347ed3efd5502a27e9daa..0cbb94b61ba2e46085a4c4ae69b71a32ab026772 100644 (file)
@@ -85,7 +85,7 @@ string const InsetBibtex::getScreenLabel(Buffer const *) const
 
 int InsetBibtex::latex(Buffer const * buffer, ostream & os,
                       LatexRunParams const & runparams,
-                      bool /*fragile*/, bool/*fs*/) const
+                      bool/*fs*/) const
 {
        // changing the sequence of the commands
        // 1. \bibliographystyle{style}
index df35d7901b3a8268403f823a4c06b25a4ed43cfe..47656595903cb44d954d29d1e84e8a74f9ba05a9 100644 (file)
@@ -40,7 +40,7 @@ public:
        Inset::Code lyxCode() const { return Inset::BIBTEX_CODE; }
        ///
        int latex(Buffer const *, std::ostream &, LatexRunParams const &,
-                 bool fragile, bool freespace) const;
+                 bool freespace) const;
        ///
        void fillWithBibKeys(Buffer const *,
                std::vector<std::pair<string,string> > &) const;
index 19f2b20a12a9816d6d87be33f8a0f516566af2f5..f63bbe50837167e9ffbb7e320b17dd015ef019ac 100644 (file)
@@ -105,8 +105,9 @@ void InsetCaption::draw(BufferView * bv, LyXFont const & f,
 }
 
 
-int InsetCaption::latex(Buffer const * buf, ostream & os, LatexRunParams const & runparams,
-                       bool fragile, bool free_spc) const
+int InsetCaption::latex(Buffer const * buf, ostream & os,
+                       LatexRunParams const & runparams,
+                       bool free_spc) const
 {
        // This is a bit too simplistic to take advantage of
        // caption options we must add more later. (Lgb)
@@ -114,7 +115,7 @@ int InsetCaption::latex(Buffer const * buf, ostream & os, LatexRunParams const &
        // \caption{...}, later we will make it take advantage
        // of the one of the caption packages. (Lgb)
        ostringstream ost;
-       int const l = InsetText::latex(buf, ost, runparams, fragile, free_spc);
+       int const l = InsetText::latex(buf, ost, runparams, free_spc);
        os << "\\caption{" << ost.str() << "}\n";
        return l + 1;
 }
index d9ed40a04ff4e6edc8064427197e7e5f4a05e226..ec18a641793e5043d9112cdc1749c51cc634058d 100644 (file)
@@ -37,8 +37,9 @@ public:
        virtual void draw(BufferView * bv, LyXFont const & f,
                          int baseline, float & x) const;
        ///
-       virtual int latex(Buffer const * buf, std::ostream & os, LatexRunParams const &,
-                         bool fragile, bool free_spc) const;
+       virtual int latex(Buffer const * buf, std::ostream & os,
+                         LatexRunParams const &,
+                         bool free_spc) const;
        ///
        int ascii(Buffer const * buf, std::ostream & os, int linelen) const;
        ///
index d240a1d56e29ad3e63162320230278c2d2e9d713..b789b5b64c560071532b5f087f5496552997e7b5 100644 (file)
@@ -353,8 +353,9 @@ int InsetCitation::ascii(Buffer const * buffer, ostream & os, int) const
 // the \cite command is valid. Eg, the user has natbib enabled, inputs some
 // citations and then changes his mind, turning natbib support off. The output
 // should revert to \cite[]{}
-int InsetCitation::latex(Buffer const * buffer, ostream & os, LatexRunParams const &,
-                       bool /*fragile*/, bool/*fs*/) const
+int InsetCitation::latex(Buffer const * buffer, ostream & os,
+                        LatexRunParams const &,
+                        bool/*fs*/) const
 {
        os << "\\";
        if (buffer->params.use_natbib)
index 1b8d575a2d4fe6455a0681624f5fb13b929680bb..a4eb1ef96931c7daa9ff188b611cb0b8c17d56a6 100644 (file)
@@ -37,7 +37,8 @@ public:
        ///
        int ascii(Buffer const *, std::ostream &, int linelen) const;
        ///
-       int latex(Buffer const *, std::ostream &, LatexRunParams const &, bool, bool) const;
+       int latex(Buffer const *, std::ostream &, LatexRunParams const &,
+                 bool) const;
        ///
        dispatch_result localDispatch(FuncRequest const & cmd);
        ///
index fe248ec92af94f5188bdb610771cd68fec5220c0..b59ab6d7f8763e7d07d3366c78f1ca743319b2ff 100644 (file)
@@ -273,9 +273,9 @@ void InsetCollapsable::lfunMouseRelease(FuncRequest const & cmd)
 
 int InsetCollapsable::latex(Buffer const * buf, ostream & os,
                            LatexRunParams const & runparams,
-                           bool fragile, bool free_spc) const
+                           bool free_spc) const
 {
-       return inset.latex(buf, os, runparams, fragile, free_spc);
+       return inset.latex(buf, os, runparams, free_spc);
 }
 
 
index 67c0beb12858bf80b173a908b865c7ccc9ae8870..9c26829fa4d181d29c745a22eb99f94eb7168c24 100644 (file)
@@ -80,7 +80,7 @@ public:
        RESULT localDispatch(FuncRequest const &);
        ///
        int latex(Buffer const *, std::ostream &, LatexRunParams const &,
-                 bool fragile, bool free_spc) const;
+                 bool free_spc) const;
        ///
        int ascii(Buffer const *, std::ostream &, int) const;
        ///
index 37d321b6206be8479f7b0d2e12db65d1243560e9..ee32fa3a76b892699bb45487bf72628c8d270649 100644 (file)
@@ -40,7 +40,7 @@ void InsetCommand::setParams(InsetCommandParams const & p)
 
 
 int InsetCommand::latex(Buffer const *, ostream & os, LatexRunParams const &,
-                       bool /*fragile*/, bool/*fs*/) const
+                       bool/*fs*/) const
 {
        os << getCommand();
        return 0;
index 6949c51a762c06ee1ec8dce4b9dddcd3ee06e3e8..8ee4be0ea6d38ae768afe4912803285c0e337721 100644 (file)
@@ -41,8 +41,9 @@ public:
        /// Can remove one InsetBibKey is modified
        void scanCommand(string const & c) { p_.scanCommand(c); };
        ///
-       virtual int latex(Buffer const *, std::ostream &, LatexRunParams const &,
-                         bool fragile, bool free_spc) const;
+       virtual int latex(Buffer const *, std::ostream &,
+                         LatexRunParams const &,
+                         bool free_spc) const;
        ///
        int ascii(Buffer const *, std::ostream &, int linelen) const;
        ///
index 8e6bc5900197453d317de6a784b61f40e53cc33f..1fc442dbe952c81807e732c6f011848d99d9ba32 100644 (file)
@@ -67,12 +67,12 @@ string const InsetEnvironment::editMessage() const
 
 int InsetEnvironment::latex(Buffer const * buf, ostream & os,
                            LatexRunParams const & runparams,
-                           bool fragile, bool) const
+                           bool) const
 {
        os << layout_->latexheader;
        TexRow texrow;
-       latexParagraphs(buf, paragraphs, os, texrow, runparams, fragile,
-               layout_->latexparagraph);
+       latexParagraphs(buf, paragraphs, os, texrow, runparams,
+                       layout_->latexparagraph);
        os << layout_->latexfooter;
        return texrow.rows();
 }
index cceb75c9d14644f7673b89e7b3d8d4d1587b4a12..2a8cd40e4cd6d0b0e031d76687a78174aaf49ac1 100644 (file)
@@ -31,7 +31,7 @@ public:
        Inset::Code lyxCode() const { return Inset::ENVIRONMENT_CODE; }
        ///
        int latex(Buffer const *, std::ostream &, LatexRunParams const &,
-                 bool fragile, bool fp) const;
+                 bool fp) const;
        ///
        string const editMessage() const;
        ///
index 93711de22e4e339728ce0df91e5e9903fbe40b9c..a4b10e33ba483e6ac39e3670c554dee371f1269d 100644 (file)
@@ -39,7 +39,7 @@ public:
        void read(Buffer const *, LyXLex &) {}
        ///
        int latex(Buffer const *, std::ostream &, LatexRunParams const &,
-                 bool, bool) const { return 0; }
+                 bool) const { return 0; }
        ///
        int ascii(Buffer const *, std::ostream &, int) const { return 0; }
        ///
index aab2a2b4d5bf50e4fe575988a6f2b775e43d1a0e..45fcba114f74f6c1af31b7f7b35bb9fa5a5f6a20 100644 (file)
@@ -324,7 +324,7 @@ void InsetERT::lfunMouseMotion(FuncRequest const & cmd)
 
 
 int InsetERT::latex(Buffer const *, ostream & os, LatexRunParams const &,
-                   bool /*fragile*/, bool /*free_spc*/) const
+                   bool /*free_spc*/) const
 {
        ParagraphList::iterator par = inset.paragraphs.begin();
        ParagraphList::iterator end = inset.paragraphs.end();
index 979ef251b1050a7dbb733aa3db7114db1bcf55e1..4264ad9094dbe972445c86352064df8034a2187b 100644 (file)
@@ -64,7 +64,7 @@ public:
        ///
        EDITABLE editable() const;
        ///
-       int latex(Buffer const *, std::ostream &, LatexRunParams const &, bool fragile,
+       int latex(Buffer const *, std::ostream &, LatexRunParams const &,
                  bool free_spc) const;
        ///
        int ascii(Buffer const *,
index e69d373a0e2133a4a00360a0ca0f7aee0ffe48d1..597b4b3b88acc75e1a7494db301bfa67908fe2a1 100644 (file)
@@ -166,8 +166,9 @@ int InsetExternal::write(string const & format,
 }
 
 
-int InsetExternal::latex(Buffer const * buf, ostream & os, LatexRunParams const &,
-                        bool, bool) const
+int InsetExternal::latex(Buffer const * buf, ostream & os,
+                        LatexRunParams const &,
+                        bool) const
 {
        return write("LaTeX", buf, os);
 }
index a8d4910cd9530380f98f6a52e810d27adac490f8..7223495874b670903a6b818b00fc389ee05b18e0 100644 (file)
@@ -53,8 +53,9 @@ public:
         If the free_spc (freespacing) variable is set, then this inset
         is in a free-spacing paragraph.
         */
-       virtual int latex(Buffer const *, std::ostream &, LatexRunParams const &,
-                         bool fragile, bool free_spc) const;
+       virtual int latex(Buffer const *, std::ostream &,
+                         LatexRunParams const &,
+                         bool free_spc) const;
        /// write ASCII output to the ostream
        virtual int ascii(Buffer const *, std::ostream &, int linelen) const;
        /// write LinuxDoc output to the ostream
index 9d3dee48758b55dcfa2e28fd20dd46760aed798d..e4b1142b24c1bb6f3ebcf8fee7cf600d877993c7 100644 (file)
@@ -271,8 +271,9 @@ string const InsetFloat::editMessage() const
 }
 
 
-int InsetFloat::latex(Buffer const * buf, ostream & os, LatexRunParams const & runparams,
-                     bool fragile, bool fp) const
+int InsetFloat::latex(Buffer const * buf, ostream & os,
+                     LatexRunParams const & runparams,
+                     bool fp) const
 {
        FloatList const & floats = buf->params.getLyXTextClass().floats();
        string const tmptype = (params_.wide ? params_.type + "*" : params_.type);
@@ -303,7 +304,7 @@ int InsetFloat::latex(Buffer const * buf, ostream & os, LatexRunParams const & r
        }
        os << '\n';
 
-       int const i = inset.latex(buf, os, runparams, fragile, fp);
+       int const i = inset.latex(buf, os, runparams, fp);
 
        // The \n is used to force \end{<floatname>} to appear in a new line.
        // In this case, we do not case if the current output line is empty.
index 9a45ede4d4caa1b286cd80f0e77e175df7b26a14..abc4d5f2953d0b15f62f46c86ce00e2913c53096 100644 (file)
@@ -58,7 +58,7 @@ public:
        Inset::Code lyxCode() const { return Inset::FLOAT_CODE; }
        ///
        int latex(Buffer const *, std::ostream &, LatexRunParams const &,
-                 bool fragile, bool fp) const;
+                 bool fp) const;
        ///
        int docbook(Buffer const *, std::ostream &, bool mixcont) const;
        ///
index c6075d5a98a9d76b7377ecc1b7b2f431a163df16..8ade79ede210dcd37323e6c718e37019766015b6 100644 (file)
@@ -107,8 +107,9 @@ dispatch_result InsetFloatList::localDispatch(FuncRequest const & cmd)
 }
 
 
-int InsetFloatList::latex(Buffer const * buf, ostream & os, LatexRunParams const &,
-                         bool, bool) const
+int InsetFloatList::latex(Buffer const * buf, ostream & os,
+                         LatexRunParams const &,
+                         bool) const
 {
        FloatList const & floats = buf->params.getLyXTextClass().floats();
        FloatList::const_iterator cit = floats[getCmdName()];
index ec2f3acfbbd36a828a2f6e46add9337084488248..be3253090a34a89ecfa1dc14281b6f8faf6144ec 100644 (file)
@@ -45,7 +45,7 @@ public:
        void read(Buffer const *, LyXLex &);
        ///
        int latex(Buffer const *, std::ostream &, LatexRunParams const &,
-                 bool, bool) const;
+                 bool) const;
        ///
        int linuxdoc(Buffer const *, std::ostream &) const { return 0; }
        ///
index eee9bbe69889605f52d411be0c06b5c02d537a33..eb797063aefa5603d033f7925ef28a1c0863b0cc 100644 (file)
@@ -15,6 +15,7 @@
 #include "gettext.h"
 #include "lyxfont.h"
 #include "BufferView.h"
+#include "latexrunparams.h"
 #include "lyxtext.h"
 #include "insets/insettext.h"
 #include "support/LOstream.h"
@@ -57,17 +58,19 @@ string const InsetFoot::editMessage() const
 }
 
 
-int InsetFoot::latex(Buffer const * buf, ostream & os, LatexRunParams const & runparams,
-                    bool fragile, bool fp) const
+int InsetFoot::latex(Buffer const * buf, ostream & os,
+                    LatexRunParams const & runparams_in,
+                    bool fp) const
 {
+       LatexRunParams runparams = runparams_in;
        if (buf && parOwner()) {
                LyXLayout_ptr const & layout = parOwner()->layout();
-               fragile |= layout->intitle;
+               runparams.fragile |= layout->intitle;
        }
 
        os << "%\n\\footnote{";
 
-       int const i = inset.latex(buf, os, runparams, fragile, fp);
+       int const i = inset.latex(buf, os, runparams, fp);
        os << "%\n}";
 
        return i + 2;
index 9dace198291113f5521bc4da310e0d2102db8dcc..0990d632108f72f865453aae73dadd19143f0e88 100644 (file)
@@ -32,7 +32,7 @@ public:
        Inset::Code lyxCode() const { return Inset::FOOT_CODE; }
        ///
        int latex(Buffer const *, std::ostream &, LatexRunParams const &,
-                 bool fragile, bool fp) const;
+                 bool fp) const;
        ///
        int docbook(Buffer const *, std::ostream &, bool mixcont) const;
        ///
index cda1d8d3ead3a2e7ece063d5418c99ccd8c2024e..c111e404af998616b7ae447c72a3704da0b6ba1d 100644 (file)
@@ -674,7 +674,7 @@ string const InsetGraphics::prepareFile(Buffer const * buf,
 
 int InsetGraphics::latex(Buffer const * buf, ostream & os,
                         LatexRunParams const & runparams,
-                        bool /*fragile*/, bool/*fs*/) const
+                        bool/*fs*/) const
 {
        // If there is no file specified or not existing,
        // just output a message about it in the latex output.
index f9d0fb330b64260f265370e8173b031f8baa3680..cc6c4e1aa82fdf10ad05f2c4f9cf4f30be04e26a 100644 (file)
@@ -50,7 +50,7 @@ public:
         fragile commands by adding a #\protect# before.
         */
        int latex(Buffer const *, std::ostream &, LatexRunParams const &,
-                 bool fragile, bool free_spc) const;
+                 bool free_spc) const;
        ///
        int ascii(Buffer const *, std::ostream &, int linelen) const;
        ///
index 73ef63dd54e2508b0f51661c5d5bf4de27a1e2aa..98d50abe5e60a3b3efa9f4d80978ea0a2b509058 100644 (file)
@@ -22,7 +22,7 @@ InsetHFill::InsetHFill()
 
 
 int InsetHFill::latex(Buffer const *, ostream & os, LatexRunParams const &,
-                     bool /*fragile*/, bool /*fs*/) const
+                     bool /*fs*/) const
 {
        os << getCommand();
        return 0;
index 7336ed84162cea94d0a3131cafe5b340f040499f..31344e376a3db2a29b145f175941f325d35fe3f0 100644 (file)
@@ -29,7 +29,7 @@ public:
        Inset::Code lyxCode() const { return Inset::HFILL_CODE; }
        ///
        int latex(Buffer const *, std::ostream &, LatexRunParams const &,
-                 bool fragile, bool free_spc) const;
+                 bool free_spc) const;
        ///
        int ascii(Buffer const *, std::ostream &, int linelen) const;
        ///
index d334c7307c799405809b304a5cae09b35d0697cf..ccb2cd08cd9956dce5f82bb23be32bae7cd68be0 100644 (file)
@@ -287,7 +287,7 @@ bool InsetInclude::loadIfNeeded() const
 
 int InsetInclude::latex(Buffer const * buffer, ostream & os,
                        LatexRunParams const & runparams,
-                       bool /*fragile*/, bool /*fs*/) const
+                       bool /*fs*/) const
 {
        string incfile(params_.cparams.getContents());
 
@@ -575,7 +575,7 @@ string const InsetInclude::PreviewImpl::latexString() const
        ostringstream os;
        LatexRunParams runparams;
        runparams.flavor = LatexRunParams::LATEX;
-       parent().latex(view()->buffer(), os, runparams, false, false);
+       parent().latex(view()->buffer(), os, runparams, false);
 
        return STRCONV(os.str());
 }
index 6d9c461593171cb010715ee0851a03e5aefc5558..59c7ccc0e2f3b233fe275645ed089f20c29539a4 100644 (file)
@@ -92,7 +92,7 @@ public:
        void read(Buffer const *, LyXLex &);
        ///
        int latex(Buffer const *, std::ostream &, LatexRunParams const &,
-                 bool fragile, bool free_spc) const;
+                 bool free_spc) const;
        ///
        int ascii(Buffer const *, std::ostream &, int linelen) const;
        ///
index 7db9dcba24f5821ddca556cf9f45061ec07b9d22..60eb0f2d986094d407c082a4bf3a27af3ebd8f5f 100644 (file)
@@ -83,7 +83,7 @@ dispatch_result InsetLabel::localDispatch(FuncRequest const & cmd)
 
 
 int InsetLabel::latex(Buffer const *, ostream & os, LatexRunParams const &,
-                     bool /*fragile*/, bool /*fs*/) const
+                     bool /*fs*/) const
 {
        os << escape(getCommand());
        return 0;
index 7425067f5ecb70a179e876336e105101c8848cdc..90b5377f1aaf41c1f860aa9105b61b51c5debe73 100644 (file)
@@ -37,7 +37,7 @@ public:
        std::vector<string> const getLabelList() const;
        ///
        int latex(Buffer const *, std::ostream &, LatexRunParams const &,
-                 bool fragile, bool free_spc) const;
+                 bool free_spc) const;
        ///
        int ascii(Buffer const *, std::ostream &, int linelen) const;
        ///
index 3ac614137c481ab1fe6b6843bb182b94921f70b6..068e2110d6507e6a12a35d404925e4e2e79278cc 100644 (file)
@@ -621,8 +621,9 @@ void InsetLatexAccent::read(Buffer const *, LyXLex & lex)
 }
 
 
-int InsetLatexAccent::latex(Buffer const *, ostream & os, LatexRunParams const &,
-                           bool /*fragile*/, bool/*fs*/) const
+int InsetLatexAccent::latex(Buffer const *, ostream & os,
+                           LatexRunParams const &,
+                           bool/*fs*/) const
 {
        os << contents;
        return 0;
index 35834619b0b962fc289e12e2b9df03277bb8285b..b8dc7836ec659661eedc20cb02245424363670ea 100644 (file)
@@ -50,7 +50,7 @@ public:
        void read(Buffer const *, LyXLex & lex);
        ///
        int latex(Buffer const *, std::ostream &, LatexRunParams const &,
-                 bool fragile, bool free_spc) const;
+                 bool free_spc) const;
        ///
        int ascii(Buffer const *, std::ostream &, int linelen) const;
        ///
index 82a3ecaeb4939f877d1e4f554f9d1102e99d93f7..6b82f1982d5efb2eb0b24b68068d31488a8e5cc6 100644 (file)
@@ -62,12 +62,12 @@ string const InsetList::editMessage() const
 }
 
 
-int InsetList::latex(Buffer const * buf,
-                    ostream & os, bool fragile, bool fp) const
+int InsetList::latex(Buffer const * buf, ostream & os,
+                    LatexRunParams const & runparams, bool fp) const
 {
        os << "\\footnote{%\n";
 
-       int i = inset.latex(buf, os, fragile, fp);
+       int i = inset.latex(buf, os, runparams, fp);
        os << "}%\n";
 
        return i + 2;
index 9f179223cd0de8d0db3dcf1f8a42d1b14ec374ee..41a92d3afb3452325a3838fe8ee26a6b539aa730 100644 (file)
@@ -28,7 +28,7 @@ public:
        Inset::Code lyxCode() const { return Inset::FOOT_CODE; }
        ///
        int latex(Buffer const *, std::ostream &, LatexRunParams const &,
-                 bool fragile, bool fp) const;
+                 bool fp) const;
        ///
        string const editMessage() const;
 };
index d59634d604ccd08a70ae8934e8b4f21e7c027858..7fd21d188fa2f1412ca2b9d362bbece929b3c2b9 100644 (file)
@@ -53,12 +53,13 @@ string const InsetMarginal::editMessage() const
 }
 
 
-int InsetMarginal::latex(Buffer const * buf, ostream & os, LatexRunParams const & runparams,
-                        bool fragile, bool fp) const
+int InsetMarginal::latex(Buffer const * buf, ostream & os,
+                        LatexRunParams const & runparams,
+                        bool fp) const
 {
        os << "%\n\\marginpar{";
 
-       int const i = inset.latex(buf, os, runparams, fragile, fp);
+       int const i = inset.latex(buf, os, runparams, fp);
        os << "%\n}";
 
        return i + 2;
index fae6b701b6ddc557021cd69633fc39e08c157bc5..7ce18a7d49df8839ec571d2bf4ab9c3e0869d15b 100644 (file)
@@ -31,7 +31,7 @@ public:
        Inset::Code lyxCode() const { return Inset::MARGIN_CODE; }
        ///
        int latex(Buffer const *, std::ostream &, LatexRunParams const &,
-                 bool fragile, bool fp) const;
+                 bool fp) const;
        ///
        string const editMessage() const;
 };
index 3cbe2514bcdd08dced3f79adb74428b469c2b400..8e69267393a213268c1c2a7468ccbb86e3e03dc1 100644 (file)
@@ -250,8 +250,9 @@ string const InsetMinipage::editMessage() const
 }
 
 
-int InsetMinipage::latex(Buffer const * buf, ostream & os, LatexRunParams const & runparams,
-                        bool fragile, bool fp) const
+int InsetMinipage::latex(Buffer const * buf, ostream & os,
+                        LatexRunParams const & runparams,
+                        bool fp) const
 {
        string s_pos;
        switch (params_.pos) {
@@ -268,7 +269,7 @@ int InsetMinipage::latex(Buffer const * buf, ostream & os, LatexRunParams const
        os << "\\begin{minipage}[" << s_pos << "]{"
           << params_.width.asLatexString() << "}%\n";
 
-       int i = inset.latex(buf, os, runparams, fragile, fp);
+       int i = inset.latex(buf, os, runparams, fp);
 
        os << "\\end{minipage}%\n";
        return i + 2;
index 12604728ca61138cec6819cb3bb8e51a384ea5d4..7af83034effdd095dd2e416cf6c6129cbc178015 100644 (file)
@@ -73,7 +73,7 @@ public:
        Inset::Code lyxCode() const { return Inset::MINIPAGE_CODE; }
        ///
        int latex(Buffer const *, std::ostream &, LatexRunParams const &,
-                 bool fragile, bool fp) const;
+                 bool fp) const;
        ///
        string const editMessage() const;
        ///
index 9623b8b10b5440e1234b53523e0b9923369bcd59..6f07e43a1674b58689a276d7a9a4d28fe72d8903 100644 (file)
@@ -47,7 +47,7 @@ void InsetNewline::dimension(BufferView *, LyXFont const & font,
 
 
 int InsetNewline::latex(Buffer const *, ostream &, LatexRunParams const &,
-                       bool, bool) const
+                       bool) const
 {
        lyxerr << "Eek, calling InsetNewline::latex !" << endl;
        return 0;
index 814639b1c3beed8f9ce0bdef4b733c5dbe87c8d7..33f8306f9a311973929205b0d4cdb97de1264b9a 100644 (file)
@@ -31,8 +31,9 @@ public:
        virtual void draw(BufferView *, LyXFont const &,
                          int baseline, float & x) const;
 
-       virtual int latex(Buffer const *, std::ostream &, LatexRunParams const &,
-                         bool fragile, bool free_spc) const;
+       virtual int latex(Buffer const *, std::ostream &,
+                         LatexRunParams const &,
+                         bool free_spc) const;
 
        virtual int ascii(Buffer const *, std::ostream &, int linelen) const;
 
index 0100e759179dc6bcb1d64677b961778ed924ff14..8a226a8c59e01154c7105865fcdd50d85982a420 100644 (file)
@@ -34,7 +34,7 @@ public:
        void write(Buffer const *, std::ostream &) const;
        ///
        int latex(Buffer const *, std::ostream &, LatexRunParams const &,
-                 bool, bool) const
+                 bool) const
                { return 0; }
        ///
        int linuxdoc(Buffer const *, std::ostream &) const
index 09a6ca8c6f04882a368cddf39c802fb52c84178e..04310bb17326ef9341b84032ce2199c5b40e9609 100644 (file)
@@ -67,17 +67,17 @@ void InsetOptArg::write(Buffer const * buf, ostream & os) const
 
 
 int InsetOptArg::latex(Buffer const *, ostream &, LatexRunParams const &,
-                      bool, bool) const
+                      bool) const
 {
        return 0;
 }
 
 
 int InsetOptArg::latexOptional(Buffer const * buf, ostream & os,
-                              LatexRunParams const & runparams, bool, bool fp) const
+                              LatexRunParams const & runparams, bool fp) const
 {
        os << '[';
-       int const i = inset.latex(buf, os, runparams, false, fp);
+       int const i = inset.latex(buf, os, runparams, fp);
        os << ']';
        return i + 2;
 }
index 5aa2e0e592e3b0c8f2c90a5ee684e363c7c7eae2..5821665b3e0bb0bcbea731571118e6beddabc076 100644 (file)
@@ -39,10 +39,11 @@ public:
 
        /// Standard LaTeX output -- short-circuited
        int latex(Buffer const *, std::ostream &, LatexRunParams const &,
-                 bool fragile, bool fp) const;
+                 bool fp) const;
        /// Outputting the optional parameter of a LaTeX command
-       int latexOptional(Buffer const *, std::ostream &, LatexRunParams const &,
-                         bool fragile, bool fp) const;
+       int latexOptional(Buffer const *, std::ostream &,
+                         LatexRunParams const &,
+                         bool fp) const;
        /// Write out tothe .lyx file
        void write(Buffer const * buf, std::ostream & os) const;
 };
index 7ec4dddd12b0435969f77f7a5bc76b5235916aa2..339401f9fa95682f7b3d2f65ed32fed8e7e371fa 100644 (file)
@@ -54,10 +54,11 @@ dispatch_result InsetParent::localDispatch(FuncRequest const & cmd)
 
 
 // LaTeX must just ignore this command
-int InsetParent::latex(Buffer const * buf, ostream & os, LatexRunParams const & runparams,
-                      bool fragile, bool free_spc) const
+int InsetParent::latex(Buffer const * buf, ostream & os,
+                      LatexRunParams const & runparams,
+                      bool free_spc) const
 {
        os << "%%#{lyx}";
-       InsetCommand::latex(buf, os, runparams, fragile, free_spc);
+       InsetCommand::latex(buf, os, runparams, free_spc);
        return 0;
 }
index 71299d90d3fb6a65ab196f772e3b2389403a9be8..ba8dbd3a3fec4486d5b4f66983f10bdcfc849a49 100644 (file)
@@ -40,7 +40,7 @@ public:
        Inset::Code lyxCode() const { return Inset::PARENT_CODE; }
        ///
        int latex(Buffer const *, std::ostream &, LatexRunParams const &,
-                 bool fragile, bool free_spc) const;
+                 bool free_spc) const;
        ///
        void setParent(string const & fn) { setContents(fn); }
 };
index 349af2356e8c668592ba72a4dc637db7c646dee8..8d38abee11c711bbddd18ce309ccb38d8be01094 100644 (file)
 
 #include "insetquotes.h"
 
-#include "BufferView.h"
-#include "LaTeXFeatures.h"
-#include "frontends/Painter.h"
 #include "buffer.h"
+#include "BufferView.h"
 #include "debug.h"
 #include "dimension.h"
-#include "frontends/font_metrics.h"
 #include "language.h"
+#include "LaTeXFeatures.h"
+#include "latexrunparams.h"
 #include "lyxfont.h"
+#include "lyxlex.h"
 #include "lyxrc.h"
 #include "paragraph.h"
-#include "lyxlex.h"
+#include "frontends/font_metrics.h"
+#include "frontends/Painter.h"
 #include "support/LAssert.h"
 #include "support/lstrings.h"
 
@@ -237,10 +238,9 @@ void InsetQuotes::read(Buffer const *, LyXLex & lex)
 }
 
 
-extern bool use_babel;
-
-int InsetQuotes::latex(Buffer const * buf, ostream & os, LatexRunParams const &,
-                      bool /*fragile*/, bool /* free_spc */) const
+int InsetQuotes::latex(Buffer const * buf, ostream & os,
+                      LatexRunParams const & runparams,
+                      bool /* free_spc */) const
 {
        // How do we get the local language here??
        lyx::pos_type curr_pos = parOwner()->getPositionOfInset(this);
@@ -276,7 +276,7 @@ int InsetQuotes::latex(Buffer const * buf, ostream & os, LatexRunParams const &,
 #ifdef DO_USE_DEFAULT_LANGUAGE
        } else if (doclang == "default") {
 #else
-       } else if (!use_babel) {
+       } else if (!runparams.use_babel) {
 #endif
                qstr = latex_quote_ot1[times_][quoteind];
        } else {
@@ -323,6 +323,8 @@ int InsetQuotes::docbook(Buffer const *, ostream & os, bool) const
 }
 
 
+extern bool use_babel;
+
 void InsetQuotes::validate(LaTeXFeatures & features) const
 {
        char type = quote_char[quote_index[side_][language_]];
index 5650259e4fe0c2552b85357271957315395176e5..dbebf31cdc15e4f324222cb2c2d145d51576c021 100644 (file)
@@ -84,7 +84,7 @@ public:
        void read(Buffer const *, LyXLex & lex);
        ///
        int latex(Buffer const *, std::ostream &, LatexRunParams const &,
-                 bool fragile, bool free_spc) const;
+                 bool free_spc) const;
        ///
        int ascii(Buffer const *, std::ostream &, int linelen) const;
        ///
index 3ac5351ac86e73957918a4b1feef1147329c20ad..973c5b8490b796ee724dd43d8b4f8f0c498f43c2 100644 (file)
@@ -72,7 +72,7 @@ string const InsetRef::getScreenLabel(Buffer const *) const
 
 
 int InsetRef::latex(Buffer const *, ostream & os, LatexRunParams const &,
-                   bool /*fragile*/, bool /*fs*/) const
+                   bool /*fs*/) const
 {
        if (getOptions().empty())
                os << escape(getCommand());
index 01955ffd602ed8ca681985d35932b59200561ca2..287c08e254529e1798e8b7199dc95da88130b19f 100644 (file)
@@ -55,7 +55,7 @@ public:
        bool display() const { return false; }
        ///
        int latex(Buffer const *, std::ostream &, LatexRunParams const &,
-                 bool fragile, bool free_spc) const;
+                 bool free_spc) const;
        ///
        int ascii(Buffer const *, std::ostream &, int linelen) const;
        ///
index 2210a24ff9901b7aee01f7fc75953e02d078755d..135e994c9853325c09e9a4aa00c8e3c6fb272119 100644 (file)
@@ -157,7 +157,7 @@ void InsetSpace::read(Buffer const *, LyXLex & lex)
 
 
 int InsetSpace::latex(Buffer const *, ostream & os, LatexRunParams const &,
-                     bool /*fragile*/, bool free_space) const
+                     bool free_space) const
 {
        switch (kind_) {
        case NORMAL:
index c92b173c43ae634549a65051ff6dc98962162479..69c277056388cdee1e89116273416fb10ef6cd14 100644 (file)
@@ -62,7 +62,7 @@ public:
        void read(Buffer const *, LyXLex & lex);
        ///
        int latex(Buffer const *, std::ostream &, LatexRunParams const &,
-                 bool fragile, bool free_spc) const;
+                 bool free_spc) const;
        ///
        int ascii(Buffer const *, std::ostream &, int linelen) const;
        ///
index e5f2536ca8865a61c7ee42fa912ffad55d716b77..b23d5d12ccb8397db8446f22c4475a89c5cb12fd 100644 (file)
@@ -160,8 +160,9 @@ void InsetSpecialChar::read(Buffer const *, LyXLex & lex)
 }
 
 
-int InsetSpecialChar::latex(Buffer const *, ostream & os, LatexRunParams const &,
-                           bool /*fragile*/, bool free_space) const
+int InsetSpecialChar::latex(Buffer const *, ostream & os,
+                           LatexRunParams const &,
+                           bool free_space) const
 {
        switch (kind_) {
        case HYPHENATION:
index dd2e92d4b2493a68cc57e45314d9a5ae26181769..ec196630601482475789bbc22faceaedf07c041d 100644 (file)
@@ -55,7 +55,7 @@ public:
        void read(Buffer const *, LyXLex & lex);
        ///
        int latex(Buffer const *, std::ostream &, LatexRunParams const &,
-                 bool fragile, bool free_spc) const;
+                 bool free_spc) const;
        ///
        int ascii(Buffer const *, std::ostream &, int linelen) const;
        ///
index 9e3749bb8f2497d6f0acd58d0cfa85951ae6cb98..4277d27f38c4830780d27fd86b1bcef9f2c61e1f 100644 (file)
@@ -1192,10 +1192,11 @@ Inset::RESULT InsetTabular::localDispatch(FuncRequest const & cmd)
 }
 
 
-int InsetTabular::latex(Buffer const * buf, ostream & os, LatexRunParams const & runparams,
-                       bool fragile, bool fp) const
+int InsetTabular::latex(Buffer const * buf, ostream & os,
+                       LatexRunParams const & runparams,
+                       bool fp) const
 {
-       return tabular->latex(buf, os, runparams, fragile, fp);
+       return tabular->latex(buf, os, runparams, fp);
 }
 
 
index 91c23bd17a78d6475115ed51cd2253c3873f50c9..a948052efe4aca4ef71fd9ec35dd126f65c60a6b 100644 (file)
@@ -126,7 +126,7 @@ public:
        RESULT localDispatch(FuncRequest const &);
        ///
        int latex(Buffer const *, std::ostream &, LatexRunParams const &,
-                 bool, bool) const;
+                 bool) const;
        ///
        int ascii(Buffer const *, std::ostream &, int linelen) const;
        ///
index 05701273cf91184a87d3ff62bc18efff0a2b54ee..675a14f727e2cd2743b8c681bb6cf217804a48e9 100644 (file)
@@ -1447,11 +1447,12 @@ Inset::RESULT InsetText::localDispatch(FuncRequest const & cmd)
 }
 
 
-int InsetText::latex(Buffer const * buf, ostream & os, LatexRunParams const & runparams,
-                    bool fragile, bool) const
+int InsetText::latex(Buffer const * buf, ostream & os,
+                    LatexRunParams const & runparams,
+                    bool) const
 {
        TexRow texrow;
-       latexParagraphs(buf, paragraphs, os, texrow, runparams, fragile);
+       latexParagraphs(buf, paragraphs, os, texrow, runparams);
        return texrow.rows();
 }
 
index 7cbc02f48fbfd67d522f22e1675f28af626889a8..8565d1da2679b31bcee72c7aad39647f3a0d2e10 100644 (file)
@@ -113,7 +113,7 @@ public:
        RESULT localDispatch(FuncRequest const &);
        ///
        int latex(Buffer const *, std::ostream &, LatexRunParams const &,
-                 bool fragile, bool free_spc) const;
+                 bool free_spc) const;
        ///
        int ascii(Buffer const *, std::ostream &, int linelen) const;
        ///
index c6358e2cc3274e78d850e2f2d96f724cedabcec3..b0810ea92aebfb1a94c5480d6773301bb432bd5b 100644 (file)
@@ -71,12 +71,12 @@ string const InsetTheorem::editMessage() const
 }
 
 
-int InsetTheorem::latex(Buffer const * buf,
-                       ostream & os, bool fragile, bool fp) const
+int InsetTheorem::latex(Buffer const * buf, ostream & os,
+                       LatexRunParams const & runparams, bool fp) const
 {
        os << "\\begin{theorem}%\n";
 
-       int i = inset.latex(buf, os, fragile, fp);
+       int i = inset.latex(buf, os, runparams, fp);
        os << "\\end{theorem}%\n";
 
        return i + 2;
index 8ade61ce048121b47e118e02f5b79bd989c34c56..5a070908f25cdcdedcf1dbf3a3eb521ddc2d5ad2 100644 (file)
@@ -32,7 +32,7 @@ public:
        bool display() const { return true; }
        ///
        int latex(Buffer const *, std::ostream &, LatexRunParams const &,
-                 bool fragile, bool fp) const;
+                 bool fp) const;
        ///
        string const editMessage() const;
 };
index 3e3d5aa8b0f1feb54ad592662287fcd83918eca5..fd272a4b6011e77e6c08e025ad573b369e6ab759 100644 (file)
@@ -14,6 +14,7 @@
 #include "funcrequest.h"
 #include "BufferView.h"
 #include "LaTeXFeatures.h"
+#include "latexrunparams.h"
 #include "frontends/LyXView.h"
 #include "debug.h"
 #include "frontends/Dialogs.h"
@@ -70,12 +71,13 @@ string const InsetUrl::getScreenLabel(Buffer const *) const
 }
 
 
-int InsetUrl::latex(Buffer const *, ostream & os, LatexRunParams const &,
-                   bool fragile, bool /*free_spc*/) const
+int InsetUrl::latex(Buffer const *, ostream & os,
+                   LatexRunParams const & runparams,
+                   bool /*free_spc*/) const
 {
        if (!getOptions().empty())
                os << getOptions() + ' ';
-       if (fragile)
+       if (runparams.fragile)
                os << "\\protect";
        os << "\\url{" << getContents() << '}';
        return 0;
index b382bc7c69ad18339a944491e64b700763ac7b30..d9052ae7fd6f68f19bb93d832d35392e275b7c39 100644 (file)
@@ -44,7 +44,7 @@ public:
        bool display() const { return false; }
        ///
        int latex(Buffer const *, std::ostream &, LatexRunParams const &,
-                 bool fragile, bool free_spc) const;
+                 bool free_spc) const;
        ///
        int ascii(Buffer const *, std::ostream &, int linelen) const;
        ///
index bc06311c4d8af78ecd47e65d4b6d90ebf7f86636..21b14a0867181938957a79450e52ea3f2bc8b4c0 100644 (file)
@@ -192,8 +192,9 @@ string const InsetWrap::editMessage() const
 }
 
 
-int InsetWrap::latex(Buffer const * buf, ostream & os, LatexRunParams const & runparams,
-                    bool fragile, bool fp) const
+int InsetWrap::latex(Buffer const * buf, ostream & os,
+                    LatexRunParams const & runparams,
+                    bool fp) const
 {
        os << "\\begin{floating" << params_.type << '}';
        if (!params_.placement.empty()) {
@@ -201,7 +202,7 @@ int InsetWrap::latex(Buffer const * buf, ostream & os, LatexRunParams const & ru
        }
        os  << '{' << params_.width.asLatexString() << "}%\n";
 
-       int const i = inset.latex(buf, os, runparams, fragile, fp);
+       int const i = inset.latex(buf, os, runparams, fp);
 
        os << "\\end{floating" << params_.type << "}%\n";
        return i + 2;
index 369bcfc40c8aa085420fcffdd61be358c0e89f28..a936c54e782d1a7bd03e71e440270ed387672f01 100644 (file)
@@ -56,7 +56,7 @@ public:
        Inset::Code lyxCode() const { return Inset::WRAP_CODE; }
        ///
        int latex(Buffer const *, std::ostream &, LatexRunParams const &,
-                 bool fragile, bool fp) const;
+                 bool fp) const;
        ///
        int docbook(Buffer const *, std::ostream &, bool mixcont) const;
        ///
index 77d8140f7151956199cbd39a42b829ba74b92467..7ca181f4b683d9252064d9a8a1d0edecd7aa72ea 100644 (file)
@@ -18,18 +18,29 @@ struct LatexRunParams {
                 PDFLATEX
         };
 
-        LatexRunParams() : flavor(LATEX), nice(false) {}
+        LatexRunParams() : flavor(LATEX), nice(false),
+                          fragile(false), use_babel(false) {}
 
        /** The latex that we export depends occasionally on what is to
            compile the file.
        */
         FLAVOR flavor;
+
        /** Are we to write a 'nice' LaTeX file or not.
            This esentially seems to mean whether InsetInclude, InsetGraphics
            and InsetExternal should add the absolute path to any external
            files or not.
        */
        bool nice;
+
+       /** fragile == true means that the inset should take care about
+           fragile commands by preceding the latex with \protect.
+       */
+       bool fragile;
+
+       /** This var is set by the return value from BufferParams::writeLaTeX
+        */
+       bool use_babel;
 };
 
-#endif // LatexRunParams_H
+#endif // LATEXRUNPARAMS_H
index 5292389b498a324a01bee67176f54c22b81e06a7..69b43a3c2edefaf245282c5ce8a837ba811b90e3 100644 (file)
@@ -1,3 +1,10 @@
+2003-05-22  Angus Leeming  <leeming@lyx.org>
+
+       * formula.[Ch] (latex):
+       * formulamacro.[Ch] (latex):
+        no longer has a fragile arg. Data is now passed through the
+        LatexRunParams arg.
+
 2003-05-22  Angus Leeming  <leeming@lyx.org>
 
        * formula.[Ch] (latex):
index 5f0eb86aaa9a9c1396ab25842859deefa25ad459..6e362b4baa0ec5699bf919903311941a3647f301 100644 (file)
@@ -32,6 +32,7 @@
 #include "BufferView.h"
 #include "gettext.h"
 #include "debug.h"
+#include "latexrunparams.h"
 #include "lyxrc.h"
 #include "funcrequest.h"
 #include "Lsstream.h"
@@ -127,10 +128,11 @@ void InsetFormula::write(Buffer const *, ostream & os) const
 }
 
 
-int InsetFormula::latex(Buffer const *, ostream & os, LatexRunParams const &,
-                       bool fragile, bool) const
+int InsetFormula::latex(Buffer const *, ostream & os,
+                       LatexRunParams const & runparams,
+                       bool) const
 {
-       WriteStream wi(os, fragile, true);
+       WriteStream wi(os, runparams.fragile, true);
        par_->write(wi);
        return wi.line();
 }
index 105587825da27bbc58355371c79196f50e2c7eb7..2e1c7fa9c3f431f6a078293c749f97d0ce1bd438 100644 (file)
@@ -45,7 +45,7 @@ public:
        void read(Buffer const *, LyXLex & lex);
        ///
        int latex(Buffer const *, std::ostream &, LatexRunParams const &,
-                 bool fragile, bool free_spc) const;
+                 bool free_spc) const;
        ///
        int ascii(Buffer const *, std::ostream &, int linelen) const;
        ///
index a82183ba4890c4262f1e430bea460f90f6c81a02..3c76fed129a7765ba547bf237d5de400a44e49df 100644 (file)
@@ -26,6 +26,7 @@
 #include "math_mathmlstream.h"
 #include "BufferView.h"
 #include "gettext.h"
+#include "latexrunparams.h"
 #include "frontends/Painter.h"
 #include "frontends/font_metrics.h"
 #include "support/lyxlib.h"
@@ -79,10 +80,11 @@ void InsetFormulaMacro::write(Buffer const *, ostream & os) const
 }
 
 
-int InsetFormulaMacro::latex(Buffer const *, ostream & os, LatexRunParams const &,
-                            bool fragile, bool /*free_spacing*/) const
+int InsetFormulaMacro::latex(Buffer const *, ostream & os,
+                            LatexRunParams const & runparams,
+                            bool /*free_spacing*/) const
 {
-       WriteStream wi(os, fragile, true);
+       WriteStream wi(os, runparams.fragile, true);
        par()->write(wi);
        return 2;
 }
index 066d1660c7c8d94af766b5bfb6bc91128052475e..4a0fcb7d3dd1fca8558023aab5c7b733270ba0b3 100644 (file)
@@ -45,7 +45,7 @@ public:
        int ascii(Buffer const *, std::ostream &, int linelen) const;
        ///
        int latex(Buffer const *, std::ostream & os, LatexRunParams const &,
-                 bool fragile, bool free_spc) const;
+                 bool free_spc) const;
        ///
        int linuxdoc(Buffer const *, std::ostream & os) const;
        ///
index 39767594626f01257c3fb9d2fd3e9b27cef4f56b..06cc0b128221cefae0c45733057b71769af67526 100644 (file)
 
 #include "paragraph.h"
 #include "paragraph_pimpl.h"
-#include "lyxrc.h"
-#include "layout.h"
-#include "language.h"
+
 #include "buffer.h"
 #include "bufferparams.h"
-#include "debug.h"
-#include "texrow.h"
 #include "BufferView.h"
+#include "changes.h"
 #include "encoding.h"
-#include "ParameterStruct.h"
+#include "debug.h"
 #include "gettext.h"
-#include "changes.h"
+#include "language.h"
+#include "latexrunparams.h"
+#include "layout.h"
+#include "lyxrc.h"
 #include "paragraph_funcs.h"
+#include "ParameterStruct.h"
+#include "texrow.h"
+
 #include "Lsstream.h"
 
 #include "insets/insetbibitem.h"
@@ -1058,8 +1061,10 @@ bool Paragraph::simpleTeXOnePar(Buffer const * buf,
                column += Changes::latexMarkChange(os, running_change, change);
                running_change = change;
 
+               LatexRunParams rp = runparams;
+               rp.fragile = moving_arg;
                pimpl_->simpleTeXSpecialChars(buf, bparams,
-                                             os, texrow, runparams, moving_arg,
+                                             os, texrow, runparams,
                                              font, running_font,
                                              basefont, outerfont, open_font,
                                              running_change,
index de31d3e05f86c52c0d5aa0dc8797ec579661ef70..9af084aaace09f880b5d13f8003ce6d739e8fd8b 100644 (file)
@@ -283,7 +283,6 @@ TeXOnePar(Buffer const * buf,
          ParagraphList::iterator pit,
          ostream & os, TexRow & texrow,
          LatexRunParams const & runparams,
-         bool moving_arg,
          string const & everypar = string());
 
 
@@ -554,7 +553,7 @@ TeXOnePar(Buffer const * buf,
                        InsetOptArg * it = optArgInset(*pit);
                        if (it)
                                it->latexOptional(buf, os, runparams,
-                                                 false, false);
+                                                 false);
                }
                else
                        os << style->latexparam();
@@ -697,8 +696,7 @@ void latexParagraphs(Buffer const * buf,
                     ostream & os,
                     TexRow & texrow,
                     LatexRunParams const & runparams,
-                    bool moving_arg,
-         string const & everypar)
+                    string const & everypar)
 {
        bool was_title = false;
        bool already_title = false;
@@ -746,7 +744,7 @@ void latexParagraphs(Buffer const * buf,
 
                        if (layout->is_environment) {
                                par = TeXOnePar(buf, paragraphs, par, os, texrow,
-                                               runparams, moving_arg, everypar);
+                                               runparams, everypar);
                        } else if (layout->isEnvironment() ||
                                !par->params().leftIndent().zero())
                        {
@@ -754,11 +752,11 @@ void latexParagraphs(Buffer const * buf,
                                                     texrow, runparams);
                        } else {
                                par = TeXOnePar(buf, paragraphs, par, os, texrow,
-                                               runparams, moving_arg, everypar);
+                                               runparams, everypar);
                        }
                } else {
                        par = TeXOnePar(buf, paragraphs, par, os, texrow,
-                                       runparams, moving_arg, everypar);
+                                       runparams, everypar);
                }
        }
        // It might be that we only have a title in this document
index c730090dc8ca8ab037388a07e0952a24efe0c254..1567edca17eff4db694326247c8269ae8f399f93 100644 (file)
@@ -67,7 +67,6 @@ void latexParagraphs(Buffer const * buf,
                     std::ostream & ofs,
                     TexRow & texrow,
                     LatexRunParams const &,
-                    bool moving_arg,
                     string const & everypar = string());
 
 /// read a paragraph from a .lyx file. Returns number of unrecognised tokens
index 491d1a55218f278d2ae0c4a8a5284015232ad2b3..d48015c7159f488ae27fa96a38088e53921f62ce 100644 (file)
 #include <config.h>
 
 #include "paragraph_pimpl.h"
-#include "LaTeXFeatures.h"
-#include "texrow.h"
-#include "language.h"
+
 #include "bufferparams.h"
+#include "debug.h"
 #include "encoding.h"
+#include "language.h"
+#include "LaTeXFeatures.h"
+#include "latexrunparams.h"
 #include "lyxrc.h"
-#include "debug.h"
 #include "paragraph_funcs.h"
+#include "texrow.h"
 
 #include "support/LAssert.h"
 
@@ -484,7 +486,6 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const * buf,
                                             ostream & os,
                                             TexRow & texrow,
                                             LatexRunParams const & runparams,
-                                            bool moving_arg,
                                             LyXFont & font,
                                             LyXFont & running_font,
                                             LyXFont & basefont,
@@ -535,7 +536,7 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const * buf,
                                if (font.family() == LyXFont::TYPEWRITER_FAMILY)
                                        os << '~';
 
-                               if (moving_arg)
+                               if (runparams.fragile)
                                        os << "\\protect ";
 
                                os << "\\\\\n";
@@ -580,7 +581,7 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const * buf,
                        running_font = basefont;
                }
 
-               int tmp = inset->latex(buf, os, runparams, moving_arg,
+               int tmp = inset->latex(buf, os, runparams,
                                       style.free_spacing);
 
                if (close)
index 0f883fa01b48c64f107c328a32c002ab4c15941a..adfd5a5acc77b946a4ce22c0222c8496d307671f 100644 (file)
@@ -153,7 +153,7 @@ struct Paragraph::Pimpl {
        ///
        void simpleTeXSpecialChars(Buffer const *, BufferParams const &,
                                   std::ostream &, TexRow & texrow,
-                                  LatexRunParams const &, bool moving_arg,
+                                  LatexRunParams const &,
                                   LyXFont & font, LyXFont & running_font,
                                   LyXFont & basefont,
                                   LyXFont const & outerfont,
index 894e8097de86f851b5ec095fca34b4fa81359857..296288fc1113b6bf276c0853ea9785c962ac53dc 100644 (file)
@@ -1873,7 +1873,7 @@ int LyXTabular::TeXCellPostamble(ostream & os, int cell) const
 
 int LyXTabular::TeXLongtableHeaderFooter(ostream & os, Buffer const * buf,
                                         LatexRunParams const & runparams,
-                                        bool fragile, bool fp) const
+                                        bool fp) const
 {
        if (!is_long_tabular)
                return 0;
@@ -1887,7 +1887,7 @@ int LyXTabular::TeXLongtableHeaderFooter(ostream & os, Buffer const * buf,
                }
                for (int i = 0; i < rows_; ++i) {
                        if (row_info[i].endhead) {
-                               ret += TeXRow(os, i, buf, runparams, fragile, fp);
+                               ret += TeXRow(os, i, buf, runparams, fp);
                        }
                }
                if (endhead.bottomDL) {
@@ -1909,7 +1909,7 @@ int LyXTabular::TeXLongtableHeaderFooter(ostream & os, Buffer const * buf,
                }
                for (int i = 0; i < rows_; ++i) {
                        if (row_info[i].endfirsthead) {
-                               ret += TeXRow(os, i, buf, runparams, fragile, fp);
+                               ret += TeXRow(os, i, buf, runparams, fp);
                        }
                }
                if (endfirsthead.bottomDL) {
@@ -1927,7 +1927,7 @@ int LyXTabular::TeXLongtableHeaderFooter(ostream & os, Buffer const * buf,
                }
                for (int i = 0; i < rows_; ++i) {
                        if (row_info[i].endfoot) {
-                               ret += TeXRow(os, i, buf, runparams, fragile, fp);
+                               ret += TeXRow(os, i, buf, runparams, fp);
                        }
                }
                if (endfoot.bottomDL) {
@@ -1949,7 +1949,7 @@ int LyXTabular::TeXLongtableHeaderFooter(ostream & os, Buffer const * buf,
                }
                for (int i = 0; i < rows_; ++i) {
                        if (row_info[i].endlastfoot) {
-                               ret += TeXRow(os, i, buf, runparams, fragile, fp);
+                               ret += TeXRow(os, i, buf, runparams, fp);
                        }
                }
                if (endlastfoot.bottomDL) {
@@ -1973,7 +1973,7 @@ bool LyXTabular::isValidRow(int const row) const
 
 
 int LyXTabular::TeXRow(ostream & os, int const i, Buffer const * buf,
-                      LatexRunParams const & runparams, bool fragile, bool fp) const
+                      LatexRunParams const & runparams, bool fp) const
 {
        int ret = 0;
        int cell = GetCellNumber(i, 0);
@@ -1990,7 +1990,7 @@ int LyXTabular::TeXRow(ostream & os, int const i, Buffer const * buf,
 
                if (rtl)
                        os << "\\R{";
-               ret += inset->latex(buf, os, runparams, fragile, fp);
+               ret += inset->latex(buf, os, runparams, fp);
                if (rtl)
                        os << '}';
 
@@ -2009,7 +2009,7 @@ int LyXTabular::TeXRow(ostream & os, int const i, Buffer const * buf,
 
 
 int LyXTabular::latex(Buffer const * buf, ostream & os,
-                     LatexRunParams const & runparams, bool fragile, bool fp) const
+                     LatexRunParams const & runparams, bool fp) const
 {
        int ret = 0;
 
@@ -2083,7 +2083,7 @@ int LyXTabular::latex(Buffer const * buf, ostream & os,
        os << "}\n";
        ++ret;
 
-       ret += TeXLongtableHeaderFooter(os, buf, runparams, fragile, fp);
+       ret += TeXLongtableHeaderFooter(os, buf, runparams, fp);
 
        //+---------------------------------------------------------------------
        //+                      the single row and columns (cells)            +
@@ -2091,7 +2091,7 @@ int LyXTabular::latex(Buffer const * buf, ostream & os,
 
        for (int i = 0; i < rows_; ++i) {
                if (isValidRow(i)) {
-                       ret += TeXRow(os, i, buf, runparams, fragile, fp);
+                       ret += TeXRow(os, i, buf, runparams, fp);
                        if (is_long_tabular && row_info[i].newpage) {
                                os << "\\newpage\n";
                                ++ret;
index 06917c73236ee6a01873b4782838d08a5671f923..bf786d4dedb917211705cd30d9474db41b307cfb 100644 (file)
@@ -291,7 +291,8 @@ public:
        ///
        void Read(Buffer const *, LyXLex &);
        ///
-       int latex(Buffer const *, std::ostream &, LatexRunParams const &, bool, bool) const;
+       int latex(Buffer const *, std::ostream &, LatexRunParams const &,
+                 bool) const;
        ///
        int docbook(Buffer const * buf, std::ostream & os, bool mixcont) const;
        ///
@@ -560,12 +561,12 @@ private:
        int TeXCellPostamble(std::ostream &, int cell) const;
        ///
        int TeXLongtableHeaderFooter(std::ostream &, Buffer const * buf,
-                                    LatexRunParams const &, bool fragile, bool fp) const;
+                                    LatexRunParams const &, bool fp) const;
        ///
        bool isValidRow(int const row) const;
        ///
        int TeXRow(std::ostream &, int const row, Buffer const * buf,
-                  LatexRunParams const &, bool fragile, bool fp) const;
+                  LatexRunParams const &, bool fp) const;
        ///
        // helper function for ASCII returns number of newlines
        ///