From 4d5046100fa55d2e876a92e26c1966c9076f6e1a Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Tue, 23 Jul 2002 21:03:38 +0000 Subject: [PATCH] fix 172; please test git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4766 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 4 ++++ UPGRADING | 12 ++++++++++++ src/ChangeLog | 5 +++++ src/insets/ChangeLog | 9 +++++++++ src/insets/inset.h | 4 ++++ src/insets/insetfloat.h | 4 ++++ src/insets/insetfootlike.h | 4 ++++ src/insets/insetminipage.h | 4 ++++ src/insets/insettabular.h | 4 ++++ src/paragraph_pimpl.C | 17 +++++++++++++++++ 10 files changed, 67 insertions(+) diff --git a/ChangeLog b/ChangeLog index dfe35ed479..8de46652c0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2002-07-23 Jean-Marc Lasgouttes + + * UPGRADING: update to mention math lfuns changes + 2002-07-20 Jean-Marc Lasgouttes * configure.in: yet another try at the same thing diff --git a/UPGRADING b/UPGRADING index fb07587fb9..749cc484c4 100644 --- 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 ------------------ diff --git a/src/ChangeLog b/src/ChangeLog index c727c4b8e4..cc0704d62a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2002-07-23 Jean-Marc Lasgouttes + + * paragraph_pimpl.C (simpleTeXSpecialChars): close fonts before + insets which have noFontChange == true. (bug #172) + 2002-07-22 Lars Gullik Bjønnes * BufferView_pimpl.C: add connection objects and use them... diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index bcf9eb72c0..21713b8ab1 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,12 @@ +2002-07-23 Jean-Marc Lasgouttes + + * 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 * insetgraphicsParams.[Ch]: support size_type for old docs diff --git a/src/insets/inset.h b/src/insets/inset.h index 5cb7972439..f6126c4afb 100644 --- a/src/insets/inset.h +++ b/src/insets/inset.h @@ -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 diff --git a/src/insets/insetfloat.h b/src/insets/insetfloat.h index bfea7de0f7..2dcc45f9ef 100644 --- a/src/insets/insetfloat.h +++ b/src/insets/insetfloat.h @@ -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; /// diff --git a/src/insets/insetfootlike.h b/src/insets/insetfootlike.h index 3e9f642375..a5d561411a 100644 --- a/src/insets/insetfootlike.h +++ b/src/insets/insetfootlike.h @@ -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 diff --git a/src/insets/insetminipage.h b/src/insets/insetminipage.h index 729085375d..8ea8fe6dad 100644 --- a/src/insets/insetminipage.h +++ b/src/insets/insetminipage.h @@ -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; /// diff --git a/src/insets/insettabular.h b/src/insets/insettabular.h index 5014ab1641..f6e5257587 100644 --- a/src/insets/insettabular.h +++ b/src/insets/insettabular.h @@ -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(); } /// diff --git a/src/paragraph_pimpl.C b/src/paragraph_pimpl.C index 6db01a5e7d..60aebb7831 100644 --- a/src/paragraph_pimpl.C +++ b/src/paragraph_pimpl.C @@ -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);