2

This should be a pretty easy one, but I haven't been able to find any solutions.

I need to include the following in my source code:

<script type="text/javascript" src="bower_components/MathJax/MathJax.js?config=AM_HTMLorMML-full"></script>

The ./config/am_htmlormml.js file is loaded by MathJax to render formulas written in ascii. The code runs and works fine, but I would prefer to use Bower. When I install MathJax via bower, I get:

<!-- build:js(.) scripts/vendor.js -->
<!-- bower:js -->
...
<script src="bower_components/MathJax/MathJax.js"></script>
...
<!-- endbower -->
<!-- endbuild -->

But I am unsure of how best to add ?config=AM_HTMLorMML-full1, or make sure the ./config/am_htmlormml.js file is loaded.

gus
  • 171
  • 2
  • 7

1 Answers1

0

You can specify it in the config key when you configure MathJax. Note that my example uses a different config than yours (b/c this config worked with my example MathML).

<!doctype html>

<title>MathJax Bower Example</title>

<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    config: ["TeX-MML-AM_CHTML.js"],
    tex2jax: {
      inlineMath: [['$','$'], ['\\(','\\)']]
    },
  });
</script>

<script async src="bower_components/MathJax/unpacked/MathJax.js"></script>

When $a \ne 0$, there are two solutions to \(ax^2 + bx + c = 0\) and they are
$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$
Joshua Cheek
  • 30,436
  • 16
  • 74
  • 83