Is it possible to set the leftmargin length when using the enumerate package? I'd like to limit the effect of leftmargin to a single environment invokation only and not set it globally.
Asked
Active
Viewed 5.5k times
18
ViktorStein
- 269
gablin
- 17,006
2 Answers
29
I recommend the package enumitem. Here you can set leftmargin local.
\documentclass{article}
\usepackage{enumitem,showframe}
\begin{document}
\begin{enumerate}[leftmargin=2cm]
\item foo
\item bar
\end{enumerate}
\begin{enumerate}[leftmargin=1cm]
\item foo
\item bar
\end{enumerate}
\begin{enumerate}
\item foo
\item bar
\end{enumerate}
\end{document}
Marco Daniel
- 95,681
-
\asbuk doesn't work in
enumitem, for some reason... Have to useenumerate– zarkone Jun 15 '16 at 16:38 -
add
[leftmargin=1cm]follow\begin{enumerate}does NOT work for me, but add[\hspace{1pt}(1)]works. – Bowen Xu Aug 21 '19 at 11:57
7
If you must use enumerate, you can start the optional argument of the enumerated list with an \hspace to push the whole list farther to the right:
\documentclass[leqno]{article}
\usepackage{amsmath,enumerate}
\begin{document}
Some text before the list.
\begin{enumerate}[\hspace{18pt}(P1)]
\item Some text.
\item Some text that goes onto two lines, so you can see where the second line will be aligned.
\item An equation:
\begin{equation}
1+1=2.
\end{equation}
\end{enumerate}
Some text after the list.
\end{document}
I don't know of a better way to do this with enumerate.
MSC
- 2,722
-
This is the better solution when one works with beamer, because the enumitem package is not suitable with it, see http://tex.stackexchange.com/a/52299/65333 . Thank you for your answer. – Veliko Oct 22 '16 at 19:35
-
thank you! I was desperatly searching for a way to do it without using enumitem! – Marine Galantin Mar 02 '21 at 12:30
enumitem. It is more flexible. Or do you stand onenumerate? – Marco Daniel Sep 11 '11 at 12:23enumeratepackage? I want to do the same thing and I am stuck with this package. – Abbas Feb 01 '13 at 20:32