# Mixed numbers (fractions) with big ''integer part'' size

In some math textbooks for primary level, the mixed numbers are written with the integer almost the same height as the fraction. For example:

I want to write in LaTeX mixed numbers like the above image, in math mode and in a text line using \dfrac for write the fraction. My first approach (MWE) is very grotesque, but it does illustrate what I want:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\setlength{\parindent}{0pt}
\begin{document}
In text mode:
{\Huge 3}$\dfrac{1}{5}$.\\
In math mode:
$$\textrm{\Huge 3}\dfrac{1}{5}+\textrm{\Huge 2}\dfrac{4}{7}$$
\end{document}

• I find this notation very confusing, particularly for the primary level. – egreg May 15 '16 at 23:12
• @egreg How would you write it? As far as I recall, this is what fractions looked like when I first learnt them in primary school. – cfr May 15 '16 at 23:24
• @egreg This is the notation that is regularly used in school textbooks of my country and others. – G. Aguilera May 15 '16 at 23:26
• $$...$$ ought not be used in LaTeX. \\  ought not be used to break a line outside special contexts such as tabular and array. – cfr May 15 '16 at 23:27
• @egreg At primary level, no sign doesn't have that meaning. Isn't the point that this is supposed to make clear that this is one number and not two? In any case, if this is what the text books do, then this is the notation it makes sense to use in this context even if it would not be the best choice starting from scratch. And it might be better, starting from scratch, not to assign multiplication to no sign, of course. – cfr May 16 '16 at 11:19

This is what the scalerel package was intended to do (the package was inspired here: Making a summation sign adjust to contents of summation). It makes the first argument the same vertical extent as the second argument, processing arguments in math mode, and preserving the current math style.

\documentclass{article}
\usepackage{scalerel,amsmath}
\begin{document}
\centering
This is in text mode $\scalerel{5}{\dfrac{1}{3}}$.
$\scalerel{5}{\dfrac{1}{3}}\quad xyz$
\end{document}


As a compromise, line spacing can be preserved if this process is executed in \scriptstyle using $\scalerel{5}{\scriptstyle\frac{1}{3}}$:

A star version of the \scalerel macro does the same thing, but without actually printing out the 2nd argument.