0

I recently did a fresh install of Fedora 29 Workstation on my laptop with Lyx 2.3.2 installed. In working with previous Lyx documents, I needed to add different .sty files to get things to work, so I did a sudo dnf install texlive-scheme-full but this installed way more than I needed. So I removed this texlive-scheme-full and just installed the packages I needed (texlive-cancel and texlive-braket). But now my instant preview isn't working. Looking at https://wiki.lyx.org/LyX/InstantPreview I installed all the packages listed that I need for instant preview to work, all except preview-latex because I can't seem to find that in the Fedora repos. I did find the tex-preview package and installed that, but the instant preview looked awful. Is there another package I need to install to make instant preview look like it first did when having tex-preview installed, or is there some other package I can install to get things working again?

Update after KJO's latest advice:

I downloaded the preview.zip folder, ran tex preview.ins and placed all the files in the /texmf/tex/latex/ directory and Lyx now shows the instant preview. However, the rendering looks pretty bad. Maybe there's a way to make the rendering look better?

enter image description here

0

I presume you are following this guide https://wiki.lyx.org/LyX/InstantPreview

The Preview package is related to preview-latex as used by auctex BUT is effectively a generic subset it is the standard preview package that should be loaded using TeX Live ManaGeR I do not know Unix well enough to advise with confidence but if you used sudo for texlive would guess you need something along the lines of sudo tlmgr install preview however I suggest you test with sudo tlmgr install --dryrun preview per the following guide to check it will work https://www.tug.org/texlive/doc/tlmgr.html#install-option...-pkg

If you have a GUI access to tlmgr (which requires the perl components) you can filter a package search to see if it is already installed. see https://www.tug.org/texlive/doc/tlmgr.html#GUI-FOR-TLMGR

Once it is downloaded you will need to consider if you need to run sudo texhash to update filename/directory database files

If you cannot use tlmgr then the uncompiled file is available here and will need to be run through TeX http://mirrors.ctan.org/macros/latex/contrib/preview.zip

To install the preview style file on its own without the entire AUCTeX package, run

tex preview.ins

If preview.ins happens to be missing, you can regenerate it by running tex docstrip on preview.dtx with the option `installer'.

Running TeX on preview.ins will then extract further files: preview.drv which you can run through LaTeX in order to get the documentation for preview.sty, preview.sty itself, a bunch of option files with extension .def and a few configuration files with extension .cfg. In case your docstrip configuration has not already taken care of that, install the files with extension .sty, .def and .cfg to a location where LaTeX will be able to find them.

The location as mentioned can be either your working folder alongside the tex file you are editing or in the correct relative location on a texmf tree. Thus wherever your …/texmf is in the texmf/tex/latex you need a /preview/ folder with the preview.sty 8x filename.def (especially the LyX one) and the prauctex.cfg (though in this LyX case unsure if that's essential)If it is in the correct position lyx will find it and in Help > Latex configuration > in my version it is 9.27 preview it should show Found: [yes]
Note in my manual it is not the correct path for the switch in my version its in Tools > Look & Feel Display then tick Display graphics & ensure Instant preview On note you can also add scaling like this

enter image description here

Your quality may differ depending on settings and packages for support from the "Additional" help page the default formats can result in rougher image rendering. Document settings > Formats > defaults to PDF (pdfLaTeX) and generally does not need the external shell escape active but your mileage may vary, the XHTML Options are by default set strict XHTML and math output should be MathML but from the help we see section 4.1 that if those are unsupported by the system it will default to image rendering Quality is also affected as per user guide section 6.12.1 Prerequisites Results should be better if pnmcrop is available from netpbm package.

  • It doesn't look like Fedora comes with or has access to tlmgr. So this option might not be viable for me. – Bo Johnson Mar 29 at 22:43
  • If you stripped to the bone without the basics of a manager there may not be enough to compile the preview since the minimal TeX Live should have some maintenance utilities, otherwise the few packages you have will likely error for lack of a supporting framework fedora info is sparse (much of it old) but a recent link here suggests a recommendation for starters of sudo dnf install texlive-latex for now you can skip bibtex and git I note the old method was yum install texlive texlive-latex but unsure if they include basics – user170109 Mar 29 at 23:59
  • So I've already installed texlive-latex and have actually been looking at link for how Fedora packages TeX Live. I don't want to do the full scheme because this uses so much space. I just tried installing the small scheme, but it doesn't look like this contains the packages for Lyx's instant preview. – Bo Johnson Mar 30 at 1:23
  • Am updating end of question to show direct link to preview source files (dtx and ins in a zip) but do not know how you will process on fedora as you need to run them through a tex command to build the sty config etc – user170109 Mar 30 at 1:27
  • I was able to get things working following your instructions, but the preview looks pretty bad, compared to what I've had in the past. I'll update my question to see what it looks like. Is there a way to get better rendering of the instant preview? – Bo Johnson Mar 30 at 15:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.