Search:   Help

Navigation

Groups

LyX documentation

Edit

Shared groups

Links

LyX /

InstantPreview

Categories: InstantPreview
<< | Page list | >>

Instant Preview

What is instant preview?

Instant preview is a feature that renders math formulae inside the LyX screen using LaTeX. These are generated on the fly so you can see how they'll look in the final document without having to break your train of thought with View→DVI.

Here are some screenshots on Mac OS X and Windows:

LyX will generate previews of math insets. It will also generate previews of Include insets if you select the Show preview check box in the inset's dialog. This latter is useful if you wish to generate a preview of a LaTeX figure, for example.

How do I activate it?

You'll need to install some software (see below). Thereafter, you should enable Instant preview in the Tools→Preferences dialog. (It can be found in the Look & feel→Display pane) Previews are generated when you load a document into LyX and when you finish editing an inset. Previews of an already loaded document are not generated just by selecting the Instant preview check box.

OK, I'm interested. What do I need?

If you are on Windows and use the LyX Windows installer, instant preview should work out of the box (cf. InstantPreview under Windows). If it does not work, as well as on other OSes, you might have to install some LaTeX packages and helper programs, as described in what follows.

You need to install the LaTeX package preview.sty (part of the preview-latex package), which is contained in any of the major LaTeX distributions. Since LyX 2.4 suffix.sty (in bigfoot package) and cprotect.sty should be installed. Additionally, the following utilities have to be installed:

  • latex
  • dvips
  • gs
  • dvipng
  • dv2dt (part of the dtl package)

latex, dvips and gs should already be present on your system if you're using LyX to generate documents.

preview-latex, dvipng and dv2dt can be installed via your LaTeX distribution's package manager.

Once these packages are installed, you may have to reconfigure LyX with Tools→Reconfigure; then things should "just work".

How could I test it?

To test, I recommend that you:

  • Start LyX from the command line
  • Activate Instant Preview in the Tools→Preferences dialog, as described above.
  • Start a new document.
  • Create a new math inset a+b=c and leave the inset so that you are no longer editing it. LyX should start the process of generating the preview and if all is successful will display this preview once it is generated. If it fails, then you should be able to find the latex file that it failed to generate the bitmap image from in the temp directory. The console messages should tell you exactly where.

Changing the size of the instant preview

If the previews seem too small or too large compared to the surrounding text, you can fix it as follows:

Change the value of "Preview Size" in the Tools→Preferences dialog.

The default value is 1.0.

InstantPreview

Edit - History - Print - Recent Changes - All Recent Changes - Search
Page last modified on 2024-05-19 23:00 UTC