# Set width of text in list

I am attempting to produce a list that has a width of (say) 5cm, as opposed to going to the far right of the page. Any advice is appreciated.

-

A simple way to do this is to put the list inside a minipage:

\documentclass{article}

\begin{document}
\begin{minipage}{5cm}
\begin{enumerate}
\item this is a list that will only take up 5 cm
\end{enumerate}
\end{minipage}
\end{document}

-
Note that the minipage is indented by \parindent making the actual list items end \parindent+5cm from the left margin. To remove this indent, remember to apply \noindent. – Werner Nov 7 '11 at 3:49

You can use the enumitem package, setting an appropriate value for rightmargin:

\documentclass{article}
\usepackage{enumitem}

\newcommand\Text{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,
vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida
mauris.}

\begin{document}

\Text
\begin{enumerate}[rightmargin=\dimexpr\linewidth-5cm-\leftmargin\relax]
\item \Text
\item \Text
\end{enumerate}
\Text

\end{document}


This method has an advantage over the the minipage and tabular approaches, since those don't allow for page breaks.

-

And because sometimes not the width of the list but the indent or white space left and right of the list should be limited, here's one more suggestion:

\documentclass{article}
\usepackage{scrextend}% add KOMA-Script features to other classes

\begin{document}
\begin{addmargin}[0pt]{.5\linewidth}% indent 0pt left, .5\linewidth right
\begin{enumerate}
\item This is another way to get a list that will have half of the line
empty at the right side.
\item The second item in the list.
\end{enumerate}
\end{document}

-

I think Alan Munn's suggestion is the most straightforward but here is another way:

\documentclass{article}

\begin{document}
\begin{tabular}{p{5cm}}
\begin{enumerate}
\item This is another way to get a list that will take up only 5 cm.
\item The second item in the list.
\end{enumerate}
\end{tabular}
\end{document}

-
As with the minipage approach, your tabular has additional column spacing on both sides as well as the paragraph indent. To remove this, add \noindent before the tabular environment, and use @{}p{5cm}@{} as your column specifier. – Werner Nov 7 '11 at 3:59