[texhax] Label position in enumerated list
tomfool at as220.org
Fri Feb 16 15:27:48 CET 2007
Simmie, John <john.simmie at nuigalway.ie> wrote:
> Kopka & Daly show (Guide to LaTeX 4th ed., Fig. 4.1) the various
> parameters that control the layout of an enumerated list but
> surprisingly not the actual value of the label indent.
The reason this is a pain is because of how lists are constructed.
LaTeX calculates the indent at the beginning of the text, and the label
is snuck on by counting left from that point on the page.
> I need that to be zero so that the left margin of the text and the
> labels of an enumerated list are aligned, as eg
>  ..
>  ..
> Is there an easy hack please? I cannot use other packages, eg memoir or
> whatever, for this purpose ...
Here's a hack and a recipe for hacking things like it: find the place in
latex.ltx or article.cls that contains the code you want to modify. (In
the hack that follows, it's the definition of enumerate.) Copy it into
a \makeatletter\makeatother pair in your text, fidget until desired
results are acquired. Resist the slings and arrows of those who tell
you that you are making trouble for yourself by hacking what you don't
completely understand. (They are correct, but I assume you are already
aware of that, and have sorted through CTAN to no avail.)
See this, too: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=chngmargonfly
This is a fully-approved LaTeX-compatible way to do it, but it will be
challenging to get your labels to line up exactly on the left margin,
unless someone here can offer a trick I don't know.
But assuming you still can't make it work, try something like the
following, but remember the warnings above. You'll have to hack
further to get rid of the periods on the numbers, but I guess that's an
exercise best left to the hacker.
\ifnum \@enumdepth >\thr@@\@toodeep\else
\item First. First. First. First. First. First. First. First.
First. First. First. First. First. First. First.
\item Second Second Second Second Second Second Second Second
Second Second Second Second Second Second.
tomfool at as220 dot org
More information about the texhax