Wiki source code of Macro Support

Last modified by Vincent Massol on 2026/08/30 19:43

Hide last authors
Vincent Massol 6.1 1 These macros are given a LaTeX equivalent of their own when a page is exported. Any other macro is exported as the content it renders to, unless an extension supplies a LaTeX template for it — see [[Add Support for a Macro>>doc:documentation.extensions.dev.latex.macro-templates.WebHome]].
2
3 |=Macro|=What the export produces
4 |##toc##|A table of contents. With ##scope="local"##, the table of contents of the section it sits in.
5 |##code##|A syntax-coloured code block, typeset with the ##minted## LaTeX package.
6 |##info##, ##warning##, ##error##, ##success##|A coloured box carrying the macro's ##title## parameter, one colour per macro. Used inline, the four produce styled text instead of a box.
7 |##formula##|A LaTeX formula, provided the [[LaTeX Template for the Formula macro>>doc:extensions:Extension.Formula.Formula LaTeX Template.WebHome]] extension is installed. The LaTeX extension itself does not carry that template.
8 |##id##|A LaTeX label, which a cross-reference elsewhere in the document can point to.
9 |##footnote##|A LaTeX footnote. LaTeX places the footnotes itself, so the ##putFootnotes## macro that goes with it produces nothing.
10 |##container##|A multiple-column layout, for ##layoutStyle="columns"##. A container with any other layout style exports as its plain content.
11
12 == Table of Contents ==
13
14 {{code language="none"}}
15 = Heading1 =
16
17 {{toc scope=local/}}
18
19 == Heading2 ==
20
21 === Heading3 ===
22
23 {{toc/}}
24 {{/code}}
25
26 {{image reference="toc-macro-output.png" size="large" alt="The compiled export, showing the local table of contents under Heading1 and the full table of contents at the end"/}}
27
28 == Code ==
29
30 {{code language="none"}}
31 {{code language='java'}}
32 public class HelloWorld
33 {
34 public static void main(String[] args) {
35 System.out.println("Hello World!");
36 }
37 }
38 {{/code}}
39 {{/code}}
40
41 {{image reference="code-macro-output.png" size="large" alt="The compiled export, showing the Java class typeset as a syntax-coloured code block"/}}
42
43 == Message Boxes ==
44
45 {{code language="none"}}
46 {{info}}info{{/info}}
47
48 {{warning}}info{{/warning}}
49
50 {{error}}info{{/error}}
51
52 {{success}}info{{/success}}
53 {{/code}}
54
55 {{image reference="message-macros-output.png" size="large" alt="The compiled export, showing the info, warning, error and success macros as four boxes outlined in blue, yellow, red and green"/}}
56
57 == Multiple Columns ==
58
59 Each group of the container becomes a column. The paragraphs are cut short here; the compiled result below is the one the full paragraphs produce.
60
61 {{code language="none"}}
62 Hello world
63
64 {{container layoutStyle="columns"}}
65 (((
66 Lorem ipsum dolor sit amet, consectetur adipiscing elit. [...]
67 )))
68 (((
69 Lorem ipsum dolor sit amet, consectetur adipiscing elit. [...]
70 )))
71 {{/container}}
72 {{/code}}
73
74 {{image reference="container-macro-output.png" size="large" alt="The compiled export, showing the two groups of the container typeset side by side as two columns of text"/}}

Get Connected