Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I want to modify the parameters used by \item in a {list} environment. Where can the original definition be found in my LaTeX distribution to copy and modify?

share|improve this question

3 Answers 3

up vote 18 down vote accepted

It is not recommend to modify the definition of \item (actually, the definition of your list environment) if you are not TeXpert. There are lot of length parameters that can be customized by non-experienced user. They are listed below.

(borrowed from Lamport's book)

Here is an example how to reset vertical space between paragraph in all items:

\begin{itemize}
\setlength{\parskip}{3pt plus 3pt minus 1pt}
\item 
1st paragraph

2nd paragraph

...
\end{itemize}

Note that vertical lengths are stretchable; in this example \parskip is normally will be 3 points (pt) but can be as small as 2 pt and as large as 6 pt (or even bigger, I am not sure). If

\setlength{\parskip}{3pt plus 3pt minus 1pt}

is put inside the invironment, it acts only on that particular occurence of the environment. You may want to put it also outside:

\setlength{\parskip}{3pt plus 3pt minus 1pt}

...

\begin{itemize}
\item 
1st paragraph

2nd paragraph

...
\end{itemize}
share|improve this answer
1  
wow, nice explanation! where did you find the drawing? –  Brandon Kuczenski Mar 4 '11 at 8:35
1  
It is taken from Lamport's book. –  Igor Kotelnikov Mar 4 '11 at 13:02

If you do not know where to look for the definitions you can use texdef. To use it with LaTeX definitions you have to either call it with the option -t latex or use the corresponding alias latexdef (if the alias is defined on your system).

To check the definition for \item you can issue texdef -t latex \item. To also check where the definition is to be found add the option -f,

texdef -t latex -f item

which on my system it returns:

\item is defined by (La)TeX.

\item:
macro:->\@inmatherr \item \@ifnextchar [\@item {\@noitemargtrue \@item [\@itemlabel ]}

That it is said to be defined by LaTeX indicates that is defined in the LaTeX sources and its documentation you can get to by issuing texdoc source2e.

If you want to see the available options for texdef or learn more about it you can access its documentation with texdoc texdef.

share|improve this answer
    
Wow, useful command I was not aware of before. –  Daniel Jan 30 '12 at 21:48

Well, source2e.pdf is probably the canonical reference in this context. texdoc source2e should provide it (or you can find it on CTAN). It's all in section 56, "List, and related environments". There a couple of things to consider, though:

  1. A package or class you use may make some redefinitions, which you would have to take into account.

  2. It is possible that some package already provides what you want to do. For example, the enumitem package provides many ways to customize lists and their parameters.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.