Search code examples
macrosmathjax

equivalent of \let\phi\varphi in MathJax


I usually have \let\phi\varphi in preambles of my LaTeX files, for aesthetics reasons. Is it possible to do something similar in MathJax? I tried defining macros

MathJax.Hub.Config({TeX:{Macros:{phi:"\\varphi"}}})

but it seems to have confused MathJax (no math was rendered on the page at all). What is the proper way to do this?


Solution

  • What you have done should work, so I suspect something is typed wrong or in the wrong place in your file. Here is a complete working example file:

    <!DOCTYPE html>
    <html>
    <head>
    <title>MathJax Macros Configuration</title>
    <script type="text/x-mathjax-config">
      MathJax.Hub.Config({TeX: {Macros: {phi:"\\varphi"}}});
    </script>
    <script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>
    </head>
    <body>
    phi \(\phi\) and varphi \(\varphi\) should both be the same.
    </body>
    </html>