# LyX | Automatic Wrap by Preview?

Is it possible in LyX to set-up Wrap By Preview for TeX code (written in those TeX code boxes)? I want to set-up something that similar to Instant Preview, only for TeX.

Right now, the only way that I know of to see inside a LyX document the generated is by right-clicking on a TeX box, and clicking on `Wrap by Preview`. I want to automate that with maybe some script that can be written for LyX (or something simpler, if it's possible).

It is on purpose that there is no automatic way of doing this. ERT boxes are often incomplete by themselves. For example, I might have the ERT box:

``````\textbf{
``````

then I have some text, then in another ERT box:

``````}
``````