Closed jonaprieto closed 4 months ago
If I'm not mistaken, one possible solution is to change the syntax used for macros, for example, considering the following alternative config on your mkdocs.yml.
- macros:
j2_block_start_string: "{@@"
j2_block_end_string: "@@}"
j2_variable_start_string: "{@"
j2_variable_end_string: "@}"
Yes, the issue of Jinja2 accidentally mistaking some page content with its own directives and attempting to translate them is unavoidable (and indeed some LateX statements can do that).
There are 5 solutions described for this problem, depending on your circumstances. Altering the Jinja2 delimiters is one of them, probably the most radical.
Each of these solutions involves a trade-off. One of the criteria is how often this problem happens (are these formulas spread all over your document, or located in just a few places?), versus how often you use macros in the pages.
I have a few math equations on my markdown files, which usually require curly braces; it's LaTeX. For example, the following changes fix the error messages produced by this macro plugin: (I cannot escape these characters. Otherwise, the equation does not render well.) The error disappears after the double-curly braces pattern is removed. Again, this is not an admissible fix.