7

I am trying to use Anki to create calculus flash cards. I use the input box on the math.stackexchange.com site since it is the easiest LaTex editor I know of to use for math equations. However, I spend a lot of time trying to fix errors because of differences in the way the code is compiled in Anki, which is probably due to differences in the preamble between Anki and math.stackexchange. Is there a way to find out what they use?

1
  • 9
    Math.SE uses MathJax which is not (La)TeX, although it uses mostly LaTeX syntax. There is no preamble nor any TeX processing of the input.
    – egreg
    Jun 15 '13 at 23:04
9

As it has been already answered, math.SE uses MathJax in order to display math equations specified in a TeX notation.

It is possible to reuse codes from math.SE in your document, by loading the right packages. With a look into the math.SE source code, you can find the following line, which calls MathJaX:

<script type="text/javascript" 
    src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>  

As you can read in the MathJaX Documentation, the TeX-AMS_HTML option "allows math to be specified in TeX or LaTeX notation, with the AMSmath and AMSsymbols packages included".

You should be able to reuse any equation from math.SE by loading amsmath and amssymb packages in your preamble:

\usepackage{amsmath}
\usepackage{amssymb}

It also works with Anki: in Anki2, go into the Option button in the Manage note types dialog, and add those two packages in the preamble. In Anki1, you can change the preamble in Settings > Deck Properties.

8

enter image description here

Installing and Testing MathJax

The easiest way to use MathJax is to link directly to the MathJax distributed network service (see Using the MathJax CDN). In that case, there is no need to install MathJax yourself, and you can begin using MathJax right away; skip this document on installation and go directly to Configuring MathJax.

MathJax can be loaded from a public web server or privately from your hard drive or other local media. To use MathJax in either way, you will need to obtain a copy of MathJax. There are three ways to do this: via git, svn, or via a pre-packaged archive. We recommend git or svn, as it is easier to keep your installation up to date with these tools.

...

More details, visit MathJax.

2
  • I got some reputations only by copying and pasting. A nice job for today. Thank you! Jun 16 '13 at 11:28
  • 1
    that happens :) I got most votes for this answer of mine before I made the edit when it only contained a quote.
    – cgnieder
    Jun 16 '13 at 13:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.