# Flashcards with textfraction

\documentclass[12pt]{article}
\special{papersize=3in,5in}
\usepackage{amssymb,amsmath}
\usepackage{fontspec}
\usepackage{lmodern}
\usepackage[ngerman]{babel}
\pagestyle{empty}
\setlength{\parindent}{0in}
\newcommand{\textfrac}[2]{
\frac{\text{#1}}{\text{#2}}
}
\begin{document}

$\textfrac{Verkehrsleistung tkm}{Gütermenge t}$

$\textfrac{Outputrate \times Rüstzeit}{1 - Outputrate \times Zeit pro Stück}$

\end{document}


The first textfraction (and dozen others) works like a charm. The second one throws an error and I have no idea why. Any help is appreciated.

The \times is a math symbol, hence your line should read
$\textfrac{Outputrate $$\times$$ Rüstzeit}{1 - Outputrate $$\times$$ Zeit pro Stück}$

(or even in $\times$ if you prefer). Then it works fine. This is of course, because inside \text{...} you are back to textmode and have to - interally - change to math mode again.