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 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.

share|improve this question

4 Answers 4

up vote 11 down vote accepted

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}
share|improve this answer
6  
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}

enter image description here

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

share|improve this answer

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{addmargin}
\end{document}
share|improve this answer

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}
share|improve this answer
4  
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

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.