Difference between revisions of "HowTos:Add TeX to your webpage"
(initial webpage) |
|||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | This HowTo provides basic instructions on how to add TeX based formulas to your webpages located on the math webserver by using | + | This HowTo provides basic instructions on how to add TeX based formulas to your webpages located on the math webserver by using MathJax. |
== Introduction == | == Introduction == | ||
− | The main math webserver as well as the cgi webserver have the | + | The main math webserver as well as the cgi webserver have the MathJax package installed on them and you can very easily use it to add TeX based formulas/text to your webpages hosted on math webservers. |
− | + | MathJax is a javascript based software that can interpret TeX/LaTeX formulas embedded in your webpage and replace them with fonts and images to make them look as close as possible to the TeX/LaTeX output. You can find extensive information about MathJax on [http://www.mathjax.org MathJax homepage]. Here we will just suggest a few quick ways to use it, for more extensive information check jsMath website. | |
== Quick Start == | == Quick Start == | ||
To get started insert the following html code somewhere in the <head> section of your webpage: | To get started insert the following html code somewhere in the <head> section of your webpage: | ||
− | + | <SCRIPT SRC="/mathjax/MathJax.js"> | |
− | + | MathJax.Hub.Config({ | |
− | + | extensions: ["tex2jax.js","TeX/AMSmath.js","TeX/AMSsymbols.js"], | |
− | + | jax: ["input/TeX","output/HTML-CSS"], | |
− | + | tex2jax: {inlineMath: [["$","$"],["\\(","\\)"]], processEscapes: true} | |
− | + | }); | |
− | + | </SCRIPT> | |
− | + | This code will make sure MathJax is loaded if and only if you use LaTeX style formulas somewhere in the body of your document. That means that the following text: | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | This code will make sure | ||
\( f(\alpha) = x+\beta \) | \( f(\alpha) = x+\beta \) | ||
will get translated into inline formula as in: \( f(\alpha)=x+\beta \) - note how there is a small delay before the text gets converted into formulas. For displayed equations you can do: | will get translated into inline formula as in: \( f(\alpha)=x+\beta \) - note how there is a small delay before the text gets converted into formulas. For displayed equations you can do: | ||
Line 31: | Line 21: | ||
which gets translated like this: \[ \int_\alpha^\beta x = \mathbb{A} \] | which gets translated like this: \[ \int_\alpha^\beta x = \mathbb{A} \] | ||
− | + | == More Information == | |
− | + | To see more information on how to tweak and use MathJax please refer to their website, in particular the [http://www.mathjax.org/docs/1.1/configuration.html configuration webpage]. | |
− | == | ||
− |
Latest revision as of 07:47, 28 July 2011
This HowTo provides basic instructions on how to add TeX based formulas to your webpages located on the math webserver by using MathJax.
Introduction
The main math webserver as well as the cgi webserver have the MathJax package installed on them and you can very easily use it to add TeX based formulas/text to your webpages hosted on math webservers.
MathJax is a javascript based software that can interpret TeX/LaTeX formulas embedded in your webpage and replace them with fonts and images to make them look as close as possible to the TeX/LaTeX output. You can find extensive information about MathJax on MathJax homepage. Here we will just suggest a few quick ways to use it, for more extensive information check jsMath website.
Quick Start
To get started insert the following html code somewhere in the <head> section of your webpage:
<SCRIPT SRC="/mathjax/MathJax.js"> MathJax.Hub.Config({ extensions: ["tex2jax.js","TeX/AMSmath.js","TeX/AMSsymbols.js"], jax: ["input/TeX","output/HTML-CSS"], tex2jax: {inlineMath: [["$","$"],["\\(","\\)"]], processEscapes: true} }); </SCRIPT>
This code will make sure MathJax is loaded if and only if you use LaTeX style formulas somewhere in the body of your document. That means that the following text:
\( f(\alpha) = x+\beta \)
will get translated into inline formula as in: \( f(\alpha)=x+\beta \) - note how there is a small delay before the text gets converted into formulas. For displayed equations you can do:
\[ \int_alpha^\beta x = \mathbb{A} \]
which gets translated like this: \[ \int_\alpha^\beta x = \mathbb{A} \]
More Information
To see more information on how to tweak and use MathJax please refer to their website, in particular the configuration webpage.