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.

This refers to my previous question

How to reduce space in begining but not in end of itemize

Now I need to control spacing in the last of itemize like I could control in the beginning as suggested in previous question. How can I control it?

share|improve this question
    
Surely this is a duplicate of Vertical space in lists? –  Alan Munn Feb 28 '13 at 4:34
    
@AlanMunn, I think this is not what i want. I need to control spacing before and after itemlist list. –  user15662 Feb 28 '13 at 6:14

1 Answer 1

up vote 4 down vote accepted

The following addresses both questions - how to adjust the separation above and below an itemize environment. It's done using a key-value approach (thanks to [keyval](ht, which allows you to set beforeskip and afterskip (defaults are 0pt).

enter image description here

\documentclass{article}
\usepackage{keyval}% http://ctan.org/pkg/keyval
\makeatletter
\newlength{\mylist@beforeskip}
\newlength{\mylist@afterskip}
\define@key{mylist}{beforeskip}{\setlength{\mylist@beforeskip}{#1}}
\define@key{mylist}{afterskip}{\setlength{\mylist@afterskip}{#1}}
\newenvironment{mylist}[1][,]
  {\setkeys{mylist}{beforeskip=0pt,afterskip=0pt,#1}%
   \par\vspace*{\mylist@beforeskip}%
   \begin{itemize}}
  {\end{itemize}%
   \vspace*{\mylist@afterskip}}
\makeatother
\begin{document}
\noindent Here is some text. Regular \verb|itemize|:
\begin{itemize}
  \item stuff \item stuff \item 
\end{itemize}
Here is some text. New \verb|mylist|:
\begin{mylist}
  \item stuff \item stuff \item
\end{mylist}
Here is some text. New \verb|mylist| with \verb|beforeskip=-\baselineskip|:
\begin{mylist}[beforeskip=-\baselineskip]
  \item stuff \item stuff \item
\end{mylist}
Here is some text. New \verb|mylist| with \verb|afterskip=-\baselineskip|:
\begin{mylist}[afterskip=-\baselineskip]
  \item stuff \item stuff \item
\end{mylist}
Here is some text. New \verb|mylist| with \verb|beforeskip=afterskip=-\baselineskip|:
\begin{mylist}[beforeskip=-\baselineskip,afterskip=-\baselineskip]
  \item stuff \item stuff \item
\end{mylist}
Here is some text.
\end{document}
share|improve this answer
    
I changed 0 pt to 10pt still no change. I need to control its spacing in points. How can i do it? –  user15662 Feb 28 '13 at 7:48

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.