1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 MathJax working but won't go on 1 line

Discussion in 'Styling and Customization Questions' started by PJK, Apr 4, 2016.

  1. PJK

    PJK Member

    I have MathJax up and working by:
    1) Putting this script into the 'page_container_js_head' template:
    <script type="text/javascript"
    2) Adding a custom BBcode using these values:
    https://www.dropbox.com/s/3ao8cpxcw269y4j/Screenshot 2016-04-04 17.25.32.png?dl=0

    It does work, however, each time I use the math tags, it puts everything else on a new line:
    https://www.dropbox.com/s/e6uc5o0gyisbibt/Screenshot 2016-04-04 17.30.54.png?dl=0

    I want to allow it is be in the middle of a sentence, as shown here:
    https://www.dropbox.com/s/a6z0agiejazarpy/Screenshot 2016-04-04 17.31.42.png?dl=0

    What is the best way of going about this? Thanks.
  2. Brogan

    Brogan XenForo Moderator Staff Member

    It would likely require changing it from a div to a span, if possible.
  3. PJK

    PJK Member

    Would this be done in the HTML replacement? At the moment my HTML replacement doesn't have any HTML in it.
  4. Enay

    Enay Member

  5. PJK

    PJK Member

    Thanks. Is it possible to implement the tex2jax using the CDN, or does MathJax have to be installed on the server to use it? I can't quite tell after reading around there. If you know how to implement it with the CDN, please let me know. Thanks again.
  6. Enay

    Enay Member

    I'm sorry, I do not know.
  7. PJK

    PJK Member

    I found a solution. Simply add this to the page_container_js_head template and it will work like a charm:
    <script type="text/x-mathjax-config">
        extensions: ["tex2jax.js"],
        jax: ["input/TeX", "output/HTML-CSS"],
        tex2jax: {
          inlineMath: [ ['$$','$$'], ["\\(","\\)"] ],
          displayMath: [ ['$$$','$$$'], ["\\[","\\]"] ],
          processEscapes: true
        "HTML-CSS": { availableFonts: ["TeX"] }
    <script src='https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script>

Share This Page