Text Formatting ⇒ Long enumerated List with custom Alignment
Long enumerated List with custom Alignment
I want to create an automatic, left-aligned, numbered list that exceeds nine items, something like this:
1. xx
2. xx
3. xx
4. xx
5. xx
6. xx
7. xx
8. xx
9. xx
10. xx
11. xx
12. xx
BUT, here's the catch ... I want the text that follows each item (single & double-digits) to have the same alignment.
How do I accomplish this?
Any suggestions would be very welcomed.
Thanks,
audreyk
1. xx
2. xx
3. xx
4. xx
5. xx
6. xx
7. xx
8. xx
9. xx
10. xx
11. xx
12. xx
BUT, here's the catch ... I want the text that follows each item (single & double-digits) to have the same alignment.
How do I accomplish this?
Any suggestions would be very welcomed.
Thanks,
audreyk
NEW: TikZ book now 40% off at Amazon.com for a short time.

-
- Posts: 45
- Joined: Fri Mar 16, 2012 8:22 pm
Long enumerated List with custom Alignment
Have a look at the enumitem package. It allows you to personnalise your numbered list. Here is an example of what you are looking foraudreyk wrote:I want to create an automatic, left-aligned, numbered list that exceeds 9 items, something like this:
1. xx
2. xx
3. xx
4. xx
5. xx
6. xx
7. xx
8. xx
9. xx
10. xx
11. xx
12. xx
audreyk
Code: Select all
\documentclass{article}
\usepackage{enumitem}
\begin{document}
\begin{enumerate}[label=\arabic*.,align=left]
\item 22
\item 22
\item 22
\item 22
\item 22
\item 22
\item 22
\item 22
\item 22
\item 22
\item 22
\item 22
\end{enumerate}
\end{document}
Alain Rémillard
Re: Long enumerated List with custom Alignment
Thanks, it worked!
- svend_tveskaeg
- Posts: 478
- Joined: Sun Jul 12, 2009 5:31 am
Long enumerated List with custom Alignment
If you want the text in every line, except the first in each
I cannot remember when or where I got the code or from whom I got it but it is not my own suggestion.
\item
, to extend into the left margin, you can do the following:Code: Select all
\documentclass{article}
\newcounter{myenumi}
\renewcommand{\themyenumi}{(\roman{myenumi})}
\newenvironment{myenumerate}{%
% stuff for beginning of environment goes here
\setlength{\parindent}{0pt}% don't indent paragraphs
\setcounter{myenumi}{0}% restart numbering
\bigskip% skip a line
\renewcommand{\item}{% new definition of item
\par% start a new line
\refstepcounter{myenumi}% advance counter
\makebox[2.5em][l]{\themyenumi}% print counter to width of 3em, aligned to left
}% end of definition of item
}{% at end of environment
\par% start new paragraph
\bigskip% skip a line
\noindent% don't indent new paragraph
\ignorespacesafterend% ignore spaces after environment
}
\begin{document}
Here is some regular text, and I'm going to go on a bit just to see where it wraps and all that.
\begin{myenumerate}
\item Here is the first item which goes on a bit so we can see how it wraps, and it still needs to be longer.
\item Here is another item.
\item Here is yet another item.
\item And this item is going to be much much longer so we can see another example of one that wraps.
\end{myenumerate}
Here is some more regular text, and let's go on a bit here too, just in case it's important how that looks too.
\end{document}
Last edited by svend_tveskaeg on Fri Feb 01, 2013 2:32 am, edited 1 time in total.
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)
-- Zapp Brannigan, Futurama (season 1, episode 4)
Long enumerated List with custom Alignment
I like the flush left alignment of the list numbers and text (the fix works like a charm), but now I want to decrease the horizontal spacing slightly between the numbers and the start of the text after each item number. Can you show me how to do this?
Thanks again!
Code: Select all
\documentclass{article}
\usepackage{enumitem}
\begin{document}
This is the start of a paragraph. This is the start of a paragraph. This is the start of a paragraph. This is the start of a paragraph.
\begin{enumerate}[label=\arabic*., align=left]
\item This line wraps into two lines. This line wraps into two lines. This line wraps into two lines. This line wraps into two lines. This line wraps into two lines.
\item This line wraps into two lines. This line wraps into two lines. This line wraps into two lines. This line wraps into two lines. This line wraps into two lines.
\item This line wraps into two lines. This line wraps into two lines. This line wraps into two lines. This line wraps into two lines. This line wraps into two lines.
\item This line wraps into two lines. This line wraps into two lines. This line wraps into two lines. This line wraps into two lines. This line wraps into two lines.
\item This line wraps into two lines. This line wraps into two lines. This line wraps into two lines. This line wraps into two lines. This line wraps into two lines.
\item This line wraps into two lines. This line wraps into two lines. This line wraps into two lines. This line wraps into two lines. This line wraps into two lines.
\item This line wraps into two lines. This line wraps into two lines. This line wraps into two lines. This line wraps into two lines. This line wraps into two lines.
\item This line wraps into two lines. This line wraps into two lines. This line wraps into two lines. This line wraps into two lines. This line wraps into two lines.
\item This line wraps into two lines. This line wraps into two lines. This line wraps into two lines. This line wraps into two lines. This line wraps into two lines.
\item This line wraps into two lines. This line wraps into two lines. This line wraps into two lines. This line wraps into two lines. This line wraps into two lines.
\item This line wraps into two lines. This line wraps into two lines. This line wraps into two lines. This line wraps into two lines. This line wraps into two lines.
\item This line wraps into two lines. This line wraps into two lines. This line wraps into two lines. This line wraps into two lines. This line wraps into two lines.
\end{enumerate}
This is the start of a paragraph. This is the start of a paragraph. This is the start of a paragraph. This is the start of a paragraph.
\end{document}
Last edited by localghost on Thu Jan 31, 2013 11:38 pm, edited 1 time in total.
Long enumerated List with custom Alignment
You need to play a bit with the different widths and seps that are mentioned in the
enumitem documentation. Something along these lines:
Maybe it is also better to define a custom list for this:
Regards

