# Sizing of nested expressions in math mode

Consider the following example in math mode:

\documentclass[a4paper,11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\begin{document}
$$e^{i\frac{\theta_{\!j}}{2}}$$
\end{document}


This is really looking ugly and this seems to be caused by j having approximately the same size as theta. How can I fix the size of j and why is this not automatically done?

• My vote goes to \exp\Bigl(i\,\frac{\theta_{j}}{2}\Bigr). I'd not squeeze j against \theta. – egreg May 28 '15 at 9:14

There is a \scriptstyle, and a \scriptscriptstyle, but no \scriptscriptscriptstyle. Presumably this is to prevent the type from becoming so small as to be unreadable. I would write it as follows, so that it has two levels of sub/superscripting, but not three.

\documentclass[a4paper,11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\begin{document}
$$\mathrm{e}^{\mathrm{i}\theta_j/2}$$
\end{document}

• So there is no way to get something like \scriptscriptscriptstyle? The alternative ways of writing this expression will make the output too wide for my purposes (a rather big matrix, which otherwise will cause some overflows). – dba May 28 '15 at 10:28
• You could probably use a dirty hack involving \scalebox to make a smaller 'j'. However, when a hack is necessary to make an object fit on a page, I take it as a sign that it's time to rethink my notation. – Ian Thompson May 28 '15 at 10:41

There are many ways, for example:

\documentclass[a4paper,11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{mleftright}
\newcommand*{\img}{\mathrm{i}}
\newcommand*{\euler}{\mathrm{e}}
\begin{document}
\begin{gather}
e^{i\frac{\theta_{\!j}}{2}}
= e^{i\,\theta_{\!j}/2}
= \exp(i\frac{\theta_{\!j}}{2})
= \exp\Bigl(i\frac{\theta_{\!j}}{2}\Bigr)
= \exp\mleft(i\frac{\theta_{\!j}}{2}\mright)
= \exp(i\,\theta_{\!j}/2)
\\
\euler^{\img\frac{\theta_{\!j}}{2}}
= \euler^{\img\,\theta_{\!j}/2}
= \exp(\img\frac{\theta_{\!j}}{2})
= \exp\Bigl(\img\frac{\theta_{\!j}}{2}\Bigr)
= \exp\mleft(\img\frac{\theta_{\!j}}{2}\mright)
= \exp(\img\,\theta_{\!j}/2)
\end{gather}
\end{document}