\n" . $config . "\n"; } /* * loads mathjax itself */ add_action('wp_enqueue_scripts', 'add_mathjax'); function add_mathjax() { $custom_cdn = esc_url( get_option('custom_mathjax_cdn') ); $cdn = $custom_cdn ? $custom_cdn : "//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML,Safe.js"; wp_enqueue_script('mathjax', $cdn); } /* * inserts the mathjax preamble inside the body and above the content */ add_action('wp_footer', 'add_preamble_adder'); function add_preamble_adder() { $preamble = get_option('latex_preamble'); if ( $preamble ) { $preamble = preg_replace('/\\\\/','\\\\\\\\',$preamble); ?>

Simple Mathjax options

(Please note that this still needs to be tested. There may be a problem with string-escaping. For instance, I'm not sure if special characters such as < will be properly processed.)

Custom mathjax CDN

If you leave this blank, the default will be used: http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML,Safe.js

Custom mathjax config

This text will be placed inside the <script x-mathjax-config> tag

If you leave this blank, the default will be used: MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});

Custom LaTeX preamble

A good place to put \newcommand's and \renewcommand's

Do not us $ signs, they will be added for you

E.g.
\newcommand{\NN}{\mathbb N}
\newcommand{\abs}[1]{\left|#1\right|}

Load MathJax on admin pages />

If you tick this box, MathJax will be loaded on admin pages as well as the actual site.