Code: Select all
\documentclass{article}
\usepackage{enumitem}
% the following two commands are just for laziness and
% keeping the example short:
\newcommand*\longitem{%
\item This line wraps into two lines. This line wraps into two lines.
This line wraps into two lines. This line wraps into two lines. This
line wraps into two lines.
}
\newcommand*\twelveitems{%
\longitem\longitem\longitem\longitem\longitem\longitem
\longitem\longitem\longitem\longitem\longitem\longitem
}
\begin{document}
This is the start of a paragraph. This is the start of a paragraph. This is the
start of a paragraph. This is the start of a paragraph.
\begin{enumerate}[
label = \arabic*. ,
align = left ,
leftmargin = 1.75em ,% = labelwidth + labelsep + labelindent
labelwidth = 1.5em ,
labelindent = 0em ,
labelsep = .25em]
\twelveitems
\end{enumerate}
This is the start of a paragraph. This is the start of a paragraph. This is the
start of a paragraph. This is the start of a paragraph.
\end{document}
Code: Select all
\documentclass{article}
\usepackage{enumitem}
\newlist{myenumerate}{enumerate}{3}
\setlist[myenumerate]{
label = \arabic*. ,
align = left ,
leftmargin = 1.75em ,% = labelwidth + labelsep + labelindent
labelwidth = 1.5em ,
labelindent = 0em ,
labelsep = .25em
}
% the following two commands are just for laziness and
% keeping the example short:
\newcommand*\longitem{%
\item This line wraps into two lines. This line wraps into two lines.
This line wraps into two lines. This line wraps into two lines. This
line wraps into two lines.
}
\newcommand*\twelveitems{%
\longitem\longitem\longitem\longitem\longitem\longitem
\longitem\longitem\longitem\longitem\longitem\longitem
}
\begin{document}
This is the start of a paragraph. This is the start of a paragraph. This is the
start of a paragraph. This is the start of a paragraph.
\begin{myenumerate}
\twelveitems
\end{myenumerate}
This is the start of a paragraph. This is the start of a paragraph. This is the
start of a paragraph. This is the start of a paragraph.
\end{document}
site moderator & package author
Re: Long enumerated List with custom Alignment
Your resolution worked perfectly ... thank you so much for the expert help!
Regards,
Audrey
Regards,
Audrey
