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.

I'm attempting to left-align a centered list of elements.

\begin{center}
\begin{align}
\begin{description}
\item[] lorem
\item[] ipsum
\item[] lorem
\item[] ipsum
\end{description}
\end{align}
\end{center}

"align" can only be used in a math environment, however, which isn't appropriate for my usage. This seems like a simple problem, but I continue to trip over it.

share|improve this question
add comment

1 Answer

Please always post complete documents it makes answering the question easier.

It's not clear if it is just an artifact of the cut down example but description with empty labels doesn't really work as there is nothing to describe.

To just get a centered column left aligned on the longest line, the simplest is to use a tabular environment. If you do really need the layout of a display list such as description, then one way is to use the varwidth package as also shown. enter image description here

\documentclass{article}

\usepackage{varwidth}

\begin{document}

\noindent X\dotfill X

\noindent X\dotfill X

\begin{center}
\begin{tabular}{l}
lorem\\
ipsum\\
lorem\\
ipsum
\end{tabular}
\end{center}

\noindent X\dotfill X

\begin{center}
\begin{varwidth}{\textwidth}
\begin{description}
\item[abc] lorem
\item[xyz] ipsum
\item[abc] lorem
\item[123] ipsum
\end{description}
\end{varwidth}
\end{center}



\noindent X\dotfill X

\end{document}
share|improve this answer
    
Why varwidth requires the width as a second parameter and then ignores it? –  JLDiaz Jul 30 '12 at 15:20
2  
It's the maximum width: lines longer than that are wrapped to that width (like minipage) but if no lines are that long the whole box is reduced to the width of the longest entry (unlike minipage) –  David Carlisle Jul 30 '12 at 15:22
    
Thank you very much! The tabular environment worked perfectly. –  Myles Barros Jul 30 '12 at 15:47
    
@MylesBarros Then, please remember to accept David Carlisle answer. –  Sveinung Jul 31 '12 at 9:35
add comment

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.