{# Note: at present, MathJax and KaTeX do not respect the USE_CDN configuration option #} {% macro math_scripts() %} {% if use_katex %} {% if katex_auto_render %} {% else %} {% endif %} {% else %} {# Note: given the size of MathJax; nikola will retrieve MathJax from a CDN regardless of use_cdn configuration #} {% if mathjax_config %} {{ mathjax_config }} {% else %} {% endif %} {% endif %} {% endmacro %} {% macro math_styles() %} {% if use_katex %} {% endif %} {% endmacro %} {% macro math_scripts_ifpost(post) %} {% if post.has_math %} {{ math_scripts() }} {% endif %} {% endmacro %} {% macro math_scripts_ifposts(posts) %} {% if posts|selectattr("has_math")|list %} {{ math_scripts() }} {% endif %} {% endmacro %} {% macro math_styles_ifpost(post) %} {% if post.has_math %} {{ math_styles() }} {% endif %} {% endmacro %} {% macro math_styles_ifposts(posts) %} {% if posts|selectattr("has_math")|list %} {{ math_styles() }} {% endif %} {% endmacro %}