# Formatting fractions

I am using Anki (with LaTeX support), and have made a few fractions. However, the following doesn't work:

[$] \sin^2 \theta_m = \frac{{(n^{\omega }_o)}^{-2} - {(n^{2\omega }_o)}^{-2}} {{(n^{2\omega }_e)}^{-2}-{(n^{2\omega }_o)}^{-2}} [/$]


I can get the four bracketed quantities to appear, with both sub- and super- script characters. However, when I add the two sets of { and } brackets around the numerator and denominator, the output fails to display. The desired look is this:

The error log says: "This is pdfTeX, Version 3.14159265-2.6-1.40.16 (MiKTeX 2.9)"

Edit: Provided answer has working solution, with the condition that the pair of curly braces, {{, have a space between them to prevent Anki from interpreting the following text as a field - i.e.,

\sin^2 \theta_m = {{(n^{\omega}_o)^{-2} - (n^{2\omega}_o)^{-2}}\over{(n^{2\omega}_e)^{-2}-(n^{2\omega}_o)^{-2}}}


Note that the latter pair of curly closing braces, }}, doesn't need a space as Anki isn't looking for these if the first pair, { {, has a space between the braces.

• Please tell us more about your computing setup in general and about how anki is installed and being used. – Mico Apr 23 '17 at 11:14

This should probably be a comment but the expression was too big. It seems you have pdfTeX as compiler, but \frac is a LaTeX command and needs pdfLaTeX. You have two alternatives, either change compiler in the settings or change the command. For the first alternative I don't know how to set Anki, but you might get some help from https://askubuntu.com/a/671265. For the second you should use \over instead of \frac, something like this:
\sin^2 \theta_m = {(n^{\omega}_o)^{-2} - (n^{2\omega}_o)^{-2}\over(n^{2\omega}_e)^{-2}-(n^{2\omega}_o)^{-2}}

• @Idios - {...\over...} is Plain-TeX syntax, while \frac{...}{...} is LaTeX syntax. See this posting for more information on this subject. – Mico Apr 23 '17 at 13:25