-
MathType
-
WirisQuizzes
-
Nubric
-
CalcMe
-
MathPlayer
-
Store FAQ
-
MathFlow
-
BF FAQ
-
Miscellaneous
-
Wiris Integrations
Toolbar XML reference
Reading time: 4minReference for the XML syntax used to customize the MathType toolbar.
Summary
The MathType toolbar can be customized using an XML definition passed to the toolbar editor parameter.
This reference describes the XML elements, attributes, and syntax used to define toolbar layouts. It does not list all available toolbar item identifiers. To find the identifiers for built-in tabs, sections, and buttons, see Toolbar icons reference.
Configuration
Toolbar XML is passed as the value of the toolbar editor parameter. See Configure the MathType toolbar for configuration examples.
Toolbar vocabulary
A MathType toolbar is organized into the following parts:
| Term | Description |
|---|---|
| Toolbar | The complete toolbar configuration. |
| Tab | A top-level group in the toolbar. |
| Section | A group of related toolbar items inside a tab. |
| Item | A built-in toolbar button. |
| Custom button | A developer-defined button that inserts custom MathML. |
The XML definition uses these concepts to remove, move, add, or customize toolbar elements.
Root element
<toolbar>
Defines the toolbar configuration. You can either start from an existing toolbar:
<toolbar ref="general"/> or define a custom toolbar structure.
Attributes
| Attribute | Description | Values | Required |
|---|---|---|---|
ref |
Base toolbar to customize. |
general, quizzes, chemistry, evaluate, PARCC_Grade3_5, PARCC_Grade6_8, PARCC_Grade9_12, prototype
|
Yes |
removeLinks |
Removes external links from the toolbar. |
true, false
|
No |
See Toolbar icons reference for a list of available toolbar identifiers.
Tabs
<tab>
Defines or modifies a toolbar tab.
<tab ref="general">
...
</tab>Attributes
| Attribute | Description |
|---|---|
ref |
Existing tab identifier. |
name |
Name for a new custom tab. |
empty |
Removes the existing contents before adding new items. |
rows |
Number of rows used to arrange the tab contents. |
layout |
Layout used to arrange the tab contents. |
extraRows |
Number of rows used in the extra area. |
extraLayout |
Layout used in the extra area. |
before |
Inserts the tab before another tab. |
after |
Inserts the tab after another tab. |
Remove a tab
Use <removeTab> to remove an existing tab:
<removeTab ref="arrows"/>Move a tab
To move a tab, remove it and add it again in the desired position:
<removeTab ref="symbols"/>
<tab ref="symbols" before="matrices"/>Sections
<section>
Defines a section inside a tab.
<section>
<item ref="fraction"/>
<item ref="squareRoot"/>
</section>Attributes
| Attribute | Description |
|---|---|
position |
Position of the section inside the tab. |
rows |
Number of rows. |
layout |
Layout used to arrange items. |
extraRows |
Number of rows used in the extra area. |
extraLayout |
Layout used in the extra area. |
before |
Inserts the section before another section. |
after |
Inserts the section after another section. |
Items
<item>
Adds an existing toolbar button.
<item ref="fraction"/>Attributes
| Attribute | Description |
|---|---|
ref |
Identifier of the toolbar item. |
before |
Inserts the item before another item. |
after |
Inserts the item after another item. |
extra |
Adds the item to the section's extra area. |
See Toolbar icons reference for a list of available items identifiers.
<removeItem>
Removes an existing toolbar item.
oveItem ref="fraction"/>Attributes
| Attribute | Description |
|---|---|
ref |
Identifier of the item to remove. |
<empty>
Adds empty space to adjust the toolbar layout.
<empty/>Custom buttons
<createButton>
Creates a custom toolbar button.
<createButton icon="https://example.com/icon.png" title="Square root of a fraction" offset="2">
<content>
<msqrt>
<mfrac>
<mrow/>
<mrow/>
</mfrac>
</msqrt>
</content>
</createButton>When the button is clicked, the MathML inside <content> is inserted into the formula.
Attributes
| Attribute | Description |
|---|---|
icon |
URL of the button icon. |
title |
Tooltip displayed to the user. |
offset |
Cursor position after insertion. |
before |
Inserts the button before another item. |
after |
Inserts the button after another item. |
extra |
Adds the button to the section's extra area. |
Child elements
| Element | Description |
|---|---|
<content> |
MathML inserted when the button is clicked. |
The content inside <content> must be valid MathML.
Cursor offset
The offset attribute controls where the cursor is placed after a custom button inserts its MathML content.
| Value | Behaviour |
|---|---|
0 |
Places the cursor at the end of the inserted template. |
1 |
Places the cursor at the first valid position inside the template. |
2 |
Places the cursor at the second valid position inside the template. |
3 and higher
|
Places the cursor at the corresponding valid position inside the template. |
If offset is omitted, MathType uses the default offset value for the custom button.
Common attributes
The following attributes are used by several toolbar XML elements.
| Attribute | Applies to | Description |
|---|---|---|
ref |
toolbar, tab, item, removeTab, removeItem
|
References an existing toolbar, tab, or item identifier. |
before |
tab, section, item, createButton
|
Inserts the element before another element. |
after |
tab, section, item, createButton
|
Inserts the element after another element. |
rows |
tab, section
|
Defines the number of rows used to arrange items. |
layout |
tab, section
|
Defines the layout used to arrange items. |
extraRows |
tab, section
|
Defines the number of rows in the extra area. |
extraLayout |
tab, section
|
Defines the layout of the extra area. |
extra |
item, createButton
|
Places the element in the section's extra area. |
Preset toolbars
The following toolbar presets are available.
| Preset | Description |
|---|---|
general |
Default MathType toolbar. |
quizzes |
Toolbar optimized for WirisQuizzes. |
chemistry |
ChemType toolbar. |
evaluate |
Evaluation toolbar. |
PARCC_Grade3_5 |
PARCC Grade 3–5 toolbar. |
PARCC_Grade6_8 |
PARCC Grade 6–8 toolbar. |
PARCC_Grade9_12 |
PARCC Grade 9–12 toolbar. |
prototype |
Prototype toolbar. |
Syntax rules
Toolbar XML is case-sensitive. Identifiers, element names, and attribute names must match the expected spelling and capitalization. For example, squareRoot is valid, but squareroot, SquareRoot, or squareroots are not equivalent.
When using the XML as a JavaScript parameter, remove line breaks or escape the string appropriately for your application.
Custom icon guidelines
Custom button icons should be accessible from the browser. Use transparent PNG or GIF images when possible.
For best visual alignment, use icon sizes that match the section where the button is added. Icons with inconsistent sizes may appear misaligned or unevenly spaced.
Notes
- Start from an existing toolbar unless you need a very small or fully custom toolbar.
- If a toolbar contains only one tab, the tab itself may not be displayed because it becomes redundant.
- A list of built-in toolbar, tab, section, and item identifiers can be found in Toolbar icons reference.
- XML syntax errors or incorrect identifiers may prevent the toolbar from loading as expected.