2011-07-09, 23:22:09
I try to enable LaTeX in GetSimple as it is possible in many other cms.
Currently there are two known methods:
1. create an image of the LaTeX code and implement it into the page
2. send a JavaScript to the client and it parses the LaTeX to symbols locally
For the image version, there is mathTeX. You can use a simple POST method to get an image from their website:
Now in the GetSimple editor every \ is replaced, so I have to use escape characters to parse the correct LaTeX code to their site. This looks then somewhat like this:
http://www.disi.me/index.php?id=latex-test
As you can see the second equation was parsed without escape characters and should show the same as the third.
I cannot get the JavaScript method to work using MathJax. If I put the needed script into the header of a template, it removes everything and I get the error that en empty page cannot be saved. This would be the code in the header:
What I would want is either method (preferred the image solution), to detect LaTeX code if I put it between $$. I am willing to investigate this and learn how the different php scripts play together to find where text is parsed into code and grap $$ to use my own snippen, but with your help that might be much faster
Could someone give me a hint, where I should start?
Currently there are two known methods:
1. create an image of the LaTeX code and implement it into the page
2. send a JavaScript to the client and it parses the LaTeX to symbols locally
For the image version, there is mathTeX. You can use a simple POST method to get an image from their website:
Code:
<img src="/cgi-bin/mathtex.cgi?f(x)=\int_{-\infty}^xe^{-t^2}dt" alt="" border=0 align="middle">
http://www.disi.me/index.php?id=latex-test
As you can see the second equation was parsed without escape characters and should show the same as the third.
I cannot get the JavaScript method to work using MathJax. If I put the needed script into the header of a template, it removes everything and I get the error that en empty page cannot be saved. This would be the code in the header:
Code:
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
What I would want is either method (preferred the image solution), to detect LaTeX code if I put it between $$. I am willing to investigate this and learn how the different php scripts play together to find where text is parsed into code and grap $$ to use my own snippen, but with your help that might be much faster
