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.

1 Answer 1

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

6
  • @Stefan, thanks...I wasn't aware that there was an aligning environment outside of math mode. Doh!
    – Kristen
    Commented Nov 17, 2010 at 23:43
  • 1
    @Kristen: It's not outside math mode, but inside inline math mode. Commented Nov 18, 2010 at 9:46
  • 2
    how do I do it without the vertical centering
    – minseong
    Commented May 14, 2019 at 14:13
  • 1
    @theonlygusti found a solution?
    – Colo
    Commented Apr 26, 2020 at 19:29
  • 2
    @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 tex.stackexchange.com/a/153305/292581)
    – fbbdev
    Commented May 22, 2023 at 16:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .