3
\documentclass[xcolor=x11names,compress]{beamer}
\usepackage{graphicx}
\usepackage{tikz}
\usepackage{enumitem}

I have a following code

\textbf{Definition 1.1} A {\it{design}} is a pair $(X,\mathcal{A})$ iff:
\begin{enumerate}[label={\it{\arabic*}}.,leftmargin=1cm,itemsep=0ex,parsep=-0.3ex]
\item \;\; $X$ is a set of {\it{points}};
\item \;\; $\mathcal{A}$ is a set of {\it{blocks}}.
\end{enumerate}

which can be compiled as

enter image description here.

But as you can see, the gap between the context and enumeration is quite big. I've used topmargin but didn't worked. How to reduce a gap between them?

Werner
  • 603,163

3 Answers3

3

You have relevant keys in enumitem itself: nosep or noitemsep. Also, instead of adding horizontal space between label and item body for each item, set labelsep in the options. Last, I replaced TeX syntax ({\it…}) with LaTeX syntax (\emph{…}).

Final advice: you should make your definition a theorem-like environment: formatting (boldface) could be pre-defined and numbering would be automatic, making cross-references easy. Imagine what would happen if you should decide to add a definition in the middle of your document.

\documentclass[xcolor=x11names,compress]{beamer}
\usepackage{graphicx}
\usepackage{tikz}
\usepackage{enumitem}

\begin{document}

\textbf{Definition 1.1} A \emph{design} is a pair $(X,\mathcal{A})$ iff:
\begin{enumerate}[label=\em \arabic*., labelsep = 0.5em,  leftmargin=1cm, nosep]
\item $X$ is a set of \emph{points};
\item $\mathcal{A}$ is a set of \emph{blocks}.
\end{enumerate}
\vskip4ex

\textbf{Definition 1.1} A \emph{design} is a pair $(X,\mathcal{A})$ iff:
\begin{enumerate}[label=\em \arabic*., labelsep = 0.5em,  leftmargin=1cm, noitemsep]
\item $X$ is a set of \emph{points};
\item $\mathcal{A}$ is a set of \emph{blocks}.
\end{enumerate}

\end{document}

enter image description here

Bernard
  • 271,350
1

A possible solution is use of \vspace{-xxpt} right before \item.

enter image description here

Code

\documentclass[xcolor=x11names,compress]{beamer}
\usepackage{graphicx}
\usepackage{tikz}
\usepackage{enumitem}

\begin{document}


Before:

\textbf{Definition 1.1} A {\it{design}} is a pair $(X,\mathcal{A})$ iff:
\begin{enumerate}[label={\it{\arabic*}}.,leftmargin=1cm,itemsep=0ex,parsep=-0.3ex]
\item \;\; $X$ is a set of {\it{points}};
\item \;\; $\mathcal{A}$ is a set of {\it{blocks}}.
\end{enumerate}

After:

\textbf{Definition 1.1} A {\it{design}} is a pair $(X,\mathcal{A})$ iff:
\begin{enumerate}[label={\it{\arabic*}}.,leftmargin=1cm,itemsep=0ex,parsep=-0.3ex]
\vspace{-5pt}
\item \;\; $X$ is a set of {\it{points}};
\item \;\; $\mathcal{A}$ is a set of {\it{blocks}}.
\end{enumerate}
\end{document}
Jesse
  • 29,686
0

\setlist{nolistsep} can reduce a little bit. Probably need to go through the package manual.