Electrical and Computer Engineering
Computer Science

Computing

MathJax is a JavaScript layer that browsers use to render LaTeX code directly. This is used to generate SVG equations/diagrams/etc on-the-fly, in your browser. This is built into this server's web page setup in Pages, there is nothing to set up. As long as you follow the setup in Pages, you can draw directly using LaTeX.

For example, the equation

$$ \text{Prob}(a < Z < b) = \int_a^b e^{-z^2/2}\,dz $$

and the figure

are generated by the code

$$ \text{Prob}(a < Z < b) = \int_a^b e^{-z^2/2}\,dz $$

and the code

<script type="text/tikz">
\pgfmathdeclarefunction{gauss}{0}{\pgfmathparse{3*exp(-(\x)^2/2)}}
\begin{tikzpicture}
	\draw (0,0)node[below]{$0$} -- (0,3);
	\draw[domain=-5:.5,smooth,variable=\x] plot ({\x},{gauss});
	\draw[domain=.5: 2,smooth,variable=\x,fill=green] (.5,0) --  plot ({\x},{gauss}) -- (2,0) -- cycle;
        \draw[domain= 2: 5,smooth,variable=\x] plot ({\x},{gauss});
	\draw (2,0)node[below]{$b$};
	\draw (.5,0)node[below]{$a$};
\end{tikzpicture}
</script>

For more info, go to mathjax.org.