Shortcodes
Shortcodes let you apply formatting, embed media, and insert interactive fields. They use square bracket syntax with opening and closing pairs.
Where Shortcodes work
Every Shortcode — typography, text properties, layout, media, form fields, and actions — renders inside any text element:
- Paragraphs (
p) and headings (h1toh6) - Table headers and cells (
th,td) - List items (
li) - Columns layout cells
- Header and footer content
- Svg
textshapes, where[br]divides the lines
The same syntax works everywhere. No container or wrapper needed.
Syntax
[tag]content[/tag]
[tag, param1, param2]
Tags can be nested and combined freely. The engine reads them left to right, keeping a stack of open tags: a closing tag returns the text to the formatting in force before its opening tag.
| Rule | What happens |
|---|---|
[[ | A literal [: [[b] draws [b] instead of opening bold. |
| Case | Tag names are case-insensitive: [B], [Bold] and [b] are the same tag. |
| A tag that needs a value, written without one | [font], [color], [link], [lang], [span], ... without a comma are drawn as text, with a NOTICE. |
| An unknown bracketed word | [foo] or [foo, 1] is drawn as text, with a NOTICE. Write [[foo] when you mean the brackets. |
| A tag never closed | It runs to the end of the text, with a WARNING. |
| A closing tag nothing opened | Drawn as text, with a WARNING. |
| Out-of-order closing | [b]x[i]y[/b][/i]: [/b] closes the inner [i] too, with a WARNING. |
Tag categories
Typography
Control font weight, style, and decoration within a text span.
| Tag | Short | Description |
|---|---|---|
[bold]...[/bold] | [b]...[/b] | Bold text |
[italic]...[/italic] | [i]...[/i] | Italic text |
[bolditalic]...[/bolditalic] | [bi]...[/bi] | Bold italic text |
[underline]...[/underline] | [u]...[/u] | Underlined text |
[strike]...[/strike] | [s]...[/s] | |
[caps]...[/caps] | — | UPPERCASE text (presentation only — source stays mixed-case) |
[font, Name]...[/font] | — | Switch to a registered font family |
HTML semantic aliases
Familiar HTML inline-element names route to the canonical tags above — useful when porting content from HTML or when the semantic name reads more naturally in template code:
| Alias | Routes to | Meaning |
|---|---|---|
[em]...[/em] | [i] | Emphasis (italic) |
[strong]...[/strong] | [b] | Strong emphasis (bold) |
[cite]...[/cite] | [i] | Citation (italic) |
[ins]...[/ins] | [u] | Inserted text (underline) |
[del]...[/del] | [s] | Deleted text (strikethrough) |
[mark]...[/mark] | [hl, #fef08a] | Default-yellow highlight |
Text properties
Override font size, color, alignment, and position.
| Tag | Short | Description |
|---|---|---|
[fontsize, N]...[/fontsize] | [size, N]...[/size] | Set font size to N points |
[color, color]...[/color] | [fontcolor, color]...[/fontcolor] | Set text color (any CSS color: hex, rgb(), a named color, transparent) |
[letterspacing, N]...[/letterspacing] | [ls, N]...[/ls] | Track characters out (or in, with negative N) by N points |
[highlight, color]...[/highlight] | [hl, color]...[/hl] | Background highlight on the span; the color is optional (#fef08a) |
[align, V]...[/align] | — | Paragraph alignment: start, end, left, center, right, justify |
[superscript]...[/superscript] | [sup]...[/sup] | Superscript (raised text) |
[subscript]...[/subscript] | [sub]...[/sub] | Subscript (lowered text) |
Layout
Control spacing and positioning within a paragraph.
| Tag | Description |
|---|---|
[linebreak] or [br] | Line break (optional count: [br, 3]) |
[tab] | The next default tab stop |
[tab, POS, ALIGN] | Tab stop at POS from the paragraph's left edge; ALIGN 0 start, 1 end, 2 center, 3 decimal |
[col, N]...[/col] | Splits the line into weighted segments sharing its width (see Layout) |
Footnotes
| Tag | Description |
|---|---|
[note]...[/note] | A footnote: a numbered mark here, the note at the foot of the page. See Footnotes |
Language and abbreviations
Say what a run is, for a screen reader and for a tagged PDF.
| Tag | Description |
|---|---|
[lang, tag]...[/lang] | The run's language, as a tag such as fr or de-CH: how it is pronounced and hyphenated. The DOCX writes it as the run's language |
[abbr, expansion]...[/abbr] | An abbreviation and its expansion, read out in place of the letters in a tagged PDF. The DOCX keeps the text and reports the expansion as not written |
{ "p": "The contract is priced on [abbr, Retail Prices Index]RPI[/abbr], and the French copy reads [lang, fr]prix indexé[/lang]." }
Inline box
| Tag | Description |
|---|---|
[span, style]...[/span] | Draws the run in the named style's inline box: its text keys (color, fontFamily, fontSize, fontWeight, fontStyle, letterSpacing, textDecoration), its font features (fontVariantCaps, fontVariantPosition, fontVariantNumeric, fontVariantLigatures, fontVariantAlternates, fontVariantEastAsian, fontFeatureSettings), plus padding, background, border, radius and clip path. A style the document does not define is an ERROR; keys an inline box does not take are listed once with a NOTICE |
{
"styles": {
"badge": { "color": "#ffffff", "fontWeight": "bold", "backgroundColor": "#3b4a2f", "padding": "2 6", "borderRadius": 8 }
},
"content": [
{ "p": "Status: [span, badge]Approved[/span]" }
]
}
The span's keys are the run's own: a key its style states replaces the paragraph's for those words, and a key it
leaves out is the paragraph's. So a span whose style says "fontWeight": "normal" sets its words in the regular
weight inside a bold paragraph, and one saying "fontVariantCaps": "smallCaps" sets a defined term in small capitals
while the words around it keep their figures and ligatures. The font-feature keys and what each draws are on
Typography.
{
"styles": {
"lead": { "fontWeight": "bold" },
"term": { "fontWeight": "normal", "fontVariantCaps": "smallCaps" },
"amount": { "fontVariantNumeric": "tabularNums" }
},
"content": [
{ "p": "The [span, term]Supplier[/span] shall pay [span, amount]1,250.00[/span] within thirty days.", "style": "lead" }
]
}
Vertical text
| Tag | Description |
|---|---|
[combineUpright]...[/combineUpright] | In a vertical line, sets the run side by side in one em (CSS text-combine-upright: all) |
[combineUpright, digits, N] | Only digit runs of N (2 to 4) characters; [combineUpright, none] takes back a paragraph's combination. Same values as the textCombineUpright style key |
The tag acts only in vertical text (a writingMode of verticalRl or verticalLr); the tag name is case-insensitive,
so [combineupright] is the same tag. A value other than none, all or digits with 2, 3 or 4 is an ERROR and the
run keeps the combination in force. How vertical lines are set is on
Typography.
Media
Embed images and barcodes inline with text.
| Tag | Short | Description |
|---|---|---|
[image, path, W|H] | [img, path, W|H] | Inline image |
[barcode, type, code, W|H] | — | Inline barcode |
Math & chemistry
Typeset equations, chemical formulas, and physical quantities as selectable, editable text. See Math & Chemistry for the full grammar.
| Tag | Description |
|---|---|
[latex]...[/latex] | Backslash-free LaTeX math (frac{a}{b}, sqrt{x}, alpha), chemistry via ce{...}, units via pu{...} |
Form fields
Insert interactive AcroForm fields inline.
| Tag | Description |
|---|---|
[textfield, name, 'value', W|H] | Text input field |
[textarea, name, 'value', W|H] | Multi-line text area |
[checkbox, name, checked, W|H] | Checkbox |
[radio, value, group, selected, W|H] | Radio button: value is what the group field is set to when this button is chosen. [radiobutton, ...] is the same tag |
[choicefield, name, opt1|opt2|opt3, index, W|H] | Dropdown select |
[listbox, name, opt1|opt2, 'value', multi, W|H] | List box |
[datepicker, name, format, W|H] | Date field; format is the date pattern (yyyy-MM-dd), MM/dd/yyyy when omitted |
[signature, name, W|H, key=value...] | An empty signature field, a place to sign. The trailing key=value slots constrain the signer and lock fields on signing: reasons, timeStamp, required, subject, issuer, oid, subjectDN, keyUsage, url, lock, lockPermissions |
Each field's slots are detailed in Field types.
{ "p": "Lessor: [signature, lessorInline, 150|40, reasons=I agree|I agree on behalf of the lessor, lock=all]" }
Links
Attach a clickable target to a text span. Renders into both PDF and DOCX output; the text is blue and underlined unless you set a color.
| Tag | Description |
|---|---|
[link, URL]...[/link] | Clickable hyperlink |
[goto, id]...[/goto] | Jump to the block whose "id" is id |
Nesting
Tags can be nested to combine effects:
{ "p": "[b][color, #CC0000]URGENT:[/color][/b] Review [i]before[/i] [u]end of day[/u]." }
This renders: URGENT: (bold red) Review before (italic) end of day (underlined).