YourEquations.comDisplay Equations on World Wide Webby Waipot Ngamsaad |
|||
|
jsTeXrender is a small JavaScript program
which will convert LaTeX code
inside Setting up
Insert this small (but powerful) JavaScript before </body> in to your HTML document: <script type="text/javascript" src="http://tex.yourequations.com/"></script> UsagesWrite the LaTeX equation code in the HTML file with the tags, <pre lang="eq.latex"> your_LaTeX_code </pre>-- OR -- <code lang="eq.latex"> your_LaTeX_code </code>The script will convert the LaTeX equation code to the rendered LaTeX equation images. Example 1
\int_{-\infty}^{\infty}e^{-x^{2}}\;dx=\sqrt{\pi}
<pre lang="eq.latex">
\int_{-\infty}^{\infty}e^{-x^{2}}\;dx=\sqrt{\pi}
</pre>
Example 2
\int_{0}^{1}\frac{x^{4}\left(1-x\right)^{4}}{1+x^{2}}dx=\frac{22}{7}-\pi
<pre lang="eq.latex">
\int_{0}^{1}\frac{x^{4}\left(1-x\right)^{4}}{1+x^{2}}dx
Control the outputYou can put these commands in front of LaTeX equation code to control the output.
For the example:
<pre lang="eq.tex">
\inline \small x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
</pre>
\inline \small x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
It works in <DIV> node
c=\sqrt{a^2+b^2}
<pre lang="eq.latex">
c=\sqrt{a^2+b^2}
</pre>
It will not compile others lang
#include
<pre lang="c"> #include If missing lang, it still be code
c=\sqrt{a^2+b^2}
<pre lang="eq.tex">
c=\sqrt{a^2+b^2}
</pre>
PRE vs CODE tagA difference between PRE and CODE is how it manages the surrounding text. PRE tag always break the line for the text before and after it whereas the CODE tag doesn't do that. So, The CODE tag is suitable for the inline equation (with\inline command). Please take a look at these examples: 1. Using PRE tagSource:
The equation using PRE tag, <pre lang="eq.latex">
\int_{-\infty}^{\infty}e^{-x^{2}}\;dx=\sqrt{\pi}
</pre>, and here is the following text.
Output:
The equation using PRE tag,
\int_{-\infty%20}^{\infty}e^{-x^{2}}\;dx=\sqrt{\pi}
, and here is the following text.
2. Using CODE tagSource:
The equation using CODE tag, <code lang="eq.latex">
\int_{-\infty}^{\infty}e^{-x^{2}}\;dx=\sqrt{\pi}
</code>, and here is the following text.
Output:
The equation using CODE tag, 3. Using CODE tag with
Source:
|
Links |
||
|
Home |
About |
Top |
Support |
Communities Powered by |
|||