LaTeX display math alignment in Anki

Frank's Avatar


08 Nov, 2016 09:24 PM

I've been trying to create mathematics flashcards. Naturally, I wanted LaTeX to be the default typesetting system for those cards. In order to do so, I created a new basic note type named *basic math*. Here's my options header:

    \usepackage[paperwidth=5in, paperheight=100in]{geometry}

My card type front (in French) is:


My card type back (in French) is:

    <hr id=answer>
    <br />

Finally, here's my card type style:

    .card {
    font-family: arial;
    font-size: 10px;
    text-align: center;
    color: black;
    background-color: white;
    img {
    width: auto;
    height: auto;

Here's a card front (in French):

    Vrai ou faux ?
    z-\overline{z}=2\Im z

and its back:

    Faux. En général,
    z-\overline{z}=2{\color{red}i}\Im z

Alas, the rendering shown in the attached file "Anki_Problem" makes it clear that something's weird with the alignment of the display math. If I change the back of the card for this:

    Faux. En général, bla bla bla bla bla bla bla bla bla bla bla
    z-\overline{z}=2{\color{red}i}\Im z

then the equation is properly centered (as it should normally be by default with LaTeX): see the attached file "Anki_Problem2".

Therefore, I'd like to know how to get the proper center alignment (as in "Anki_Problem2"), like the Anki math environment [$$][/$$] would give?

  1. Support Staff 1 Posted by Damien Elmes on 09 Nov, 2016 06:32 AM

    Damien Elmes's Avatar

    Hi Frank,

    I'm afraid we can not provide official support for LaTeX, so I'll move your post to the community section.

Comments are closed, but you can start a new discussion.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac