[OS X TeX] Book class tweaks
Bruno Voisin
bvoisin at mac.com
Mon Jan 15 09:41:48 CET 2007
Le 15 janv. 07 à 06:43, Ross Moore a écrit :
> One way to simplify the coding for this is to define
> your own environment; e.g.
>
> \newenvironment{numberedlist}{%
> \begingroup
> \addtolength{\topsep}{-3pt}%
> \addtolength{\partopsep}{-3pt}%
> }{%
> \end{enumerate}%
> \endgroup
> }
>
> and use simply:
>
> \begin{numberedlist}
> \item ...
> \item ...
> ...
> \end{numberedlist}
Another way, if you want the formatting of all lists to be affected,
is to redefine the lists parameters globally. However, one difficulty
is that list parameters are initialized at \begin{document}. Hence,
simply redefining them in your preamble won't work, as any
redefinition you might have done will be overwritten at \begin
{document}.
To deal with this, there is a specific command \AtBeginDocument,
meaning the commands given as argument are added to the sequence of
commands executed at \begin{document}. See:
/Library/TeX/Documentation/texmf-texlive-doc/latex/base/clsguide.pdf
for a gwTeX-based install,
/Library/TeX/Documentation/texmf-dist-doc/latex/base/clsguide.pdf
for a TeXLive-based install.
For example, my documents often contain code like, in the preamble:
\makeatletter
\AtBeginDocument{%
\renewcommand{\@listi}
{\setlength{\leftmargin}{\leftmargini}
\setlength{\topsep} {0pt}
\setlength{\parsep} {2.5pt plus1pt minus1pt}
\setlength{\itemsep}{2.5pt plus1pt minus1pt}}
\renewcommand{\@listii}
{\setlength{\leftmargin}{\leftmarginii}
\setlength{\labelwidth}{\leftmarginii}
\addtolength{\labelwidth}{-\labelsep}
\setlength{\topsep} {0pt}
\setlength{\parsep} {1pt plus0pt minus1pt}
\setlength{\itemsep}{1pt plus0pt minus1pt}}}
\makeatother
\@listi relates to first-level lists (ie lists within ordinary text),
\@listii to second-level lists (ie lists within lists), and so forth.
Hope this helps,
Bruno Voisin
------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/
More information about the macostex-archives
mailing list