# Anki - LaTeX, Math Font Size, & DeclareMathSizes

I use the Anki flashcard program and render math equations using LaTeX within the program.

The problem is that the font sizes are generally too big, unless the equation is really long, in which case the equation automatically sizes down in order to fit the screen.

This is the default LaTeX header in Anki:

\documentclass[12pt]{article}
\special{papersize=3in,5in}
\usepackage{amssymb,amsmath}
\pagestyle{empty}
\setlength{\parindent}{0in}
\begin{document}


And this is the default footer:

\end{document}


To call LaTeX within Anki when creating a flashcard, you use $and$, which I assume refer to the header and footer respectively. (I'm neither an Anki nor a LaTeX expert.)

Anyway, I've tried inserting the following right before \begin{document}:

\DeclareMathSizes{2}{2}{2}{2}


Yes, I realize this is supposed to make the text really tiny, but more importantly, nothing changes. My equations are still too big (or too small, if the equation is really long).

-
welcome to tex.sx. For those of use (most of us I'd guess) without that program could you post the generated latex document including an equation so we can see what markup it is generating and then can suggest a preamble to control the fonts. –  David Carlisle Apr 12 '13 at 21:32
Welcome to TeX.sx! Usually, we don't put a greeting or a “thank you” in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Accepting and upvoting answers is the preferred way here to say “thank you” to users who helped you. –  Kurt Apr 12 '13 at 21:49
Maybe a simple change to the header is enough. Something like \documentclass[10pt]{article} should change all font sizes. –  Alexander Apr 12 '13 at 22:01
BTW: What is Anki? Never heard of it ... –  Kurt Apr 12 '13 at 22:05
@Kurt, thanks for the welcome and the information. Anki is a spaced-repetition flashcard program: ankisrs.net –  MMS Apr 12 '13 at 22:44

Tools -> Manage Note Types... -> Options; in the last line of the Header field after \begin{document} just type

\tiny


And your LaTeX will be made smaller. Because previously rendered latex is cached as image files, you may have to delete those files before the change is apparent. On my Mac the files are in ~/Anki/User 1/collection.media/latex-*.png

For me this makes my [$$][/$$] equations the same size as the surrounding Anki font.

I hope this helps!

-