# LaTeX display math alignment in Anki

#### Frank

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:

\documentclass[10pt]{article}
\usepackage[paperwidth=5in, paperheight=100in]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{amssymb,amsmath,amsfonts,mathrsfs,color}
\pagestyle{empty}
\setlength{\parindent}{0in}
\newcommand{\C}{\mathbb{C}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\Z}{\mathbb{Z}}
\renewcommand{\Re}{\operatorname{Re}}
\renewcommand{\Im}{\operatorname{Im}}
\begin{document}

My card type front (in French) is:

${{Recto}}$

My card type back (in French) is:

{{FrontSide}}

<br />

${{Verso}}$

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;
max-height:1000px;
}

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 Posted by Damien Elmes on 09 Nov, 2016 06:32 AM

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

### Generic

? Show this help Blurs the current field

### Comment Form

r Focus the comment reply box Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

## Recent Discussions

 03 Apr, 2021 02:51 PM Random Images Missing 27 Mar, 2021 08:32 PM How do I get started on Mac? (completely lost) 19 Mar, 2021 07:48 PM Quizlet to Anki importer 2.1 no longer working 03 Jan, 2021 03:01 AM syncing failed 01 Nov, 2020 05:11 PM rated:30:1

## Recent Articles

 AnkiApp is not part of the Anki ecosystem Restoring an Automatic Backup (Recovering from Data Loss) Anki 2.0 add-ons Changing what's shown on the front or back of cards Changing colors/fonts/alignment/etc