Is the aligned environment automatically \displaystyle? This test seems to indicate it is:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\(\begin{aligned}
\int_{0}^{\pi}f(x)dx &= \frac{1}{\pi} \\
\end{aligned}\)
\(\int_{0}^{\pi}f(x)dx = \frac{1}{\pi} \)
\end{document}
Additionally, amsmath.sty contains the following code:
\newcommand{\start@aligned}[2]{%
\RIfM@\else
\nonmatherr@{\begin{\@currenvir}}%
\fi
\savecolumn@ % Assumption: called inside a group
\alignedspace@left
\if #1t\vtop \else \if#1b \vbox \else \vcenter \fi \fi \bgroup
\maxfields@#2\relax
\ifnum\maxfields@>\m@ne
\multiply\maxfields@\tw@
\let\math@cr@@@\math@cr@@@alignedat
\alignsep@\z@skip
\else
\let\math@cr@@@\math@cr@@@aligned
\alignsep@\minalignsep
\fi
\Let@ \chardef\dspbrk@context\@ne
\default@tag
\spread@equation % no-op if already called
\global\column@\z@
\ialign\bgroup
&\column@plus
\hfil
\strut@
$\m@th\displaystyle{##}$%
\tabskip\z@skip
&\column@plus
$\m@th\displaystyle{{}##}$%
\hfil
\tabskip\alignsep@
\crcr
}
Unfortunately, I'm not much of a tex hacker so I can't be sure but the macro definition does include \displaystyle. However, I wasn't able to track this information down in the documentation. Section 3 (amsmath user guide) lists displayed equations but aligned is not among them.
Is there a good way to determine whether a given math environment is \displaystyle? Normally, I would have assumed inline math defaults to non-display but the aligned environment is used inside \(\) or $$.
\halignhas\m@th\displaysyle, so it uses that style. – egreg Dec 06 '19 at 16:12