Version 2.4.0~RC4 Instant preview stops working when inserting floats or comments
fcanatay at gmail.com
fcanatay at gmail.com
Sat May 18 10:13:50 UTC 2024
>>>>
>>>> Alternatively, are you able to run LyX from a terminal in order to have other error messages ?
>>> Running LyX from terminal I got the following:
>>>
>>> qt.qpa.fonts: Populating font family aliases took 163 ms. Replace uses of missing font family "Serif" with one that exists to avoid this cost.
>>> Warning: Failed: dvips lyxpreviewZhflDz.dvi ... looking for PDF
>>> Error: Failed to extract metrics info from lyxpreviewZhflDz.log
>>
>> Something is wrong here. The "Failed" warning is why the preview is failing. Try running:
>>
>> lyx -dbg graphics
>>
>> and see if you get more information. You can also open the messages pane and then under "Settings" in that window activate graphics debug info.
>>
>> Riki
>>
>
> This is the error line in Messages Pane with graphics debug info:
>
> graphics/PreviewLoader.cpp (246): PreviewLoader::startLoading()
> graphics/PreviewLoader.cpp (2f0): PreviewLoader::finishedInProgress(1): processing failed for python3 -tt $$s/scripts/lyxpreview2bitmap.py --png "/private/var/folders/49/yb2413c16tn4y7gqpr1pwm5c0000gn/T/lyx_tmpdir.kZdswlpFtuiy/lyx_tmpbuf1/lyxpreviewydILJu.tex" --dpi 272 --fg 000000 --bg ffffff --bibtex=“bibtex”
OK, after digging some more into the files I think I got to the bottom of the problem.
Fist of all, those who cannot reproduce this problem are probably using a full TeX distribution. I am using Texlive Basic.
Solution: Manually installing suffix.sty (in bigfoot package) and cprotect.sty solved the problem.
Cause: As far as I can tell, the lyxpreview2bitmap.py file uses different ways to produce previews depending on file contents. When the lyx file does not contain floats or comments, previews work fine under Texlive Basic, otherwise the python routine switches to a method that needs suffix.sty and cprotect.sty, which are not installed by Texlive Basic.
Problem was mysterious because (1) it happened in LyX 2.4.0 but not in LyX 2.3.7, and (2) there was no indication that previews were not generated because these style files were missing. Perhaps something in lyxpreview2bitmap.py has changed between versions, but I’m not sure.
Suggestion: It may be useful to indicate in the LyX wiki https://wiki.lyx.org/LyX/InstantPreview that suffix.sty and cprotect.sty are additionally needed for Instant Preview to work.
Thanks to everyone who gave useful tips that helped find the cause of the problem.
Cheers,
Fatihcan Atay
More information about the lyx-devel
mailing list