答案1
以下地址两个都问题 - 如何调整itemize
环境上方和下方的分离。这是使用键值方法完成的(感谢 [ keyval
](ht,它允许您设置beforeskip
和afterskip
(默认值为0pt
)。
\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}