This wiki supports \LaTeX markup.

The markup can be either in an in-line macro, or a markup covering one or more lines. The former allows markup within a normal text sentence.

The following examples show the raw text, followed by the resulting output.

In-Line Macro Markup

An in-line macro begins with <<latex( and ends with )>>. For math mode, include the macro definition within $...$. The following example uses math mode:

The formula <<latex($ \sqrt{l^2 + w^2} $)>> is the diagonal of a rectangle with sides <<latex($l$)>> and <<latex($w$)>>.

The formula $ \sqrt{l^2 + w^2} $ is the diagonal of a rectangle with sides $l$ and $w$.

In-Line Format

The \LaTeX format is set for the whole page with #format instruction:

#format inline_latex

This mode just formats the $..$ formulas and $$..$$ for display mode, but accepts all regular wiki syntax. It's a shortcut for <<latex($..$)>>

Value $\pi^2/6$ is $\sum_{i=1}^{\infty} {1 \over i^2}$.
Or separately in display block
 $$ {\pi^2\over 6} = \sum_{i=1}^n {1 \over i^2} $$

Value $\pi^2/6$ is $\sum_{i=1}^{\infty} {1 \over i^2}$. Or separately in display block

/!\ Note: using $..$ or $$..$$ not only switches to $\textrm\LaTeX$ but also to a math mode. So if you need to display non-math in-line construct such as "$\textrm\TeX$" fontogram, use either the in-line macro <<latex(\TeX)>> or explicitly switch from text mode from math mode $\textrm\TeX$.

Multi-Line Markup

Multi-line markup begins with a line {{{#!latex and ends with a line }}}. See example below. Note that the last line of the raw text is not shown, since }}} ends the raw text display:

{{{#!latex
If $e_1 \dots e_n$ is a basis for $E^n$ then \[ v = \sum e_jv^j = ev \qquad (\textrm{column} \,v^j) \]

If $\sigma ^1 \dots \sigma ^n$ is a dual basis for linear functionals in $E^{\star}$, then \[ \sigma ^i(e_j)=\delta ^i_j \]

If $e_1 \dots e_n$ is a basis for $E^n$ then \[ v = \sum e_jv^j = ev \qquad (\textrm{column} \,v^j) \]

If $\sigma ^1 \dots \sigma ^n$ is a dual basis for linear functionals in $E^{\star}$, then \[ \sigma ^i(e_j)=\delta ^i_j \]

Preamble

Preamble set locally affects only the current format block:

{{{#!latex
\usepackage{cmbright}
%%end-prologue%%

With preamble \usepackage{cmbright}


Value $\pi^2/6$ is $\sum_{i=1}^{\infty} {1 \over i^2}$.
Or in display mode:
 $$ {\pi^2\over 6} = \sum_{i=1}^\infty {1 \over i^2} $$

Common external preamble can be set for all \LaTeX instances on the page with latex_preamble #pragma:

#pragma latex_preamble LaTeX/CommonPreamble

The previous example uses its own preamble, the example below picks up the page-wide preamble specified in LaTeX/CommonPreamble :

Without preamble

Value $\pi^2/6$ is $\sum_{i=1}^{\infty} {1/i^2}$.
Or in display mode:
 $$ \pi^2 = \sum_{i=1}^\infty {6 \over i^2} $$

Pragma latex_preamble also affects the style of all \LaTeX code in inline_latex format mode.

Combining In-Line and Multi-Line Formats

To produce rich $\textrm\LaTeX$ formatting that has the convenience of in-lining expressions in otherwise HTML text, searchable by engines, and complex display modes and environments of $\textrm\LaTeX$ available in multi-line, it is possible to freely mix both modes.

To mix in-line and multi-line modes, declare page-wide pragma for #format inline_latex and continue to use {{{#!latex ... }}} for multi-line passages.

Examples

  1. Cards: 10$\clubsuit$ J$\diamondsuit$ Q$\heartsuit$ K$\spadesuit$.

  2. In-line macro that outputs over several lines:
    • If $f(x) = 3x + 7$ and $g(x) = x + 4$ then \[ f(x) + g(x) = 4x + 11 \] and \[ f(x)g(x) = 3x^2 + 19x +28. \]

  3. APL characters are available with the wasysym package:

    • 
$ \quad \APLdown \, r \gets tieno$

$ [1] \, r \gets (( \iota \rho r) \, \epsilon \, r \gets 0, \APLbox fnums) \, \iota \, 0$

$\quad \APLdown$

Notes

The markup works by converting the \LaTeX output into png files that are added as inline images. There may be a delay when the page is first rendered. Each page is cached, so subsequent reads are fast. If necessary, rebuild the cache by selecting menu More Actions|Delete Cache.

Additional Resources


Further contributions by OlegKobchenko.

LaTeX (last edited 2009-09-11 22:07:19 by OlegKobchenko)