27
$\begingroup$

What is the relation between Latex and MathJax? I find this reference very useful for writing questions on mathematics site and I also came across this site for Latex symbols which seems very similar to me. So I want to understand the relation here.

$\endgroup$
2

3 Answers 3

37
$\begingroup$

As other answers have already explained, LaTeX and MathJax are related markup languages for preparing mathematical documents. In particular, MathJax is designed to be readily usable by people who know LaTeX. However, MathJax does not support the full power of LaTeX because (1) doing so would be very computationally intensive (2) doing so would be incompatible with supporting Markdown and basic HTML (3) doing so would open math.SE to malicious code insertion, since LaTeX is a Turing complete language.

As a first approximation, you can assume that LaTeX constructions you are familiar with will work in MathJax.

As a second approximation, you can assume that mathematical symbols and commands closely related to them will work, but commands related to page layout, document structure and macro programming may not.

For the details, see here.

$\endgroup$
5
  • 1
    $\begingroup$ Definining macros actually is supported. $\endgroup$
    – celtschk
    Sep 22, 2012 at 9:26
  • 1
    $\begingroup$ Defining macros is supported, in the sense that MathJax contains \def and \newcommand. I don't think (but could be wrong) that the full power of LaTeX's macro language is supported. $\endgroup$ Sep 22, 2012 at 13:04
  • $\begingroup$ holy crap LaTeX is turing complete?! to paraphrase the great teddy roosevelt: speak softly and surreptitiously learn languages that are turing complete $\endgroup$
    – franklin
    Apr 7, 2013 at 16:54
  • $\begingroup$ Would it be possible to define a macro and use it in a question on this site? $\endgroup$
    – MickG
    Apr 25, 2014 at 13:40
  • 1
    $\begingroup$ Simple \def and \newcommand definitely work, including with arguments; I use them regularly. I'm not sure how much of the full power of the TeX macro language is available $\endgroup$ Apr 25, 2014 at 13:43
14
$\begingroup$

MathJax is simply code that allows mathematical expressions in $\LaTeX$ format to be rendered on a webpage. The MathJax site has much more information.

$\LaTeX$ is a markup language for page description that heavily supports mathematical formulas.

$\endgroup$
0
12
$\begingroup$

$\LaTeX$ is typesetting software that's not limited to mathematical notation. $\LaTeX$ keeps track of page numbers, section numbers, etc., and does everything MSWord can do, more efficiently and with less clutter. One types whole articles and books in $\LaTeX$. MathJax is a very stripped-down relative of $\LaTeX$ used for mathematical notation on web pages.

Here is an example of a document written entirely in $\LaTeX$ --- not just the parts that are in mathematical notation. Obviously MathJax could not do this.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .