-- AlexanderFedotov - 15-Dec-2009

Examples of Twiki Latex via MathModePlugin

In order to activate the MathModePlugin:

first disable the LatexModePlugin

then set the font size to footnotesize in order it would be equal to that of non-latex:

  • Set LATEXFONTSIZE = footnotesize

e.g. by adding the following code to the top of your page:

 
  * Set DISABLEDPLUGINS = LatexModePlugin
  * Set LATEXFONTSIZE = footnotesize

Example 1: %$ ... $% and <latex> inline

input:

asdasd %$ x $% asdasd <latex> x  y</latex> asd

output:

asdasd asdasd asd

Example 2: %\[ ... \]% inline

input:

asd %\[ a_i = b^c \]% asda

output (note: the result is in own-line and centered):

asd

asda

Example 3: this does not work

input:

%\[ \
 a_i = b^3 \
\]% asda

output:

%\[ a_i = b^3 \]% asda

Example 4 : same as ex.2

input:

asd
%\[  a_i = b^4 \]% asda

output:

asd

asda

Example 5: latex tag inline (same as ex.1)

input:

latex tag <latex> k_m </latex>

output:

latex tag

Example 6: latex tag split into few lines

input:

<latex> 
k_n  
\ k^5
</latex>

output:

Example 7: latex tag centered

input:

<center>
<latex>
k_n  = k^5
</latex>
</center>

output:

Example 8: a longer formula

input:

<center>
<latex>

        G(x; \mu, \sigma) = \frac{1}{\sqrt{2\pi}\sigma}\exp\left[-\frac{(x-\mu)^
2}{2\sigma^2}\right]

</latex>
</center>

output:

Example 9: array / text inside

input:

<center><latex>

 \text{ text before array}
 \begin{array}{lr}
   \mu_1 = 0 & (3a) \text{ text in array} \\
   \mu_2  = -\mu'_1{}^2 + \mu'_2 & (3b)  \\
   \mu_3  = 2 \mu'_1{}^3 - 3 \mu'_1 \mu'_2 + \mu'_3 & (3c)  \\
   \mu_4  = -3 \mu'_1{}^4 + 6 \mu'_1{}^2 \mu'_2 - 4 \mu'_1 \mu'_3 + \mu'_4 &(3d)
 \end{array}

</latex></center>

output:

Example 10: matrix via array

input:

<center><latex>

\mathbf{X} = \left(
\begin{array}{ccc}
x_1 & x_2 & \ldots \\
x_3 & x_4 & \ldots \\
\vdots & \vdots & \ddots
\end{array} \right)
 
</latex></center>

output:

Example 11: operations with matrices via arrayS

input:

<center><latex>

\left( \begin{array}{cc} a_{11} & a_{12} \\ a_{21}  & a_{22} \end{array} \right)
\cdot 
\left( \begin{array}{c} x\\y \end{array} \right)
= \left( \begin{array}{c} C\\D \end{array} \right)

</latex></center>

output:

Example 12: matrices w/o arrayS

input:

<center><latex>

\left(
 \begin{matrix}
1 & 2 \\
3 & 4
\end{matrix} 
\right) =\qquad
\begin{bmatrix}
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9
\end{bmatrix}

</latex></center>

output:

Example13: under/over braces

input:

<center><latex>

\underbrace{\overbrace{a+b+c}^6
\cdot \overbrace{d+e+f}^9}
_\text{meaning of life} = 42

</latex></center>

output:

Example 14: setting color

input:

<center><latex>
\color{red}
\underbrace{\overbrace{a+b+c}^6
\cdot \overbrace{d+e+f}^9}
_\text{meaning of life} = 42

</latex></center>

output:


Topic attachments
I Attachment History Action Size Date Who Comment
Cascading Style Sheet filecss tutorial.css r1 manage 0.2 K 2010-06-27 - 06:08 AlexanderFedotov  
Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r6 - 2010-07-27 - AlexanderFedotov
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback