YourEquations.com

Display Math on your Web or Blog

by Waipot Ngamsaad

jsTeXrender is a small JavaScript program which will convert LaTeX code inside pre or code tags to
high-quality images produced by LaTeX typesetting system.
(more...)

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>

Usages

Write 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
=\frac{22}{7}-\pi </pre>

Control the output

You can put these commands in front of LaTeX equation code to control the output.
\inline
\tiny
\small
\normal (default)
\large
\huge
display inline equation
font size = 8
font size = 10
font size = 12
font size = 14
font size = 20

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 
void main(){
	printf("Hello World!");
}
<pre lang="c">
#include 
void main(){
	printf("Hello World!");
}
</pre>

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 tag

A 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 tag

Source:

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 tag

Source:

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, \int_{-\infty%20}^{\infty}e^{-x^{2}}\;dx=\sqrt{\pi} , and here is the following text.

3. Using CODE tag with \inline command

Source:

The equation using CODE tag with \inline command, <code lang="eq.latex">
\inline \int_{-\infty}^{\infty}e^{-x^{2}}\;dx=\sqrt{\pi}
</code>, and here is the following text.

Output:

The equation using CODE tag with \inline command, \inline \int_{-\infty%20}^{\infty}e^{-x^{2}}\;dx=\sqrt{\pi} , and here is the following text.


About us

This is a new innovation for displaying Mathematical formula on www. The aim is to help blogger and webmaster publish equations in their website or blog with the LaTeX by installing a small JavaScript. You just simply write the equations using <pre lang="eq.latex"></pre> (or <code lang="eq.latex"></code>), a HTML tag, in your web pages. Then, the online LaTeX render engine will convert the TeX/LaTeX code on your web page to equation image (png or gif) which can be displayed in any web browser, i.e., Firefox, MS Internet Explorer (see examples). So, the websters are going to play with Mathematics around the Internet. Our technology is based on open-source software, jsTeXrender and LatexRender modified-version by CodeCogs.

Discussions: http://forum.yourequations.com/
Contact: admin@yourequations.com
Home: http://www.yourequations.com

Why we choose PRE (or CODE) tag

PRE tag is magic. It cans display the rendered LaTeX image,
,
and also the pre-formated code,

c=\sqrt{a^2+b^2} .

Links

Home |  About |  Top |  Support |  Communities
Copyright © 2008 Yourequations.com. All rights reserved.

Powered by

jsTeXrender + LatexRender + CodeCogs