How do I set MathJax config file?
MathJax and Config file
I've using vanilla 2.0.18.10 and want to have LaTeX typesetting. Because I want to use '$' as in usual LaTeX, i didn't use LaTeX-plugin that based on Google Infographic API. After roaming in this forum, I decide to use MathJax since it's beautifully rendered. As suggested in mathjax official page, I turnoff the Markdown typesetting.
Later on, I found that MathJax didn't load the dollar sign automatically and we had to config it some way with config file as in Config-Setting MathJax.
I tried to include it in my themes by include the script in default.master.tpl but it didn't work at all. The dollar sign just didn't want to change the code into LaTeX. So I were roaming again and found this post. And I make a default.php file that mentioned in the discussion. But it didn't work.
Can anyone help me how to config mathjax in vanilla?
installed version
version : Vanilla 2.0.18.10
theme : bootstrap
site : forum
config file
MathJax.Hub.Config({ tex2jax: { inlineMath: [ ['$','$'], ["\\(","\\)"] ], displayMath: [ ['$$','$$'], ["\\[","\\]"] ], processEscapes: true } });
Comments
*markdown is marking down my script -_- and I cannot upload .php files, here is my script in txt
This is your code
grep is your friend.
well i can see an error in you code. You need to escape '
grep is your friend.
sorry, I just don't get what you mean by escape '
thanks.
I'm not saying a word... Here's an Url for you to look at: http://en.wikipedia.org/wiki/Escape_character and maybe, just maybe, these Urls will give you some explanation : http://stackoverflow.com/questions/6066315/how-to-escape-javascript-code-that-is-echoed-in-php
http://stackoverflow.com/questions/7085648/how-to-escape-string-from-php-for-javascript
http://stackoverflow.com/questions/20528198/html-escaping-encoding-in-javascript-php
There was an error rendering this rich post.
This is not valid code
'text'$'text'
if you want to ' in you string you must escape it'text\'$\'text'
I presume you are already familiar with php and basic string manipulation?
grep is your friend.
@UnderDog : thanks for the links
@x00 : no I don't. i just copy it from the link I mentioned before, and trying figure it out my self. I never typed php language, (i think i should learn it from now on) and this is my first try to install a web. Thanks for all the expanation, i'll back again after read all the links given and mathjax code work
Definitely getting the basics of programming will help you, otherwise you are acting blind. You don't really know what it is you are copying or if it is even relevant to your problem, or how to apply it.
grep is your friend.
Thanks for the advice @x00 , I read little about php by now
Then I tried again as you suggested :
but got bonk.
I tried to include it again in the default.master.tpl file since it loaded with the theme. This time i didn't get bonk. But then got nothing with the inline math.
What i did after that was remove all the modification theme and load the script again. This time the math loaded fine as you can say in http://olimpiade.org.45019.temporaryonly.com/vanilla/index.php?p=/discussion/2/junker-paradiso#Item_8
I want it this theme because this is the mainstream theme in my community. But still don't know why the theme won't load the mathjax script properly. is it because the dollar sign?
Edit : I didn't add the config file, but inline math is working
if you want to include it in themes - you can add it with themehooks.
if you want to make a plugin. zip up your whole plugin and add it as a file attachment here and we can test it.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
thank you @peregrine here is the plugin.
I can't find plugin called themehooks, but eventually found plugin named eventi(i think this plugin cannot help my problems). Is it the same thing as themehooks?
not your answer yet.
but you have a few flaws in naming and conventions
your zip had folder VanillaMathJaxInline
instead of folder VanillaMathJaxInline
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
see next comment
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
tested with
1 - I rewrote your code in default.php and the redraw.js to load js and config things properly and conform better.
2nd image edit mode before
3rd image - view of discussion.
you should add it to the add-ons - if it works properly for you.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
here is the new zip - I can't add new attachments to old comments.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
using the zip above.
make these changes for 2.1 using html formatting in conf/config.php
$Configuration['Garden']['InputFormatter'] = 'Html'; or Markdown
in default.php
and in js/redraw.js
after you post a sample formula, you must refresh the browser
or $${x^2-1} $$ using $$ delimiters
or $$ y = \frac{1}{x^2-1} \hbox{ when $x \ne \pm 1$.} $$
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
you can also use this newly created add-on, if you don't want mess around.
http://vanillaforums.org/addon/mathjaxcdn-plugin
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.