This required adding a separate Jinja2 environment, because LaTeX syntax is incompatible with Jinja2.