Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

What is the best way to achieve a list where items are seamlessly aligned either left, centered, or right. I am more so interested in the items being left aligned, (for instance a series or (system) of equations). I have an equation "E" and want to create a left aligned list describing what the variables represent or equal to as shown in the example below.

enter image description here

share|improve this question
    
Please elaborate on what exactly you want to achieve. E.g. what do you mean by elegant? –  canaaerus Jun 26 '12 at 5:44
2  
align environment from amsmath package? –  Vafa Khalighi Jun 26 '12 at 5:53
1  
@Reza: I think you should rephrase your question to be just a bit more clear if the answers provided is what you are looking to do. I could not tell from reading the question the way it is now. I think this will yield much better responses. –  night owl Jun 26 '12 at 7:22

4 Answers 4

up vote 15 down vote accepted

I would do this using an itemized list:

enter image description here

If you want the terms left aligned instead, you can use the [align=left, leftmargin=<length>, labelwidth=\widthof{<widest_term>}] options to produce:

enter image description here

Note:

  • I used the geometry package and the adjusted the paperwidth= so that the wrapping of the lines can more easily be seen.

Code:

\documentclass{article}
\usepackage[paperwidth=8.0cm,showframe]{geometry}
\usepackage{amsmath}
\usepackage{calc}
\usepackage{enumitem}

\begin{document}
\noindent
The final equation is:
\[ x= (m*n)+P+Q \]
where\par
\begin{itemize}
  \item [$x$] is some really long explanation of this value 
  \item [$n$] is the value of 
  \item [$m$] is the value of
  \item [$P$] is the value of
  \item [$Q$] is the value of
\end{itemize}

\noindent
The final equation is:
\[ x= (m*n)+P+Q \]
where\par
\begin{itemize}[align=left,leftmargin=1.5cm,labelwidth=\widthof{$P+Q$}]
  \item [$x$] is some really long explanation of this value 
  \item [$m*n$] is the their product
  \item [$P+Q$] is the their sum
\end{itemize}
\end{document}
share|improve this answer

Probably overkill, but I did this for my thesis, it was long ago, when I was a true LaTeX newbie, I didn't even know about memoir

\documentclass[a5paper]{article}

\newenvironment{descr}[1]{\list{}{%
  \setlength{\topsep}{0pt}
  \setlength{\itemsep}{0pt}
  \setlength{\parsep}{0pt}
  \setlength{\itemindent}{0pt}
  \settowidth{\labelwidth}{#1}
  \setlength{\labelsep}{2ex}
  \setlength{\leftmargin}{\parindent}
  \addtolength{\leftmargin}{\labelwidth}
  \addtolength{\leftmargin}{\labelsep}
  }}
  {\endlist}
\newcommand{\itemdesc}[1]{\item[#1\hspace*{\fill}]}

\begin{document}

\begin{descr}{$\vec{f}_{i\alpha j\beta}$}
  \itemdesc{$\vec{R}_i$} es la posición del centro de masas de la molécula $i$, $\vec{R}_i=\frac{1}{M_i}\sum_\alpha m_{i\alpha}\vec{r}_{i\alpha}$.
  \itemdesc{$M_i$} es la masa total de la molécula $i$, $M_i=\sum_\alpha m_{i\alpha}$.
  \itemdesc{$\vec{F}_i$} es la fuerza total en el centro de masas de la molécula $i$, $\vec{F}_i=\sum_{\alpha j\beta}\vec{f}_{i\alpha j\beta}$.
  \itemdesc{$\vec{f}_{i\alpha j\beta}$} es la fuerza existente entre el átomo $\alpha$ de la molécula $i$ y el átomo $\beta$ de la molécula $j$.
  \itemdesc{$\vec{J}_i$} es el tensor momento de inercia de la molécula $i$, $\vec{J}_i=\sum_\alpha m_{i\alpha}(s_{i\alpha}^2\vec{I}-\vec{s}_{i\alpha}\,\vec{s}_{i\alpha}^T)$.
  \itemdesc{$\vec{s}_{i\alpha}$} es el vector posición del átomo $\alpha$ respecto al centro de masas de la molécula $i$, $\vec{s}_{i\alpha}=\vec{r}_{i\alpha}-\vec{R}_i$.
  \itemdesc{$\vec{\omega}_i$} es la velocidad angular de la molécula $i$.
  \itemdesc{$\vec{N}_i$} es el momento de la fuerza total sobre la molécula $i$, $\vec{N}_i=\sum_\alpha\vec{s}_{i\alpha}\times\vec{f}_{i\alpha}$.
\end{descr}

\end{document}

enter image description here (ignore missing accents)

By contrast, the simple itemize environment (as in Peter Grill's answer) gives you this alignment:

enter image description here

(Note I also changed vertical spacing in my customized environment.)

share|improve this answer

If your definitions are quite uniform, you can put them in a align environment like Vafa suggested:

\begin{align}
    x &:= (m*n)+P+Q\\
    n &:= ...
\end{align}

But if the left side of the definitions differ to much, it might not look to good anymore. Also it could happen that the right side needs more than one line. In that case you need to break it, which is a sensible topic, compare http://stackoverflow.com/questions/1578127/how-do-i-break-a-long-equation-over-lines. For unnumbered equations you could do

\begin{align*}
    x &:= (m*n)+P+Q+R+S+...\\
    &\quad +Y+Z+\pi\\
    n &:= ...
\end{align*}

Furthermore it is always sensible to give some meaning to the variables you define by putting a descriptive text. Using aligned equations there are two possibilities:

\begin{align}
    x &:= (m*n)+P+Q+R+S+... && \text{number of birds in the cage}\\
    \intertext{where $n$ is the usual number:}
    n &:= ...
\end{align}
share|improve this answer
    
For the := see tex.stackexchange.com/q/4216/86 –  Loop Space Jun 26 '12 at 8:33
    
@Andrew: I think the := looks just fine and using anything more complicated is overkill. –  canaaerus Jun 26 '12 at 8:41
1  
also, the is comprehensive documentation for amsmath available –  matth Jun 28 '12 at 10:51

The KOMA classes provide the labeling environment, whose labels are left-aligned.

\documentclass{scrartcl}

\begin{document}
\begin{labeling}{MM}
\item[$\vec{R}_i$] Position des Massenmittelpunktes 
     $\vec{R}_i=\frac{1}{M_i}\sum_\alpha m_{i\alpha}\vec{r}_{i\alpha}$
\item[$\vec{f}_{i\alpha j\beta}$] es la fuerza existente entre el tomo
     $\alpha$ de la molcula $j$
\end{labeling}

\end{document}

If you don't want to use the KOMA classes you may look at scrartcl.cls and copy the definition of labeling into your preamble.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.