I want all displayed mathematics in my document to be typeset in the style of inline mathematics. In his answer to this question, Matthew Leingang explains how to do the opposite (typeset all inline mathematics in the style of displayed mathematics) by carefully modifying the \everymath token list. Reasoning by analogy I figured that the following test document ought to work:
\documentclass[a4paper,reqno]{amsart}
\usepackage{amssymb,amsmath,amsthm,fullpage}
\everydisplay=\expandafter{\the\everydisplay\textstyle}
\begin{document}
\begin{align*}x
&=\sum_{i=1}^{10}i^2\\
&=t^3+\int_3^9y^a\,\mathrm{d}y\end{align*}
\end{document}
But it does not. When trying to compile this document, TeXWorks gives the following error:
! Improper \halign inside $$'s.
<recently read> \halign
The code it displays, as though to draw my attention to a mistake, is the code in the vicinity of \end{align*}. This error does not appear if the line in the preamble modifying \everydisplay is commented out. Why doesn't this work?
\halignoutside a display. – Bruno Le Floch Feb 23 '11 at 15:08