[texhax] Varying indentation of lists while keeping wrap alignment

bnb at ams.org bnb at ams.org
Mon Feb 24 21:09:45 CET 2014


keith,

    \documentclass[11pt,a4paper]{amsbook} - with the \enumerate and \enumitem
    packages.

i'm going to forget about whatever code you
have, and advise you from the standpoint
of how the indentations for lists are set
up in amsbook.

amsbook really sets up the indentations
wider than they need to be, by the width
of \normalparindent .  here is the code
that does it, direct from amsbook.  i have
commented the line that should be omitted.

  \AtBeginDocument{%
    \labelsep=5pt\relax
    \setcounter{enumi}{13}\setcounter{enumii}{13}%
    \setcounter{enumiii}{13}\setcounter{enumiv}{13}%
    \settowidth\leftmargini{\labelenumi\hskip\labelsep}%
%   \advance\leftmargini by \normalparindent
    \settowidth\leftmarginii{\labelenumii\hskip\labelsep}%
    \settowidth\leftmarginiii{\labelenumiii\hskip\labelsep}%
    \settowidth\leftmarginiv{\labelenumiv\hskip\labelsep}%
    \setcounter{enumi}{0}\setcounter{enumii}{0}%
    \setcounter{enumiii}{0}\setcounter{enumiv}{0}%
    \leftmarginv=10pt  \leftmarginvi=\leftmarginv
    \leftmargin=\leftmargini
    \labelwidth=\leftmargini \advance\labelwidth-\labelsep
    \@listi}    

if you repeat this code in your preamble,
wrapping it in \makeatletter ... \makeatother
and omitting, or commenting out the indicated
line, i think you will end up with indentations
that you find more suitable, without recourse
to other packages.  (you may want to use other
packages after things are reset, for other
reasons, but try without first.)

you can also see that using \AtBeginDocument
foils any simple attempt to change the values
in your preamble, unless you also delay the
resetting until after this one takes place.

the number 13 was chosen because one of the
counters uses the latin alphabet (i've
forgotten which), and "m" is the widest
letter in computer modern.  and "xiii" is a
reasonable length for most lists that are
numbered with roman numerals.  but including
\normalparindent in the calculation was a
mistake.
						-- bb



More information about the texhax mailing list