21

Is there any way to override the fact that certain environments in LaTeX are automatically "displayed"? One such example is the align* environment. I want to keep my aligned equations inline. So basically I want something like

\begin{align*}
x+y&=z\\
u+v&=w
\end{align*}

embedded into a line of text.

Kristen
  • 5,003

1 Answers1

34

In such cases you could simply use the aligned environment within inline math instead of align*:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
text
$\begin{aligned}
x+y&=z\\
u+v&=w
\end{aligned}$
more text
\end{document}

Output:

alt text

David Carlisle
  • 757,742
Stefan Kottwitz
  • 231,401
  • @Stefan, thanks...I wasn't aware that there was an aligning environment outside of math mode. Doh! – Kristen Nov 17 '10 at 23:43
  • 1
    @Kristen: It's not outside math mode, but inside inline math mode. – Hendrik Vogt Nov 18 '10 at 09:46
  • I wonder if it is essentially the same as \halign{#\hfill&&~#\hfill\cr text&$\eqalign{x+y&=z\cr u+v&=w}$&more text\cr}\bye in plain. – morbusg Nov 29 '10 at 12:35
  • 2
    how do I do it without the vertical centering – minseong May 14 '19 at 14:13
  • 1
    @theonlygusti found a solution? – Colo Apr 26 '20 at 19:29
  • 1
    @theonlygusti @Colo for anyone coming here in the future, here is the solution: use the t option to the aligned environment, as in \begin{aligned}[t] (taken from https://tex.stackexchange.com/a/153305/292581) – fbbdev May 22 '23 at 16:25