Team:DTU-Denmark/How to customize an iGEM wiki

From 2011.igem.org

(Difference between revisions)
(Created page with "= JavaScript / jQuery hacks = == LaTeX equations == It is possible to enabled TeX in a MediaWiki ([http://www.mediawiki.org/wiki/Manual:Math Manual:Math]), but unfortunately it d...")
Line 11: Line 11:
...and replace them with equations. All you need to do is to add the following to your wiki tekst:
...and replace them with equations. All you need to do is to add the following to your wiki tekst:
<pre>
<pre>
-
<!-- Use MathJax (LaTeX for the web) -->
+
<!-- MathJax (LaTeX for the web) -->
 +
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
 +
</pre>
 +
 
 +
And if you want to use $...$ delimiters:
 +
 
 +
<pre>
 +
<!-- MathJax (LaTeX for the web) -->
 +
 
 +
<!-- This part is only if you want to use $...$ delimiters -->
<script type="text/x-mathjax-config">
<script type="text/x-mathjax-config">
     MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});
     MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});
-
    MathJax.Hub.Config({
 
-
        TeX: {
 
-
            equationNumbers: {  autoNumber: "AMS"  }
 
-
        }
 
-
    });
 
</script>
</script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

Revision as of 18:10, 7 September 2011

JavaScript / jQuery hacks

LaTeX equations

It is possible to enabled TeX in a MediaWiki (Manual:Math), but unfortunately it doesn't seem like iGEM has done that..

Another to enable your wiki to display LaTeX equations, is to use MathJax. MathJax is a JavaScript file located at http://cdn.mathjax.org/mathjax/latest/MathJax.js, which reads your document after it has been loaded, and then changes the content of the document according to the notation. That is, it removes everything between any of the following delimiters...

  • \(...\)
  • $...$ (if configured)
  • \[...\]
  • $$...$$
  • \begin{?} ... \end{?}

...and replace them with equations. All you need to do is to add the following to your wiki tekst:

<!-- MathJax (LaTeX for the web) -->
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

And if you want to use $...$ delimiters:

<!-- MathJax (LaTeX for the web) -->

<!-- This part is only if you want to use $...$ delimiters -->
<script type="text/x-mathjax-config">
    MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});
</script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

MathJax documentation here