]> git.lyx.org Git - lyx.git/commitdiff
fix 172; please test
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 23 Jul 2002 21:03:38 +0000 (21:03 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 23 Jul 2002 21:03:38 +0000 (21:03 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4766 a592a061-630c-0410-9148-cb99ea01b6c8

ChangeLog
UPGRADING
src/ChangeLog
src/insets/ChangeLog
src/insets/inset.h
src/insets/insetfloat.h
src/insets/insetfootlike.h
src/insets/insetminipage.h
src/insets/insettabular.h
src/paragraph_pimpl.C

index dfe35ed479539023d7f9a8ae63a591fd8dba0f54..8de46652c0aa2c481a0f39aa47c785c8bf48740d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2002-07-23  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
+
+       * UPGRADING: update to mention math lfuns changes
+
 2002-07-20  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
 
        * configure.in: yet another try at the same thing
index fb07587fb92db60ca9f77399cedd1656dc9a5482..749cc484c4441c512fc08a6b836353ca561e3071 100644 (file)
--- a/UPGRADING
+++ b/UPGRADING
@@ -15,6 +15,18 @@ If you have your own layout files, you may need to update them a little:
 The new layout format keywords are described in the Customization
 manual.
 
+If you have your own binding files (especially math.bind), you will
+have to update them
+
+- math-insert now takes a latex macro name as argument, so that
+  "math-insert sqrt" should now be "\math-insert \sqrt"
+
+- math-greek-toggle is now gone, and should be replaced by explicit
+  bindings like
+
+  \bind "M-m g a"      "math-insert \alpha"
+
+
 Build requirements
 ------------------
 
index c727c4b8e4a3a6b4d16e46e9a93dbc5c23724b51..cc0704d62a263e1585e534fab1d047c71ff6f04c 100644 (file)
@@ -1,3 +1,8 @@
+2002-07-23  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
+
+       * paragraph_pimpl.C (simpleTeXSpecialChars): close fonts before
+       insets which have noFontChange == true. (bug #172)
+
 2002-07-22  Lars Gullik Bjønnes  <larsbj@birdstep.com>
 
        * BufferView_pimpl.C: add connection objects and use them...
index bcf9eb72c0f258eab8775915a4aea0b7467cdefb..21713b8ab1fb18d75d6dcb5a5431b2459423950f 100644 (file)
@@ -1,3 +1,12 @@
+2002-07-23  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
+
+       * insetminipage.h (noFontChange): 
+       * insettabular.h (noFontChange): 
+       * insetfootlike.h (noFontChange): 
+       * insetfloat.h (noFontChange): return true
+
+       * inset.h (noFontChange): new method, defaulting to false
+
 2002-07-22  Herbert Voss  <voss@lyx.org>
 
        * insetgraphicsParams.[Ch]: support size_type for old docs
index 5cb7972439331d759a35148d405c09fd93aebe74..f6126c4afb6a57071d57ec0767cfea5bb339f019 100644 (file)
@@ -319,6 +319,10 @@ public:
        // if this inset has paragraphs should they be output all as default
        // paragraphs with "Standard" layout?
        virtual bool forceDefaultParagraphs(Inset const *) const;
+       /** returns true if, when outputing LaTeX, font changes should
+            be closed before generating this inset. This is needed for
+            insets that may contain several paragraphs */
+       virtual bool noFontChange() const { return false; }
        //
        virtual void getDrawFont(LyXFont &) const {}
        /* needed for widths which are % of something
index bfea7de0f7fd476a7f4c89dd8a42e5889999b287..2dcc45f9ef998c0909b1bf29f19207d971765df7 100644 (file)
@@ -52,6 +52,10 @@ public:
        string const editMessage() const;
        ///
        bool insetAllowed(Inset::Code) const;
+       /** returns true if, when outputing LaTeX, font changes should
+            be closed before generating this inset. This is needed for
+            insets that may contain several paragraphs */
+       bool noFontChange() const { return true; }
        ///
        string const & type() const;
        ///
index 3e9f64237588c786a7aab4b0053564dd664eeb64..a5d561411a23f7a17f093a66e68d965309b3d5de 100644 (file)
@@ -35,6 +35,10 @@ public:
        void write(Buffer const * buf, std::ostream & os) const;
        ///
        bool insetAllowed(Inset::Code) const;
+       /** returns true if, when outputing LaTeX, font changes should
+            be closed before generating this inset. This is needed for
+            insets that may contain several paragraphs */
+       bool noFontChange() const { return true; }
 };
 
 #endif
index 729085375d531a32ccf3caa876e3aaf885d1f575..8ea8fe6dad956526b1501fc3ef417922c3185646 100644 (file)
@@ -85,6 +85,10 @@ public:
        int getMaxWidth(BufferView *, UpdatableInset const *) const;
        ///
        bool needFullRow() const { return false; }
+       /** returns true if, when outputing LaTeX, font changes should
+            be closed before generating this inset. This is needed for
+            insets that may contain several paragraphs */
+       bool noFontChange() const { return true; }
        ///
        bool showInsetDialog(BufferView *) const;
        ///
index 5014ab164116af8282f24b6f619f838d14dacccc..f6e52575877b78ca48819029962986bda05e5d91 100644 (file)
@@ -129,6 +129,10 @@ public:
        bool insetAllowed(Inset::Code code) const;
        ///
        bool isTextInset() const { return true; }
+       /** returns true if, when outputing LaTeX, font changes should
+            be closed before generating this inset. This is needed for
+            insets that may contain several paragraphs */
+       bool noFontChange() const { return true; }
        ///
        bool display() const { return tabular->IsLongTabular(); }
        ///
index 6db01a5e7df0ae03f861c3b6e0ed34b185e8b84a..60aebb7831e47e5523e1baece9e1be3008990d3c 100644 (file)
@@ -345,6 +345,23 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const * buf,
                                close = true;
                        }
 
+#ifdef WITH_WARNINGS
+#warning Bug: we can have an empty font change here!
+// if there has just been a font change, we are going to close it
+// right now, which means stupid latex code like \textsf{}. AFAIK,
+// this does not harm dvi output. A minor bug, thus (JMarc)
+#endif
+                       // some insets cannot be inside a font change command
+                       if (open_font && inset->noFontChange()) {
+                               column +=running_font.
+                                       latexWriteEndChanges(os,
+                                                            basefont,
+                                                            basefont);
+                               open_font = false;
+                               basefont = owner_->getLayoutFont(bparams);
+                               running_font = basefont;
+                       }
+
                        int tmp = inset->latex(buf, os, moving_arg,
                                               style.free_spacing);