Here is a patch to enable the user to get the right
font size for the previews.

Herbert


-- 
http://www.lyx.org/help/
Index: src/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v
retrieving revision 1.786
diff -u -r1.786 ChangeLog
--- src/ChangeLog       5 Jul 2002 21:24:12 -0000       1.786
+++ src/ChangeLog       8 Jul 2002 06:58:45 -0000
@@ -1,3 +1,8 @@
+2002-07-08  Herbert Voss <[EMAIL PROTECTED]>
+
+       * lyxrc.[Ch]: introduce \preview_size_factor to get the right
+       fontsize on screen for the math-preview
+
 2002-07-05  Angus Leeming  <[EMAIL PROTECTED]>
 
        * BufferView_pimpl.C (buffer): generate previews if desired.
Index: src/lyxrc.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxrc.C,v
retrieving revision 1.118
diff -u -r1.118 lyxrc.C
--- src/lyxrc.C 26 Jun 2002 08:59:25 -0000      1.118
+++ src/lyxrc.C 8 Jul 2002 06:58:50 -0000
@@ -96,6 +100,7 @@
        { "\\popup_font_encoding", LyXRC::RC_POPUP_FONT_ENCODING },
        { "\\popup_normal_font", LyXRC::RC_POPUP_NORMAL_FONT },
        { "\\preview", LyXRC::RC_PREVIEW },
+       { "\\preview_size_factor", LyXRC::RC_PREVIEW_SIZE_FACTOR },
        { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
        { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
        { "\\print_command", LyXRC::RC_PRINT_COMMAND },
@@ -949,6 +972,11 @@
                                preview = lexrc.getBool();
                        break;
 
+               case RC_PREVIEW_SIZE_FACTOR:
+                       if (lexrc.next())
+                               preview_size_factor = lexrc.getFloat();
+                       break;
+
                case RC_LAST: break; // this is just a dummy
                }
        }
Index: src/lyxrc.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxrc.h,v
retrieving revision 1.60
diff -u -r1.60 lyxrc.h
--- src/lyxrc.h 26 Jun 2002 08:59:25 -0000      1.60
+++ src/lyxrc.h 8 Jul 2002 06:58:50 -0000
@@ -121,6 +121,7 @@
        RC_LABEL_INIT_LENGTH,
        RC_DISPLAY_GRAPHICS,
        RC_PREVIEW,
+       RC_PREVIEW_SIZE_FACTOR,
 #ifdef USE_PSPELL
        RC_USE_PSPELL,
 #endif
@@ -347,9 +351,11 @@
        ///
        string display_graphics;
        ///
        bool show_banner;
        ///
        bool preview;
+       ///
+       float preview_size_factor;
 private:
        /// Is a bind file already (or currently) read?
        bool hasBindFile;
Index: src/graphics/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/graphics/ChangeLog,v
retrieving revision 1.85
diff -u -r1.85 ChangeLog
--- src/graphics/ChangeLog      6 Jul 2002 12:50:09 -0000       1.85
+++ src/graphics/ChangeLog      8 Jul 2002 06:58:59 -0000
@@ -1,3 +1,9 @@
+2002-07-08  Herbert Voss  <[EMAIL PROTECTED]>
+
+       * PreviewLoader.C: use of (rc_)preview_size_factor to get the right
+       font-size! 1.0 is the default, which is 0.01*zoom*size. On some
+       machines it's better to use a 0.9
+
 2002-07-06  Angus Leeming  <[EMAIL PROTECTED]>
 
        * PreviewLoader.C: ensure that the metrics data is used by the
Index: src/graphics/PreviewLoader.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/graphics/PreviewLoader.C,v
retrieving revision 1.4
diff -u -r1.4 PreviewLoader.C
--- src/graphics/PreviewLoader.C        6 Jul 2002 12:50:09 -0000       1.4
+++ src/graphics/PreviewLoader.C        8 Jul 2002 06:59:00 -0000
@@ -406,7 +406,7 @@
        // The conversion command.
        ostringstream cs;
        cs << pconverter_->command << " " << latexfile << " "
-          << tostr(0.01 * lyxrc.dpi * lyxrc.zoom);
+          << tostr(0.01 * lyxrc.preview_size_factor * lyxrc.dpi * lyxrc.zoom);
 
        string const command = cs.str().c_str();
 
@@ -498,7 +498,7 @@
        Buffer & tmp = const_cast<Buffer &>(buffer_);
        // Dump the preamble only.
        tmp.makeLaTeXFile(os, string(), true, false, true);
-
+       
        // Loop over the insets in the buffer and dump all the math-macros.
        Buffer::inset_iterator it  = buffer_.inset_const_iterator_begin();
        Buffer::inset_iterator end = buffer_.inset_const_iterator_end();
@@ -512,7 +512,7 @@
        // Use the preview style file to ensure that each snippet appears on a
        // fresh page.
        os << "\n"
-          << "\\usepackage[active,dvips,tightpage]{preview}\n"
+          << "\\usepackage[active,dvips,tightpage,showlabels]{preview}\n"
           << "\n";
 
        // This piece of PostScript magic ensures that the foreground and

Reply via email to