On Sun, Apr 26, 2015 at 02:50:51PM +0200, Kornel Benko wrote:

> Sorry for private mail,
> I didn't want to pollute the bug-tracker too much.

I think this is better discussed on the list rather than privately.
Actually, I also think that if this kind of discussions only take place
on the bug tracker they risk to go unnoticed until their results bite you.

> The reason for 0bb378ba/lyxgit was non-working preview of some tex macros
> not known by lyx, although the file compiles with e.g. lualatex.

Sorry, this is very vague and doesn't tell me anything. The issue raised
on the bug tracker would have been solved by the one-liner patch I posted
there. Maybe other similar issues can be solved similarly.

> I would be _very_ unhappy to get this 'behaviour' back.

But I am _very_ unhappy with the current 'behaviour' in master.

> But why not change the lyxpreview2bitmap.py instead?

What do you mean? If you tell it to use pdflatex, it will use pdflatex,
thus defeating the superior dvipng route. Then, there is another aspect
to consider. Before http://www.lyx.org/trac/changeset/0bb378ba/lyxgit,
the previews were always generated using dvipng, unless non-TeX fonts
were used, in which case xelatex and the inferior legacy method was used.
The scripts also try to be clever, by detecting the presence of
postscript specials that dvipng cannot handle and using the legacy
method in those cases.

In this way, all previews were generated in the same way for all users.
But now, if the document doesn't set a default output, the overall
default output set in the preferences is used. This means that we may get
different results for different users, leading to seemingly mysterious
behaviours (see, for example, the discussions in #7850 and #8258).

I am for reverting http://www.lyx.org/trac/changeset/0bb378ba/lyxgit
and adopting the much simpler patch attached to #9371 for solving that
specific issue.

If this is not the opinion of the majority, then something has to be
done for solving the problem of the inferior quality of the previous
generated by the legacy method and the problem of its slowness.

I think that the poor quality is due to the use of the T1 font encoding
that forbids the use of vector fonts for the previews. This could be solved
by using either the "lmodern" or the "ae" package. But there would still
the problem of the slowness of the legacy method (it's about 10 times
slower than the dvipng method), mainly due to the use of ghostscript.
Also in this case there could be a solution, by using alternative methods
for generating pngs. For example, pdftocairo can generate pngs and is much
faster than gs. 

Still, I would see this as a palliative and think that reverting the
offending commit is better. Let's see what others think.

> Am Sonntag, 26. April 2015 um 11:55:32, schrieb LyX Ticket Tracker 
> <[email protected]>
> > #9371: Math Preview doesn’t work in LuaTeX and XeTeX output modes by default
> > ---------------------------+----------------------------
> >  Reporter:  sriggs         |       Owner:  lasgouttes
> >      Type:  defect         |      Status:  fixedinmaster
> >  Priority:  normal         |   Milestone:  2.1.4
> > Component:  preview-latex  |     Version:  2.1.2
> >  Severity:  normal         |  Resolution:
> >  Keywords:  patch          |
> > ---------------------------+----------------------------
> > 
> > Comment (by forenr):
> > 
> >  It is called from lyxpreview2bitmap.py. If you add "-v" to the converters
> >  you cite, you will see the following in 2.1:
> >  {{{
> >  Progress: Starting
> >  /usr/local/src/lyx/lyx-2.1.x/lib/scripts/lyxpreview2bitmap.py...
> >  Progress: Output format: png
> >  Progress: Foreground color: 000000
> >  Progress: Background color: faf0e6
> >  Progress: Resolution (dpi): 144
> >  Progress: File to process:
> >  /tmp/lyx_tmpdir.ZHUjCsVz2004/lyx_tmpbuf1/lyxpreviewwE2004.tex
> >  Progress: Latex command: latex
> >  Progress: Latex produces pdf output: False
> >  Progress: Bibtex command: bibtex
> >  Progress: Lilypond-book command: None
> >  Progress: Preprocess through lilypond-book: False
> >  Progress: Altering the latex file for font size and colors
> >  Progress: Running latex "lyxpreviewwE2004.tex"
> >  Progress: Checking if a bibtex run is necessary
> >  Progress: Checking if a latex rerun is necessary
> >  Progress: Running dv2dt "lyxpreviewwE2004.dvi"
> >  Progress: Running dvipng -Ttight -depth -height -D 144 -fg "rgb 0.000000
> >  0.00000
> >  0 0.000000" -bg "rgb 0.980392 0.941176 0.901961"  "lyxpreviewwE2004.dvi"
> >  }}}
> > 
> >  while, after [0bb378ba/lyxgit], in 2.2 we now have:
> > 
> >  {{{
> >  Progress: Starting /usr/local/src/lyx/lyx-
> >  devel/lib/scripts/lyxpreview2bitmap.py...
> >  Progress: Output format: png
> >  Progress: Foreground color: 000000
> >  Progress: Background color: faf0e6
> >  Progress: Resolution (dpi): 144
> >  Progress: File to process:
> >  /tmp/lyx_tmpdir.yOgagFDw2956/lyx_tmpbuf0/lyxpreviewes2956.tex
> >  Progress: Latex command: pdflatex
> >  Progress: Latex produces pdf output: True
> >  Progress: Bibtex command: bibtex
> >  Progress: Lilypond-book command: None
> >  Progress: Preprocess through lilypond-book: False
> >  Progress: Altering the latex file for font size and colors
> >  Progress: Using the legacy conversion method (PDF support)
> >  Progress: Running pdflatex "lyxpreviewes2956.tex"
> >  Progress: Running gs -dNOPAUSE -dBATCH -dSAFER -sDEVICE=png16m
> >  -sOutputFile="lyxpreviewes2956%d.png" -dGraphicsAlphaBit=4
> >  -dTextAlphaBits=4 -r144.000000 "lyxpreviewes2956.pdf"
> >  }}}
> > 
> >  which produces poorer quality previews and takes about 10 times the time
> >  needed by using dvipng instead of gs. This is clearly noticeable when you
> >  have a lot of previews. In a document of mine with about 250 previews,
> >  producing them takes less than 3 seconds in 2.1 but over 30 seconds in
> >  2.2.
> > 
> > 



-- 
Enrico

Reply via email to