Using \begin{align} inside \begin{itemize}

Using \begin{align} inside \begin{itemize}

Post by Johan Tibe » Fri, 22 Sep 2006 23:26:25


I have a long equation like so:

$Q = \{a,b,c,d,e,f,g,h,i,j,k,l,n,...\}$

which I have as an \item in a \begin{itemize} list. Since the whole set
won't fit on one line I want to split it over though but I want the
first item (or at least the opening { ) to align with the elements on
the next line (by default they start to the very left). I tried to use
\begin{align*} but that creates a line break and indents the whole
thing to the right. What I need is an "inline" version of the align. Is
that possible?
 
 
 

Using \begin{align} inside \begin{itemize}

Post by Maarten Be » Sat, 23 Sep 2006 00:20:04

In article < XXXX@XXXXX.COM >,


It would have been easier if you had given an example of what you had
tried and what you didn't like about it.

I don't think an inline version of align makes sense. You could try
to move the alignment to the left by adding invisible stuff on the right:
\documentclass{amsart}
\begin{document}
\begin{itemize}
\item
\begin{align*}
Q =& \{a,
blablab,blablab,blablab,blablab,blablab,blablab,\qquad\qquad\qquad\\
&blablab,blablaby,c,d,e,f,g,h,i,j,k,l,n,...\}
\end{align*}
\item as compared to:
\begin{align*}
Q =& \{a, blablab,blablab,blablab,blablab,blablab,blablab,\\
&blablab,blablaby,c,d,e,f,g,h,i,j,k,l,n,...\}
\end{align*}
\end{itemize}
\end{document}

Or read Herbert Voss's documentation about the Math Mode:

ftp://cam.ctan.org/tex-archive/info/math/voss/mathmode/Mathmode.pdf

--
Maarten Bergvelt

 
 
 

Using \begin{align} inside \begin{itemize}

Post by Enrico Gre » Sat, 23 Sep 2006 00:24:32


\newlength{\mylen}
\settowidth{\mylen}{$Q=\{$}
\newcommand{\comma}{{,}\mskip3mu plus 1mu\relax
\discretionary{}{\kern\mylen}{}}

${Q=\{}a\comma b\comma ... \}$

Pay attention to the braces in the formula!

I don't think it is very nice, if the list item has more than two
lines. You can simply say

\newcommand{\comma}{{,}\mskip3mu plus 1mu\relax\penalty0 }

and this will give TeX an opportunity to break at every comma in the
list. The \mskip with a "plus" component is intended to give the right
spacing after the comma with some room to avoid underfull boxes.

Ciao
Enrico
 
 
 

Using \begin{align} inside \begin{itemize}

Post by Dan » Sat, 23 Sep 2006 03:28:48


That would be the aligned environment. Is something like this
what you want?:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{itemize}
\item
$\begin{aligned}[t]
Q = \{&a,b,c,d,e,f,g,h,i,j,k,l,\\
&n,...\}
\end{aligned}$
\item More items...
\item ...
\end{itemize}
\end{document}


Dan