pandoc-2.1.1: test/command/4254.md
```
% pandoc -f rst -t latex
.. math::
x &= y\\
y &= z
^D
\[\begin{aligned}
x &= y\\
y &= z
\end{aligned}\]
```
```
% pandoc -f rst -t latex
.. math::
x &= y\\
y &= z
^D
\[\begin{aligned}
x &= y\\
y &= z
\end{aligned}\]
```