You are not logged in. Click here to log in.

codebeamer Application Lifecycle Management (ALM)

Search In Project

Search inClear

Math Plugin

This page demonstrates the math plugin with its parameters, syntax and other details.Math plugin is capable of rendering mathematical formulas in wiki. These formulas are defined in the powerful LaTex language and are displayed as images embedded in Wiki documents.

Since codebeamer release 20.11-LTS (CARMEN).

Supported LaTeX Commands

The plugin renders the LaTeX commands with MathJax 2.7.7.

For the supported LaTeX commands, see https://docs.mathjax.org/en/v2.7-latest/tex.html#supported-latex-commands.

Math Plugin Parameters

  • width='400' - The width is dynamic. The value of this parameter can be exceeded, however, it is not recommended
  • fontsize='24' - Overrides the default font size which is 12 px
  • align='center' - Align the math expression to the center
  • title='optional tooltip for the rendered image' - Title of the rendered image
  • cache='false' - True or false parameter to turn cache on or off. The default value is true
  • id='artifact Id which contains the formula'. - Documents can be linked with ids from the Documents page of the relevant project
  • src='source URL or attachment name' - Alternative location of the LaTeX text or formula
  • text='alternatively you can put the text here'. - Not recommended; exists only for backwards compatibility
Since codebeamer release 20.11-SP2 (CARMEN), the font size for the LaTeX plugin can be modified globally in the Application configuration.
"latexPlugin" : {
    "defaultFontSizePx" : 24
}

The default, as well as the minimum, value for defaultFontSizePx is 12. Individual font size settings on the plugin markup level overrides the global setting, therefore, the size can be less than 12 px.


Deprecated parameters (not processed):

  • usePng='true' - By default, a PNG formatted image is rendered. The default value is true. Changing this setting to false generates a GIF image.
  • density='120' - The DPI setting for the generated image.
  • timeout='30' - Timeout in seconds to render the content.


Inline Mathematics Expressions

Syntax for Inline Math

When

[{Math

a \ne 0
}]

there are two solutions to

[{Math

ax^2 + bx + c = 0
}]

Rendered

When

\( a \ne 0 \)

there are two solutions to

\( ax^2   bx   c = 0 \)

Alternative Syntax

Inline math mode delimiters \(...)\ or $...$ can be used, however, are not necessary. The preferred syntax does not contain any start-stop commands.


[{Math

\(E=mc^2\)
}]

\(E=mc^2\)

[{Math

$E=mc^2$
}]
\( E=mc^2 \)

Centered Equation

Syntax for centered equations:


[{Math align='center'

x = {-b \pm \sqrt{b^2-4ac} \over 2a}.
}]

\( x = {-b \pm \sqrt{b^2-4ac} \over 2a}. \)


Display Style Syntax

Display style delimiters are not processed, and are rendered as inline style. Use the align='center' syntax to achieve display (centered) style.


\[...\] or $$...$$


[{Math

\[x = {-b \pm \sqrt{b^2-4ac} \over 2a}\]
}]

\( x = {-b \pm \sqrt{b^2-4ac} \over 2a} \)

[{Math

$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}$$
}]
\( x = {-b \pm \sqrt{b^2-4ac} \over 2a} \)

\begin{equation} works, but is rendered as inline math:


[{Math

\begin{equation}
e^{\pi i} + 1 = 0
\end{equation}
}]

\begin{equation} e^{\pi i}   1 = 0 \end{equation}

Changing Font Size

By default, the math plugin uses 12 px font size, however, this value can be changed by modifying the fontsize attribute. The unit is pixels.


[{Math fontsize='32' align='center'

\frac{a\bcancel{b}}{\bcancel{b}}=a
}]

\( \frac{a\bcancel{b}}{\bcancel{b}}=a \)

Use numbers only as fontsize values, because the plugin does not process units. By providing the px unit after the value, the fontsize is set back to 12.

[{Math fontsize='32px' align='center'

\ce{ C6H5-CHO }
}]

\( \ce{ C6H5-CHO } \)


Loading Text from a File

Files in .txt format can be uploaded to the Documents page of the relevant project and linked with their ids to the LaTeX plugin. Use only one equation without control characters.

[{Math id='12345'

}]