# Integration with textstyle fractions limits

I am trying to write an integration question like below with amsmath package:

\displaystyle\int_{\frac{\pi}{4}}^{\frac{\pi}{2}}\sin x\,\mathrm{d}x


However, the two fractions limits appear to be too small. I would like to do something like this:

\displaystyle\int_{\textstyle\frac{\pi}{4}}^{\textstyle\frac{\pi}{2}}\sin x\,\mathrm{d}x


Is there an efficient way to set all the integration limits in the document to \textstyle?

• Personally, I wouldn't do that. By the way, a full compilable example would be welcome (from \documentclass to \end{document}) so it allows us to just copy your code to start working rather than writing it ourselves ;) – Manuel Jul 18 '14 at 10:17
• Welcome to TeX.SX! You could use \tfrac, provided you have \usepackage{amsmath}; but the best is to use the slashed form: \int_{\pi/4}^{\pi/2} – egreg Jul 18 '14 at 10:17
• In fact, Dexter wong, I think you do want to use \tfrac in case, if you set all the sub/superscripts in textstyle \int_0^1 f would be definetly ugly with 0 and 1 of the same height of f. – Manuel Jul 18 '14 at 11:51
• Thanks everyone for your great comments. I will use \tfrac in my case. – Dexter Wong Jul 19 '14 at 7:43

The only sensible way is to use \tfrac. Note the inconsistency in a common situation either with default or using \textstyle:

    \documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{mathtools}

\begin{document}

Default:
$\int_{k\frac{\pi}{4}}^{k\frac{\pi}{2}}\sin x\,\mathrm{d}x$%
\vskip 2ex
With \verb+\tfrac+:
$\int_{k\tfrac{\pi}{4}}^{k \tfrac{\pi}{2}}\sin x\,\mathrm{d}x$%
\vskip 2ex
With \verb+\textstyle+:
$\int_{\textstyle k\frac{\pi}{4}}^{\textstyle k\frac{\pi}{2}}\sin x\,\mathrm{d}x$%

\end{document}


• And here I'm again (I will delete this shortly). Since you add inputenc and fontenc to your answers… I think I've read somewhere that it's better to load fontenc first. – Manuel Jul 18 '14 at 11:30
• This and this, although I might not understood correctly the second one because in the same answers it states that the order doesn''t matter (while the explanation, in my opinion, proves it otherwise) :D – Manuel Jul 18 '14 at 11:35

Is there an efficient way to set all the integration limits in the document to \textstyle?

When TeX is in displaymath mode, \int produces a "large" integral symbol and the upper and lower limits of integration are typeset in scriptstyle. What you're encountering is that the numerators and denominators inside these limits are typeset in scriptscriptstyle if \frac is used.

To change this default behavior globally, i.e., to switch from scriptstyle to textstyle in the limits of integration on a document-wide basis, would require major surgery on TeX's math innards and is not to be undertaken lightly. And I would hate to call such coding efficient. Moreover, you will probably not like the resulting look if the limits contain simple numbers and letters (since these will now be set in textstyle, i.e., the same size as applies for \sin x\,\mathrm{d}x.

You could use \tfrac explicitly -- \tfrac is short for \textstyle\frac-- to get scriptsize- rather than scriptscriptsize-sized numerator and denominator terms; the resulting look is also shown in @Bernard's earlier answer. Alternatively, you could use "inline-style" fraction notation, i.e., write \pi/4 and \pi/2 in the limits; these terms will be set in scriptstyle automatically.

\documentclass{article}
\usepackage{amsmath} % for \text and \tfrac macros
\begin{document}
$\int_{\frac{\pi}{4}}^{\frac{\pi}{2}}\sin x\,\mathrm{d}x % \frac \quad\text{vs.}\quad \int_{\tfrac{\pi}{4}}^{\tfrac{\pi}{2}}\sin x\,\mathrm{d}x % \tfrac \quad\text{vs.}\quad \int_{\pi/4}^{\pi/2}\sin x\,\mathrm{d}x % inline-style$
\end{document}