Math & SciencePrevent Line Break between List Item and aligned Equations

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
fareastmovement
Posts: 2
Joined: Wed Dec 07, 2011 5:03 pm

Prevent Line Break between List Item and aligned Equations

Post by fareastmovement »

How to prevent new line between item and equation/align?

Code: Select all

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{enumerate}
\item
\begin{align*}
a&=1+1\\
&=2
\end{align*}
\end{enumerate} 
\end{document} 
Thank you ;)

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Stefan Kottwitz
Site Admin
Posts: 10359
Joined: Mon Mar 10, 2008 9:44 pm

Prevent Line Break between List Item and aligned Equations

Post by Stefan Kottwitz »

Hi,

I recommend using aligned:

Code: Select all

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{enumerate}
\item
  $\begin{aligned}[t]
    a&=1+1\\
    &=2
  \end{aligned}$
\end{enumerate}
\end{document
[t] is here for top alignment.

Stefan
LaTeX.org admin
fareastmovement
Posts: 2
Joined: Wed Dec 07, 2011 5:03 pm

Re: Prevent Line Break between List Item and aligned Equatio

Post by fareastmovement »

Thank You So Much! It worked well. :P
ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

Re: Prevent Line Break between List Item and aligned Equatio

Post by ghostanime2001 »

that's aligned not alignat
User avatar
Stefan Kottwitz
Site Admin
Posts: 10359
Joined: Mon Mar 10, 2008 9:44 pm

Re: Prevent Line Break between List Item and aligned Equatio

Post by Stefan Kottwitz »

I used aligned in the code but mentioned alignat in the post text, I already corrected it above,

Stefan
LaTeX.org admin
Post Reply