\begin_layout Standard
LyX allows you to generate previews of sections of your document on the
fly so you can see how they will look in the final document without having
- to break your train of thought with
-\family sans
-View\SpecialChar \menuseparator
-DVI
-\family default
-.
+ to break your train of thought with viewing the output.
+\end_layout
+
+\begin_layout Subsection
+Prerequisites
\end_layout
\begin_layout Standard
-If you would for example like to see in LyX your math formulas typeset by
- LaTeX, install the LaTeX-package
+To get previews working, you need the LaTeX package
\series bold
preview-latex
\series default
\end_inset
- as explained below, and turn on
+ (on some systems named simply
+\series bold
+preview
+\series default
+) installed.
+ If it is not already installed, you will find it in the TeX-catalogue,
+
+\begin_inset CommandInset citation
+LatexCommand cite
+key "TeXCatalogue"
+
+\end_inset
+
+ or in the package manager of your LaTeX-system.
+ You obtain prettier results if you install the program
+\family typewriter
+pnmcrop
+\family default
+ from the
+\family typewriter
+netpbm
+\family default
+ package; for LyX on Windows this program and also the LaTeX-package is
+ automatically installed together with LyX.
+\end_layout
+
+\begin_layout Subsection
+Enabling previews
+\end_layout
+
+\begin_layout Standard
+If you would for example like to see in LyX your math formulas typeset by
+ LaTeX, activate the option
\family sans
-Instant
+Display
\begin_inset space ~
\end_inset
-preview
+Graphics
\family default
in the
\family sans
Tools\SpecialChar \menuseparator
Preferences
\family default
-dialog under Look
+dialog under
+\family sans
+Look
\begin_inset space ~
\end_inset
\end_inset
feel\SpecialChar \menuseparator
-Display.
+Display
+\family default
+.
+ Then set
+\family sans
+Instant
+\begin_inset space ~
+\end_inset
+
+Preview
+\family default
+ to
+\family sans
+On
+\family default
+.
The
\family sans
Preview
\begin_layout Standard
Previews are generated when you load a document into LyX and when you finish
editing an inset.
- Previews of an already loaded document are
-\emph on
-not
-\emph default
- generated just by selecting the
+\end_layout
+
+\begin_layout Standard
+\begin_inset Note Greyedout
+status open
+
+\begin_layout Plain Layout
+
+\series bold
+Note:
+\series default
+ Previews of an already loaded document are not in every case immediately
+ generated by activating the option
\family sans
-Instant
+Display
\begin_inset space ~
\end_inset
-preview
+Graphics
\family default
- check box, you have to reopen the documents to activate the previews.
+.
+ Reopening the documents assures to get previews.
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Selected document parts
\end_layout
\begin_layout Standard
-LyX will generate previews of math insets.
- It will also generate previews of included insets if you select the
+Besides math there are other cases where you might like to see a preview,
+ fox example things that LyX cannot render like rotated parts or things
+ which are not yet supported by LyX.
+ To do this, insert a preview inset via the menu
\family sans
-Show
+Insert\SpecialChar \menuseparator
+Preview
+\family default
+.
+ Insert or paste the stuff that you want to preview into this inset.
+ The preview will be generated when the cursor is outside the preview inset.
+ If you click on the preview, you can edit the previewed stuff.
+\end_layout
+
+\begin_layout Standard
+An example: To create rotated boxes, you use the LaTeX command
+\series bold
+
+\backslash
+rotatebox
+\series default
+ which is not yet supported by LyX.
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+
+\series bold
+
+\backslash
+rotatebox
+\series default
+ is explained in section
+\emph on
+Rotated and Scaled Boxes
+\emph default
+ of the
+\emph on
+Embedded
\begin_inset space ~
\end_inset
-preview
-\family default
- check box in the insert dialog.
- This is useful if you wish to generate a preview of a LaTeX figure, for
- example.
+Objects
+\emph default
+ manual.
+\end_layout
+
+\end_inset
+
+ Instead of the TeX Code boxes you want to see in LyX the final rotated
+ boxes, for example to adjust the rotation angle to fit with the surrounding
+ text.
+ Therefore you create a preview inset and copy the text with the rotated
+ boxes into in.
+ Here is the result:
\end_layout
\begin_layout Standard
-To get previews working, you need the LaTeX package
+\begin_inset Preview
+
+\begin_layout Standard
+This is a line
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+
+\backslash
+rotatebox[origin=r]{-60}{
+\end_layout
+
+\end_inset
+
+
+\begin_inset Box Doublebox
+position "c"
+hor_pos "c"
+has_inner_box 0
+inner_pos "c"
+use_parbox 0
+use_makebox 0
+width "1in"
+special "width"
+height "1in"
+height_special "totalheight"
+status collapsed
+
+\begin_layout Plain Layout
+with rotated
+\end_layout
+
+\end_inset
+
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+}
+\end_layout
+
+\end_inset
+
+ framed text
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+
+\backslash
+rotatebox[origin=lb]{60}{
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula $\int A\,\mathrm{d}x=B$
+\end_inset
+
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+}
+\end_layout
+
+\end_inset
+
+ and a formula.
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Previewing works also for colors.
+ In this example a special framed, colored box was created using the LaTeX
+ command
\series bold
-preview-latex
+
+\backslash
+fcolorbox
\series default
- (on some systems named simply
+:
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+
\series bold
-preview
+
+\backslash
+fcolorbox
\series default
-) installed.
- If it is not already installed, you will find it in the TeX-catalogue,
-
-\begin_inset CommandInset citation
-LatexCommand cite
-key "TeXCatalogue"
+ is explained in section
+\emph on
+Colored Boxes
+\emph default
+ of the
+\emph on
+Embedded
+\begin_inset space ~
+\end_inset
+
+Objects
+\emph default
+ manual.
+\end_layout
\end_inset
- or in the package manager of your LaTeX-system.
- You obtain prettier results if you install the program
-\family typewriter
-pnmcrop
-\family default
- from the
-\family typewriter
-netpbm
-\family default
- package; for LyX on Windows this program is automatically installed together
- with LyX.
+
\end_layout
\begin_layout Standard
-\begin_inset VSpace bigskip
+\begin_inset Preview
+
+\begin_layout Standard
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+
+\backslash
+fboxrule 1mm
+\backslash
+fboxsep 1mm
+\end_layout
+
+\end_inset
+
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+
+\backslash
+fcolorbox{cyan}{magenta}{
+\end_layout
+
+\end_inset
+
+This is text within a colored, framed box.
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
\end_inset
\end_layout
\begin_layout Standard
-You can furthermore preview the LaTeX source of the whole document or parts
- of it.
+\begin_inset VSpace medskip
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+If LyX does not show a preview, assure that you enabled previews as described
+ above and also assure that TeX Code in the preview inset is valid and that
+ you loaded the LaTeX packages in your document preamble that are required
+ by the TeX Code.
+ If LyX cannot create a preview, you will in most cases also not be able
+ to view your document due to LaTeX errors.
+ So if you have to use some TeX Code and don't know if it is correct, the
+ preview inset is a nice method to check it without the need to view the
+ whole document.
+\end_layout
+
+\begin_layout Subsection
+LaTeX source code
+\end_layout
+
+\begin_layout Standard
+You can preview the LaTeX source of the whole document or parts of it.
Use the menu
\family sans
View\SpecialChar \menuseparator
manual.
\end_layout
+\begin_layout Subsection
+Preview
+\end_layout
+
+\begin_layout Standard
+Inserts a preview inset, see section
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "sec:Previewing-snippets-of"
+
+\end_inset
+
+ for a description.
+\end_layout
+
\begin_layout Section
The Navigate Menu
\begin_inset Index idx