Configuration (Server/DC)
This article will walk you through the process of configuring the LaTeX Math application.
Configuring LaTeX Math Application
You can configure the Math block template as per your requirement. To change the application configuration, go to → Manage Apps → User-installed apps → LaTeX Math → Configure. The Configure LaTeX Math page is displayed. The following are the parameters you can configure as per your requirement:
Renderer selection for math mode
This option lets you choose the default renderer to display your LaTeX math. For purposes such as placeholders in the editor and when exporting pages, LaTeX Math will always return to outputting as PNG.
The LaTeX macro requires a full LaTeX implementation and will always export as PNG using the external renderer.
Parameter Name | Default | Description |
---|---|---|
Preferred output | MATHJAX | Select the renderer(s) you want to use to display your LaTeX math. The following are the available options:
When exporting a page (e.g. to PDF), LaTeX Math will switch to SVG, PNG, or MathML as required by the exporter. When combined with the Scroll Word exporter, this allows for exports to native Word equations. |
PNG renderer | Built-in renderer (MathJax-based) | Select the default PNG renderer. The following are the available options:
|
MathJax settings
This option allows you to configure MathJax settings
Parameter Name | Default | Description |
---|---|---|
Enable MathJax context menu | Unchecked | Select the check box to display the MathJax context menu when using client-side MathJax rendering (i.e. right-click menu). |
Font | TeX | Select the font. The following are the available font options:
|
Render non-macro math | Unchecked | Check this option to render non-macro math. This will use MathJax to search for math delimited with $ $, $$ $$, \( \), and \[ \]. Any content in pages delimited by these standard LaTeX math-mode delimiters will be rendered as if it were a LaTeX Math macro. |
Disable $ $ | Checked | Uncheck this option to avoid false positives when using the Render non-macro math option. |
Font Sizes
This option allows you to configure the font size of the Confluence text and LaTeX Math text.
Parameter Name | Default | Description |
---|---|---|
Font size (Confluence text) | 14 | Specify the font size at which your Confluence setup renders text. |
Font size (LaTeX Math) | 10 | Specify the font size for LaTeX Math exports to PDF and Word. |
Automatic conversion
Parameter Name | Default | Description |
---|---|---|
Automatic conversion to math macros | Unchecked | Check this box to automatically convert old latex macros (including user macros) to newer math mode only macros where possible. No changes will be made to pages until a new version of the page is saved. This will have no effect if there are no macros to be migrated and can safely be disabled. |
Feature discovery
This option provides you with tooltips on how to work with LaTeX Math.
Parameter Name | Default | Description |
---|---|---|
Feature discovery visibility | Checked | Uncheck this box to remove the feature discovery. |
Templates
This option allows you to customize how the LaTeX macros are displayed.
Parameter Name | Default | Description |
---|---|---|
Horizontal alignment | Center | Specify the default horizontal alignment. The following are the available options:
|
Number all Math Blocks | Unchecked. | Check this option to enable numbering on all the Math Block macros. The macros are numbered only if the Anchor parameter is specified. By checking this option all the macros are numbered. |
Math Block velocity template | #htmlSafe()
## Put parenthesis around equation number:
#if ($!captionHtml && ($!captionHtml.length()>0))
#set ($captionHtml = "($captionHtml)")
#end
##
## Write block equation:
<table border=0 cellspacing=0 cellpadding=0 width=100% align="center" class="latexmath-mathblock" style="width: 100% !important;">
<tbody><tr>
<td nowrap class="latexmath-numbering">$!captionHtml</td>
<td nowrap class="latexmath-$halign">$!latexHtml</td>
</tr></tbody>
</table> | Modify the template as per your requirement. |
Math Block Reference velocity template | #htmlSafe()
#macro(doNothing)#end
## Add colon to page name:
#if ($pageNameHtml && ($pageNameHtml.length()>0))
#set ($pageNameHtml = $pageNameHtml+'<span class="latexmath-refpagejoiner">:</span>')
#end
##
<a href="$!{anchorURLHtml}" class="latexmath-mathblock-ref"$!{dataParamsHtml}>($!{pageNameHtml}$!{captionHtml})</a>#doNothing() | Modify the template as per your requirement. |
User defined macros
This option allows you to customize your LaTeX macros.
Parameter Name | Default | Description |
---|---|---|
User defined LaTeX macros | None | Custom LaTeX macros can be defined and used in all LaTeX Math macros. You can use this option to create new "commands" for frequently used combinations.
|
Editor Placeholder Settings
This option allows you to specify how the macro placeholders are rendered for the editor.
Parameter Name | Default | Description |
---|---|---|
Minimum height | 16 | Specify the minimum height for the macro placeholder to render. This ensures that the placeholder is large enough to click on in the page editor. |
Minimum width | 6 | Specify the minimum width for the macro placeholder to render. This ensures that the placeholder is large enough to click on in the page editor. |
PNG/SVG Rendering Timeout
This option allows you to configure the rendering timeout.
Parameter Name | Default | Description |
---|---|---|
Rendering timeout (milliseconds) | 10000 | Specify the length of the rendering timeout. |
External Renderer Settings
You can customize the general settings for the external PNG renderer. This option allows you to change the path of the LaTeX installation.
Parameter Name | Default | Description |
---|---|---|
LaTeX executable | latex | Specify a path to the LaTeX executable. |
Dvipng executable | dvipng | Specify a path to the LaTeX executable. |
Show latex macro in the macro browser. This does not affect Math macros | Unchecked | Check this option to display the LaTeX macro in the macro browser. |
External Renderer Settings (Advanced)
You can customize the advanced settings for the external PNG renderer.
Parameter Name | Default | Description |
---|---|---|
LaTeX header | \documentclass[fleqn]{article}
\usepackage[active,amsmath,amsthm,amssymb,bm]{preview}
\usepackage{mathtools}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{bm}
\usepackage[utf8]{inputenc}
\mathtoolsset{showonlyrefs}
\pagestyle{empty}
\begin{document} | All LaTeX rendered as png will have this appended to the beginning. |
LaTeX footer | This will be added at the end of all LaTeX rendered as png. | |
Disable preview package for LaTeX macro | Unchecked | Check this option to disable the preview package when using the LaTeX macro. The macro will not render properly if the preview package is disabled. |
Â