# \mmlToken

Advanced MathJax-specific construction of raw MathML token elements, typically inside macro substitutions or specialized extensions that need to emit a particular token node with optional attributes.

https://texform.dev/latex/commands/mmlToken

## Metadata

| Field | Value |
| --- | --- |
| Topic | [Layout and breaks](https://texform.dev/latex/topics/layout) |
| Packages | base, textmacros |
| Allowed mode | math, text |
| Tags | mathjax-extension |
| Commonality | low |
| Kind | prefix |

## Syntax

### base

Argument specification: `m:N o:K m:T`

Advanced MathJax-specific construction of raw MathML token elements, typically inside macro substitutions or specialized extensions that need to emit a particular token node with optional attributes.

### textmacros

Argument specification: `m:N o:K m:T`

Used in MathJax-specific macros or text-mode TeX input to construct an explicit MathML token element such as mi or mo, optionally with MathML attributes.

## Examples

```latex
\mmlToken{mi}{x}
```

[Open in Playground](https://play.texform.dev/?input=%5CmmlToken%7Bmi%7D%7Bx%7D)

```latex
\mmlToken{mi}[mathvariant='bold']{x}
```

[Open in Playground](https://play.texform.dev/?input=%5CmmlToken%7Bmi%7D%5Bmathvariant%3D%27bold%27%5D%7Bx%7D)

```latex
\text{\mmlToken{mi}{x}}
```

[Open in Playground](https://play.texform.dev/?input=%5Ctext%7B%5CmmlToken%7Bmi%7D%7Bx%7D%7D)

```latex
\text{\mmlToken{mi}[mathvariant=bold]{x}}
```

[Open in Playground](https://play.texform.dev/?input=%5Ctext%7B%5CmmlToken%7Bmi%7D%5Bmathvariant%3Dbold%5D%7Bx%7D%7D)

## Package variants

| Package | Argument specification | Allowed mode | Description |
| --- | --- | --- | --- |
| base | m:N o:K m:T | math | Advanced MathJax-specific construction of raw MathML token elements, typically inside macro substitutions or specialized extensions that need to emit a particular token node with optional attributes. |
| textmacros | m:N o:K m:T | text | Used in MathJax-specific macros or text-mode TeX input to construct an explicit MathML token element such as mi or mo, optionally with MathML attributes. |

## Renderer support

| Package | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- |
| base | full | none | none |
| textmacros | full | none | none |

## In TeXForm

TeXForm parses this entry as prefix syntax; the package determines its argument specification.

## Test cases

### base

| Input | Case | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- | --- |
| \mmlToken{mi}{x} | Positive: ctx:mathml-token | Pass | Fail | Fail |

### textmacros

| Input | Case | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- | --- |
| \mmlToken{mi}{x} | Positive: ctx:text-mathml-token | Pass | Fail | Fail |
