Text Formatting ⇒ Long enumerated List with custom Alignment
Long enumerated List with custom Alignment
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.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
-
- 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
- svend_tveskaeg
- Posts: 478
- Joined: Sun Jul 12, 2009 5:31 am
Long enumerated List with custom Alignment
\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}
-- Zapp Brannigan, Futurama (season 1, episode 4)
Long enumerated List with custom Alignment
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}
Long enumerated List with custom Alignment

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}
Re: Long enumerated List with custom Alignment
Regards,
Audrey
