I want to indent enumerated items more. However every method I found deals with a single item in a list. How do I do this globally?
2 Answers
One crude method is to modify the definition of \item
as follows:
\documentclass{article}
\usepackage{enumerate,letltxmacro}
\LetLtxMacro\itemold\item
\renewcommand{\item}{\itemindent10cm\itemold}
\begin{document}
Text
\begin{enumerate}[(1)]
\item One
\item Two
\item Three
\end{enumerate}
\end{document}
But this is going to give you probably unwanted behaviour with nested lists. Also, as you experience it affects a number of other enviroments, that naivly seem to have nothing to do with lists, since LaTeX internally uses a trivlist
environment as a basic building block for environment formatting.
I would advise you to switch entirely over to paralist
or enumitem
instead, for example as described below.
Paralist
With paralist
you use the command \setdefaultleftmargin
, which takes 6 arguments for the relative indents of the lists at levels 1 to 6. When using the optional argument to enumerate
, it turns out that you also have to specify one of the label adjustment options to the package, otherwise these margin changes will be ignored. (This looks like a bug in the otherwise well-tried package.)
\documentclass{article}
\usepackage[neverdecrease]{paralist}
\begin{document}
Test --- standard margins.
\begin{enumerate}[(1)]
\item One
\item Two
\begin{enumerate}[(a)]
\item Sub
\end{enumerate}
\item Three
\end{enumerate}
\setdefaultleftmargin{8cm}{2cm}{}{}{}{}
Test --- changed margins.
\begin{enumerate}[(1)]
\item One
\item Two
\begin{enumerate}[(a)]
\item Sub
\end{enumerate}
\item Three
\end{enumerate}
\end{document}
enumitem
Here you need to load the package with the shortlabels
option to get enumerate
's syntax for the specification of the labels. The \setlist
command is used to adjust default parameters for different lists and you can specify which levels they apply to. For example, \setlist[enumerate,1]
will apply to enumerates at level 1. Providing an argument of the form {leftmargin=10cm}
will then change the given left margin.
\documentclass{article}
\usepackage[shortlabels]{enumitem}
\begin{document}
Test --- standard margins.
\begin{enumerate}[(1)]
\item One
\item Two
\begin{enumerate}[(a)]
\item Sub
\end{enumerate}
\item Three
\end{enumerate}
\setlist[enumerate,1]{leftmargin=10cm}
\setlist[enumerate,2]{leftmargin=2cm}
Test --- changed margins.
\begin{enumerate}[(1)]
\item One
\item Two
\begin{enumerate}[(a)]
\item Sub
\end{enumerate}
\item Three
\end{enumerate}
\end{document}
The enumitem
package is newer has many more facilities than the lighter weight paralist
. It provides powerful and easy control over all types of list formatting.
Note the spacing in the paralist
and enumitem
examples is different, as there are some slightly different package defaults.
-
-
I use the enumerate package because I need to use different numberings for the list, like a), b), c) or (i), (ii), (iii). (Texifying something old.) Can this be done with the other packages you suggested?– h__Feb 8, 2013 at 16:27
-
1Absolutely, both packages provide such facilities.
paralist
's syntax is exactly asenumerate
's for this change, but you can also set defaults in a nice way.enumitim
has a package optionshortlabels
emulating theenumerate
syntax. Feb 8, 2013 at 21:25 -
The problem with
\proof
is not so unexpacted. LaTeX uses lists in all sorts of strange places to build various constructions that you wouldn't expect. That is way using one of the other packages is strongly recommended for such changes. Feb 8, 2013 at 21:26 -
I followed your suggestion and switched to
paralist
. However, the method described in the other answer doesn't work for me.– h__Feb 10, 2013 at 3:30
You can use the paralist
package to set the default left margins of lists/enumerates/etc. Simply use the command \setdefaultleftmargin
like so.
\documentclass{article}
\usepackage{paralist}
\usepackage{enumerate} %% to check paralist doesn't clash
\begin{document}
This is a test
\begin{enumerate}
\item This
\item is
\item a
\item list
\end{enumerate}
\setdefaultleftmargin{0pt}{}{}{}{}{}
This is a test
\begin{enumerate}
\item This
\item is
\item a
\item list
\end{enumerate}
\end{document}
You can find a description of \setdefaultleftmargin
here.
-
I'm trying to switch to the paralist package. But
\setdefaultleftmargin
doesn't work for me at all. I tried to put in all kinds of lengths but nothing changes. A command like\setdefaultleftmargin{1em}{2.2em}{1.8em}{3pt}{1em}{1cm}
doesn't give me any change.– h__Feb 10, 2013 at 3:29 -
It's possible that other packages are conflicting with it. Which others are you using? It could help to put
paralist
last, so that it overwrites the behaviour of any other packages you've loaded. If that doesn't work, where do you put\setdefaultleftmargin
? Try it inside the\begin{document}
if you can, again it may be another package changing the settings once\begin{document}
is processed. Feb 10, 2013 at 8:05 -
And if niether of those work, a MWE of it not working would be a great help! Feb 10, 2013 at 8:06
-
\newcommand{\nc}{\newcommand} \nc{\up}{\usepackage} \up[hmargin=1.2cm, vmargin=2cm]{geometry} \up{amsfonts} \up{amsmath} \up{amsthm} \up{amssymb} \up{xspace} \up[all]{xy} \up{ulem}% \uuline for double uline \up{extarrows} \up{paralist} \up[utf8]{inputenc} \up[T1]{fontenc} \up{titlesec}
– h__Feb 10, 2013 at 8:29 -
enumitem
. See section 5 Global settings (p 9) of theenumitem
documentation.enumerate
package for?enumerate
package is provided byenumitem
as well.