TransWikia.com

Anki: Display equations not centering

TeX - LaTeX Asked on July 25, 2021

I’m using Anki to make some maths flashcards. I have created a card type where the front and back templates include the latex tags, ie

[latex]{{Front}}[/latex]
[latex]{{Back}}[/latex]

so that the whole card is typeset with Latex. (I’ve read here that this isn’t best practice – any reasons why?)

My issue is that my display equations are not centering when I don’t have much text.

Front:

$p in R$ is an irreducible element if

Back:

$p neq 0$, $p$ is not a unit and
[p =ab implies a text{ or } b text{ is a unit.}]

returns this:
enter image description here

This card with more text does center:
Front:

A Noetherian Ring

Back:

A ring is Noetherian if it satisfies the ascending chain condition: every increasing chain of ideals of $R$ is finite. For
[
I_1 subset I_2 subset I_3 subset ldots
]
there exists $n in N$ such that $I_N = I_{N+1} = ldots$.

which returnsenter image description here

Any clues what’s the issue here? Cheers.

One Answer

See here for more discussion: https://superuser.com/questions/1143538/latex-display-math-alignment-in-anki. Here are a few quick fixes, though, that I think are a better solution.

I've run into the same problem, and the best solution I've found is:

  1. In most of my flashcards, I have a title at the top. In that case, I add an hrulefill for a line under the title. This will fix the cropping issues that mess up your centering (since it won't crop too far left if there's a line spanning the entire page). For your first card, something like:

    begin{center}textsc{Criteria for an irreducible element}end{center}

    hfillrule

    blah blah blah

  2. Or you can add a number of spaces via the tilde symbol, ~, until you reach the boundary that tricks it into the correct centering.

Both have worked well enough for me not to bother with a better solution.

PS: Flashcards for math have done wonders for me, especially in Anki. Many people think it's silly, but especially in something like commutative algebra (which is what I'm assuming you're studying based on your examples), keeping all of your definitions straight is a life-saver in the long-run, especially when preparing for quals. Just drilling the definitions and statements of the theorems into your head won't make you a better mathematician, obviously, but algebra really has a lot in common with a language. Having the vocabulary at your fingertips goes a long way.

Answered by jons_stupid_questions on July 25, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP