7

I want to write rational numbers in mixed-numeral notation. To do so, I currently use \tfrac (AmSLaTeX):

\frac{5}{4} = 1\tfrac{1}{4}

But the fractional part is still too big for my taste. Therefore I defined \ttfrac with respect to genfrac as suggested in the "User's Guide for the amsmath Package" [amsldoc] (subsection 4.11.3):

\newcommand{\ttfrac}[2]{\genfrac{}{}{}{2}{#1}{#2}}

The above code then becomes:

\frac{5}{4} = 1\ttfrac{1}{4}

It fits better my taste, but now the fractional part is shifted down. What is the best way to raise it up a bit ?

8

You shouldn't write numbers that way, because it's ambiguous. Anyway, for raising the scriptsize fraction you can use \vcenter:

\documentclass{article}
\usepackage{amsmath}

\newcommand{\ttfrac}[2]{\vcenter{\hbox{$\genfrac{}{}{}{2}{#1}{#2}$}}}

\begin{document}

$1\ttfrac{1}{4}$ versus $1\tfrac{1}{4}$

\end{document}

enter image description here

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.