WLJS LogoWLJS Notebook

TeXView

Supports Offload
TeXView[expr_String]
TeXView[expr_]

renders expr as LaTeX expression to the screen. Use TeXForm arbitrary expression to LaTeX string.

For example:

TeXView[1/2 // TeXForm]

or directly using LaTeX:

TeXView["\\frac{1}{2}"]

It works on slides, markdown and in a normal Wolfram output cells. You can embed it too:

Plot[x, {x,0,1}, Epilog->{
  Inset[TeXView[TeXForm[y==x], ImageSize->Medium], {0.5`,0.5`}]
}]

If the equation is cropped by the container, explicitly set ImageSize -> {width, height} on TeXView. Use AlignmentPoint -> {Left, Top} when top-left alignment makes the label easier to place.

TeXForm is a blocking function, avoid using it inside Button-like, Manipulate, timers, async functions. Use non-blocking variant TexFormAsync.

Options

ImageSize

Defines the container size for the expression. For example:

TeXView["g_{11}(\\mathcal{C}_1)", ImageSize -> {100, 50}]

Alignment or AlignmentPoint

Sets the alignment of the content inside the container defined by ImageSize. Possible values include:

  • Center
  • {Center, Center}
  • {Left, Top}
  • {Right, Top}
  • ...

Live updates

It supports Offload method. The expressions can be rerendered of the underlying data changes:

str = TeXForm[Integrate[f[x], x]];
TeXView[str//Offload]

then

str = TeXForm[Integrate[f[x] x, x]];

or using a buttom:

Button["Generate", Then[TeXFormAsync[Series[Sin[x] Cos[x], {x, 0, RandomInteger[{1, 30}]}]], (str = #1)&]]

Output forms

On this page