On Monday 08 July 2002 3:41 pm, Kornel Benko wrote:
> On Monday 08 July 2002 16:18, Angus Leeming wrote:
> > Is the lyxpreview2ppm.sh up-to-date (I made some changes, one of which
> > broke it.)
>
> It is always the newest. (Directly from source)
>
> > What happens if you run lyxpreview2ppm.sh directly on 0lyxpreview.tex?
>
> Hundreds of errors. missing '$' inserted etc.
>
> > (make a copy of this file, because the script will delete it).
>
> Not here, because the script ended prematurelly.
>
> First error is in line 1098
>
> line 1096:
> ...................
> \begin{preview}
> \begin{eqnarray}
> -\frac{1}{2}(n-1)c\lambda \Delta R &  & \label{4_1_3}\\
> =\sum _{\alpha }\sum _{i<j}2\chi (\alpha )_{ij}\left(\sigma (\alpha
> )_{i}-\sigma (\alpha )_{j}\right)^{2} & - & \left(\lambda
> -(n-1)R\right)\lambda ^{2}c+\sum _{\alpha }\left\Vert B(\alpha
> )_{ijk}\right\Vert ^{2}+\nonumber \\ & + & \frac{1}{n+2}\lambda c\{
> 3\lambda ^{2}-4(n-1)\lambda R+2n(n-1)R^{2}\} ;\nonumber \end{eqnarray}
>
> \end{preview}
> .......................
> ! Missing $ inserted.
> <inserted text>
>                 $
> l.1098 ...n-1)c\lambda \Delta R &  & \label{4_1_3}
>                                                   \\
>
> And so on ...
>
>       Kornel


Try modifying src/graphics/PreviewLoader.C

void PreviewLoader::Impl::dumpPreamble(ostream & os) const
{
        // Why on earth is Buffer::makeLaTeXFile a non-const method?
        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();

        for (; it != end; ++it) {
                if ((*it)->lyxCode() == Inset::MATHMACRO_CODE) {
                        (*it)->latex(&buffer_, os, true, true);
                }
        }

        // Use the preview style file to ensure that each snippet appears on a
        // fresh page.
        os << "\n"
-          << "\\usepackage[active,delayed,dvips,tightpage,showlabels]{preview}\n"
+          << "\\usepackage[active,delayed,dvips,tightpage]{preview}\n"
           << "\n";

        // This piece of PostScript magic ensures that the foreground and
        // background colors are the same as the LyX screen.
        string fg = lyx_gui::hexname(LColor::preview);
        if (fg.empty()) fg = "000000";

        string bg = lyx_gui::hexname(LColor::background);
        if (bg.empty()) bg = "ffffff";

        os << "\\AtBeginDocument{\\AtBeginDvi{%\n"
           << "\\special{!userdict begin/bop-hook{//bop-hook exec\n"
           << "<" << fg << bg << ">{255 div}forall setrgbcolor\n"
           << "clippath fill setrgbcolor}bind def end}}}\n";
}

Reply via email to