Abstract
This demonstration showcases the recursive expansion architecture of the MacroRegistry in MarkCharm. It demonstrates macro composition across three levels (Atoms, Molecules, and Organisms), protection against infinite recursion, and transparent injection into tables and lists.
MacroRegistry)The architecture of MacroRegistry in MarkCharm performs depth-first recursive scans for the expansion of commands adhering to native LaTeX notation (\\newcommand{name}{body}). When a high-level composite macro (Organism) is invoked, the compiler injects the derived template into the document stream and subjects the text to successive scanning passes (_depth + 1) as long as mutations yield results.
The process is shielded against infinite expansion loops by a hard safety limit (_MAX_EXPANSION_DEPTH = 10), emitting the warning diagnostic MCW-MACRO-001 if a circular dependency is detected.
[ Invocation: - \CartaoIdentidade{Alan Turing}{AT}{Chief Scientist} ]
│
▼ (Pass 1: Organism Expansion)
[ - \PerfilCapa{Alan Turing}{AT} (Role: `Chief Scientist`) ]
│
▼ (Pass 2: Molecule Expansion)
[ - \DestacaNome{Alan Turing} (\EstiloSigla{AT}) (Role: `Chief Scientist`) ]
│
▼ (Pass 3: Atom Expansion)
[ - \textbf{Alan Turing} (\textit{AT}) (Role: `Chief Scientist`) ]
│
▼ (Pass 4: AST Injection & HTML Formatting as List)
[ <li><strong>Alan Turing</strong> (<em>AT</em>) (Role: <code>Chief Scientist</code>)</li> ]
3 distinct levels of cascading macroscopic complexity were defined in the preamble of this document. Simple invocation of the master macro in the body of the document recursively expands all of its sub-components:
Código de Invocação:
- \CartaoIdentidade{Alan Turing}{AT}{Chief Computational Scientist}
- \CartaoIdentidade{Ada Lovelace}{AL}{Analytical Architecture Founder}
- \CartaoIdentidade{Grace Hopper}{GH}{Admiral & Compiler Pioneer}
Resultado Renderizado:
Chief Computational Scientist)Analytical Architecture Founder)Admiral & Compiler Pioneer)Combining badges and metrics into unified components:
Código de Invocação:
- \FichaTecnicaServico{CORE}{v3.4.1}{99.99%}{Production}
- \FichaTecnicaServico{AUTH}{v2.1.0}{99.95%}{Staging}
Resultado Renderizado:
[ CORE ] v3.4.1 | SLA: 99.99% (Production)[ AUTH ] v2.1.0 | SLA: 99.95% (Staging)Complex reporting components rendered cleanly:
Código de Invocação:
- \RegistroAuditoria{Deployment}{2026-08-30}{Alan Turing}{AT}{SUCCESS}
- \RegistroAuditoria{Security Audit}{2026-08-29}{Grace Hopper}{GH}{VERIFIED}
Resultado Renderizado:
2026-08-30 by Alan Turing (AT) | Status: [ SUCCESS ]2026-08-29 by Grace Hopper (GH) | Status: [ VERIFIED ]This demonstration presents the capability of embedding multimedia files and images directly into the HTML document generated by the MarkCharm compiler. All local media is transparently converted into Base64 Data URIs, enabling the distribution of a single, fully self-contained and auditable .html file.
As demonstrated in the following data:tions, direct cross-references can be made to sec. 4, Fig. 1, sec. 4, Fig. 2, sec. 5, Audio 1, sec. 6, Video 1, and sec. 7, Object 1.
Images continue to be handled by the figure presentation block, supporting optional relative width parameters (width='40%', width='85%'), generating automatic numbering and responsive legibility.
assets/branding/Logo/MarkCharmLogo-transparente.svg).Fig. 2 demonstrates the use of high-resolution artwork from the repository collection, scaled to 85% of paragraph length:
assets/images/Escola_de_Atenas_Vaticano.jpg).For audio file inclusion, use the audio block pointing to assets/audio/ with optional dimension adjustments (width='70%'). The native HTML player embeds playback controls.
assets/audio/audio_exemplo.mp3).As seen in audio 1, the audio player is rendered with a responsive width of 70% and support for source and observation sub-blocks.
The video block allows embedding video elements (.mp4, .webm, .ogv) stored in assets/videos/, ensuring dynamic presentations remain saved within the report itself.
assets/videos/video_exemplo.mp4).External documents like PDFs or spreadsheets stored in assets/documents/ can be embedded via the object block, displaying the browser's native viewer interface.
assets/documents/documento.pdf).MarkCharm's self-contained architecture ensures complete portability of generated documents without needing external asset bundlers or resource managers.
Usage Requirements & Technical Caveats
\embed_media{true}): Converts images, audio, video, and PDFs into Base64 Data URIs, increasing final HTML file size by ~33%.