2
\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.

3

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.

  • Thanks, working perfectly now. I will file this under "too easy to spot". – blue_tiger300 May 29 '14 at 4:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.