# Can one use Stack Exchange to render mathematical equations for personal use?

Is it ok to use the "body" part (of questions and answers) to render LaTeX equations for personal use?

In other words is it OK to use it as a LaTeX editor-compiler for non Stack related purposes?

• There are also freely-available, full-featured versions of TeX that are self-installing on MacOS, for example. TeXShop is what I've been using for years. – paul garrett Feb 21 at 22:11
• I don't know what uses you are having but I generally use Stackedit because it's easier to handle and see all that is going on. – Billy Rubina Feb 22 at 2:55
• I don't see why not, but this resource is probably more useful to you as you can adjust the size of the output. – K.defaoite Feb 23 at 15:04
• Thank you all for the responses. I found compiling here extremely user friendly and easy to use(from uploading images, to chemical equations). Cheers! – newbie105 Feb 24 at 12:32
• It would be nice if there was some standalone code somewhere equivalent to the edit / live preview function. The closest I've found is bandicoot.maths.adelaide.edu.au/MathJax/test/… but it's rather primitive. I've been using it in teaching classes to render math on the fly, but wish I had something better. – Nate Eldredge Feb 28 at 16:40
• @NateEldredge SageMathCell can render MathJax. (In fact, it can render HTML, with embedded MathJax). Here is a basic example. Enter some MathJax (with dollar delimiters) into the data box, then click outside the data box. – PM 2Ring Mar 3 at 12:28

As long as you don't submit the post, I don't see any harm in using the preview functionality of Stack Exchange to test your LaTeX code. But see Concerns about MathJax in proposed new SE editor – at the moment it's unclear whether that will continue to work. Otherwise, we have the Formatting Sandbox which can be used for this kind of stuff.

Note that the language we use here is MathJax, not the real LaTeX. I don't have enough experience to list the most important differences, but you might want to use an (online) LaTeX compiler instead. This question on TeX Meta lists two of them.

• Sometimes things don't render correctly in Preview for me, but work okay when posted. Having used the answer box to write up a bit of LaTeX, as the OP wonders about, I once hit "Submit" to "really" see how some LaTeX rendered. My "answer" quickly picked up a downvote before I remembered where I was and got a chance to delete it. I was very embarrassed. Learn from my mistake. – JonathanZ supports MonicaC Feb 22 at 18:04
• It seems that the formula editor of Mathjax is the same as in LaTeX – Jonas Feb 25 at 11:09
• @Jonas Eh... technically LaTeX doesn't have a formula editor. It would be more precise to say that the markup language used in LaTeX to express formulas is the same as the markup language used in MathJax to express formulas. (Though I don't even think it's 100% the same. The basics are the same, yes, but there are more advanced things that differ.) – David Z Feb 26 at 2:10

For personal use, you could use a template HTML file that accesses MathJax directly. The example template below uses the MathJax website. It also has a commented out portion in the header that you could use if you download MathJax to your computer.

<!DOCTYPE html>
<html>

<script type="text/x-mathjax-config">
MathJax.Hub.Config({"HTML-CSS": { preferredFont: "TeX", availableFonts: ["STIX","TeX"], linebreaks: { automatic:true }, EqnChunk: (MathJax.Hub.Browser.isMobile ? 10 : 50) },
tex2jax: { inlineMath: [ ["$$", "$$"], ["\\$","\$/extract_itex]"] ], displayMath: [ ["$$","$$"], ["\\[", "\$"] ], processEscapes: true, ignoreClass: "tex2jax_ignore|dno" },
TeX: {  equationNumbers: {autoNumber: "all"}, noUndefined: { attributes: { mathcolor: "red", mathbackground: "#FFEEEE", mathsize: "90%" } },
Macros: { href: "{}" } },
messageStyle: "none"
});
</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="/home/external_libs/MathJax-2.7.7/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
-->

<body>

Type your text here.  Example equation:
$$\sin^2(x) + \cos^2(x) = 1.$$

</body>
</html>


Then simply view the edited template HTML file in almost any web browser.

• This works great! Of course, it only works if I am on line. And mathjax.org is on line. – GEdgar Mar 3 at 12:52
• @GEdgar The commented out portion lets you use this offline. I downloaded MathJax (from Github I think) to the directory "/home/external_libs/MathJax-2.7.7" on my computer. If you download MathJax, change the directory name in the template to the location of MathJax on your computer, uncomment the commented out portion, and comment out the <script></script> block linking to the MathJax website, you can use this offline. – J. Heller Mar 5 at 18:32

If you just need to compile an equation, LaTeX2PNG is an option. As you could probably guess, it converts LaTeX to an image format.

http://latex2png.com/