TransWikia.com

Instant Preview on only certain content

TeX - LaTeX Asked on January 29, 2021

I am working in LyX, learning as I go. Is it possible to enable instantpreview on only certain parts of an equation?

For example, I have newcommand{aug}{fboxsep=-fboxrule!!!fbox{strut}!!!} to create an augmented matrix like:

begin{pmatrix}1 & 1 & 2 & aug & 0
2 & -1 & 1 & aug & 1
4 & 1 & 5 & aug & 1
end{pmatrix}

I’d like it if instantpreview only were enabled for the aug commands.

Thank you.

One Answer

I see two options:

A. You can choose to preview only certain math insets by selecting the math equation and going to Insert > Preview. To do this, go to Tools > Preferences > Look & Feel > Display and set "Instant preview" to "No math". For this option, the entire math inset is previewed. In your example, the entire matrix would be previewed (but you can choose not to preview other matrices or math insets).

B. You can use LyX macros, which will give you a sort of WYSIWYM preview in this case. Here are the steps:

  1. First, remove your custom LaTeX code newcommand. (you can leave your augs)
  2. Go to Insert > Math > Macro.
  3. In the "name" field put aux.
  4. In the "TeX" field put fboxsep=-fboxrule!!!fbox{strut}!!!.
  5. In the "LyX" field, put "|".

This gives the following display in LyX:

enter image description here

For more information on LyX macros, see the corresponding section in Help > Math.

Answered by scottkosty on January 29, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP