3

I am working in memoir class and would like to customize some nested lists. But I do not know all the style parameters, in particular, the lengths. How can I list them? This is a generic question, but I provide the following example. To what length does \leftmargin refer outside the lists, within the outer list, and within the inner list?

\documentclass[12pt]{memoir}
\begin{document}
$\backslash$leftmargin = \the\leftmargin
\begin{description}
  \item{Outer 1} $\backslash$leftmargin = \the\leftmargin
  \begin{description}
    \item{Inner 1} $\backslash$leftmargin = \the\leftmargin
    \item{Inner 2} $\backslash$leftmargin = \the\leftmargin
  \end{description}
\item{Outer 2} $\backslash$leftmargin = \the\leftmargin
\end{description}
$\backslash$leftmargin = \the\leftmargin
\end{document}

Output
\leftmargin = 29.3747pt
 Outer 1 \leftmargin = 29.3747pt
 Inner 1 \leftmargin = 25.84969pt
 Inner 2 \leftmargin = 25.84969pt
 Outer 2 \leftmargin = 29.3747pt
\leftmargin = 29.3747pt
4
  • 2
    Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. Right now, it is not really clear what you are trying to do.
    – cfr
    Commented Jan 6, 2015 at 3:33
  • LaTeX and the memoir document class feature quite a few list-like environments. Which ones are you particularly interested in customizing?
    – Mico
    Commented Jan 6, 2015 at 3:55
  • @cfr & Mico. Thank you for you replies. I have modified the question. What I really want is to know are names of the various style parameters like \leftmargin, \listparindent, etc. and whether each list has its own set that can be modified outside the lists.
    – JimH
    Commented Jan 6, 2015 at 6:45
  • 1
    By the way, in text mode, it's better to write \textbackslash than $\backslash$.
    – Mico
    Commented Jan 6, 2015 at 6:47

1 Answer 1

1

The relevant code in memoir.cls is from line 4572 to line 4607:

\def\@listi{\leftmargin\leftmargini
  \parsep\parsepi
  \topsep\topsepi
  \itemsep\itemsepi}
\let\@listI\@listi
\defaultlists
\@listi

\def\@listii{\leftmargin\leftmarginii
             \labelwidth\leftmarginii
             \advance\labelwidth-\labelsep
             \topsep\topsepii
             \parsep\parsepii
             \itemsep\parsepii}

\def\@listiii{\leftmargin\leftmarginiii
              \labelwidth\leftmarginiii
              \advance\labelwidth-\labelsep
              \topsep\topsepiii
              \parsep\z@
%%%              \itemsep\topsep
%%%              \partopsep \p@ \@plus\z@ \@minus\p@
              \itemsep\itemsepiii
              \partopsep\partopsepiii}

\def\@listiv{\leftmargin\leftmarginiv
             \labelwidth\leftmarginiv
             \advance\labelwidth-\labelsep}

\def\@listv{\leftmargin\leftmarginv
            \labelwidth\leftmarginv
            \advance\labelwidth-\labelsep}

\def\@listvi{\leftmargin\leftmarginvi
             \labelwidth\leftmarginvi
             \advance\labelwidth-\labelsep}

where we see that the lists are defined in terms of \leftmarginX, where X stands for the (lowercase) Roman numeral denoting the list nesting level.

In mem12.clo we find

\renewcommand{\normalsize}{%
   \@setfontsize\normalsize\@xiipt{14.5}%
   \abovedisplayskip 12\p@ \@plus3\p@ \@minus7\p@
   \abovedisplayshortskip \z@ \@plus3\p@
   \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@
   \belowdisplayskip \abovedisplayskip
   \let\@listi\@listI}
\normalsize
\newcommand{\small}{%
   \@setfontsize\small\@xipt{13.6}%
   \abovedisplayskip 11\p@ \@plus3\p@ \@minus6\p@
   \abovedisplayshortskip \z@ \@plus3\p@
   \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@
   \def\@listi{\leftmargin\leftmargini
               \topsep 9\p@ \@plus3\p@ \@minus5\p@
               \parsep 4.5\p@ \@plus2\p@ \@minus\p@
               \itemsep \parsep
%%               \itemindent\z@
              }%
   \belowdisplayskip \abovedisplayskip
}
\newcommand{\footnotesize}{%
   \@setfontsize\footnotesize\@xpt\@xiipt
   \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
   \abovedisplayshortskip \z@ \@plus3\p@
   \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
   \def\@listi{\leftmargin\leftmargini
               \topsep 6\p@ \@plus2\p@ \@minus2\p@
               \parsep 3\p@ \@plus2\p@ \@minus\p@
               \itemsep \parsep
%%               \itemindent\z@
              }%
   \belowdisplayskip \abovedisplayskip
}

where we see that first level lists are redefined in the sizes \small and \footnotesize, the only ones where a list should be typeset in.

The values of the parameters is established in lines 4406 to 4421 of memoir.cls

\if@twocolumn
  \setlength{\leftmargini}{2em}
\else
  \setlength{\leftmargini}{2.5em}
\fi
\leftmargin \leftmargini
\setlength{\leftmarginii}{2.2em}
\setlength{\leftmarginiii}{1.87em}
\setlength{\leftmarginiv}{1.7em}
\if@twocolumn
  \setlength{\leftmarginv}{.5em}
  \setlength{\leftmarginvi}{.5em}
\else
  \setlength{\leftmarginv}{1em}
  \setlength{\leftmarginvi}{1em}
\fi

This part of the code is processed after memYY.clo has been read in, so after \normalsize has been issued and, as a consequence, the value of em is taken from the main font at that point, which is Computer Modern.

If you want to modify them, you're free to do it; if you plan to use em units, then do the changes using \AtBeginDocument after the font package you like has been loaded.

As you see, there are several parameters: \topsepX, \parsepX, \partopsepX (for X equal to i, ii oriii`).

The memoir class sets them using \defaultlists, but there are also \firmlists and \tightlists, see the manual.

2
  • Wouldn't it just be easier to base lists on enumitem?
    – daleif
    Commented Jan 6, 2015 at 11:39
  • @egreg Thank you. This is what I was looking for.
    – JimH
    Commented Jan 6, 2015 at 12:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .