Anda di halaman 1dari 3

spacing - How to suppress vertical space between theorem heads and ...

http://tex.stackexchange.com/questions/46357/how-to-suppress-vertica...

sign up

log in

tour

help

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.

How to suppress vertical space between theorem heads and enumitem environments?
How can I suppress vertical space between a theorem head and an enumitem environment? I would like the output to look like version 3 below, but I hope there is an automatical solution without ~ and \vspace .
\documentclass{article} \usepackage{amsthm} \usepackage{enumitem} \newtheoremstyle{mythmstyle}% {0.5em}% space above {0.5em}% space below {}% body font {}% indent amount {\sffamily\bfseries}% head font {}% punctuation after head {\newline}% space after head {\thmname{#1}\ \thmnumber{#2}\ \thmnote{(#3)}}% head spec \theoremstyle{mythmstyle} \newtheorem{Theorem}{Theorem} \begin{document} %% version 1: vertical spacing correct \begin{Theorem} Dummy text \begin{enumerate}[label=(\arabic*),leftmargin=*,align=left] \item Item 1: More dummy text \item Item 2: More dummy text \end{enumerate} \end{Theorem} %% version 2: vertical spacing too large \begin{Theorem} ~ \begin{enumerate}[label=(\arabic*),leftmargin=*,align=left] \item Item 1: More dummy text \item Item 2: More dummy text \end{enumerate} \end{Theorem} %% version 3: desirable output, but ugly solution via \vspace \begin{Theorem} ~\vspace{1.4em} \begin{enumerate}[label=(\arabic*),leftmargin=*,align=left] \item Item 1: More dummy text \item Item 2: More dummy text \end{enumerate} \end{Theorem} %% version 4: does it work with enumitem alone? (no, topsep seems to be ignored) \begin{Theorem} ~ \begin{enumerate}[label=(\arabic*),leftmargin=*,align=left, topsep=1.4em] \item Item 1: More dummy text \item Item 2: More dummy text \end{enumerate} \end{Theorem} \end{document}

{ spacing} { lists} { theorems} { enumitem} edited Jun 10 at 2:51 asked Mar 1 '12 at 13:17 Przemysaw Scherwentke Marius Hofert
11.4k 2 8 39 1,123 3 16

2 Answers

1 of 3

12/25/2013 12:56 PM

spacing - How to suppress vertical space between theorem heads and ...

http://tex.stackexchange.com/questions/46357/how-to-suppress-vertica...

Don't use ~ just use nothing (or a blank line) in the markup. You then have the problem that latex lists use a run-in style for the first item if following a run-in heading. This is by design (it goes to some trouble to make that work) If you don't like that style the thing to do is change that rather than put markup in the document. I don't know my way round that code as well as I used to, but this seems to work, it may need a bit more care to ensure that page breaks etc are suppressed in all the right places but...

\documentclass{article} \usepackage{amsthm} \usepackage{enumitem} \newtheoremstyle{mythmstyle}% {0.5em}% space above {0.5em}% space below {}% body font {}% indent amount {\sffamily\bfseries}% head font {}% punctuation after head {\newline}% space after head {\thmname{#1}\ \thmnumber{#2}\ \thmnote{(#3)}}% head spec \theoremstyle{mythmstyle} \newtheorem{Theorem}{Theorem}

\makeatletter \def\enumfix{% \if@inlabel \noindent \par\nobreak\vskip\parskip\vskip\baselineskip\hrule\@height\z@ \fi} \let\oldenumerate\enumerate \def\enumerate{\enumfix\oldenumerate}

\begin{document} %% version 1: vertical spacing correct \begin{Theorem} Dummy text \begin{enumerate}[label=(\arabic*),leftmargin=*,align=left] \item Item 1: More dummy text \item Item 2: More dummy text \end{enumerate} \end{Theorem}

%% version 2a: vertical spacing too large \begin{Theorem} \begin{enumerate}[label=(\arabic*),leftmargin=*,align=left] \item Item 1: More dummy text \item Item 2: More dummy text \end{enumerate} \end{Theorem} \end{document}

edited Jul 17 at 14:02 pluton


5,205 1 18 61

answered Mar 1 '12 at 16:24 David Carlisle


154k 11 418 727

2 of 3

12/25/2013 12:56 PM

spacing - How to suppress vertical space between theorem heads and ...

http://tex.stackexchange.com/questions/46357/how-to-suppress-vertica...

Thanks a lot, David, very nice!

Marius Hofert Mar 1 '12 at 17:17 Marius Hofert Jun 15 '12 at

This is a follow-up question: tex.stackexchange.com/questions/60001/ 17:36

How about just using \begin{theorem}\mbox{}\begin{itemize}\item 1 \item 2\end{itemize} \end{theorem} ? pluton Jul 17 at 14:02 @pluton as I say above " If you don't like that style the thing to do is change that rather than put markup in the document." David Carlisle Jul 17 at 19:45

your approach may be ugly, and it really should use a vertical unit like ex instead of em , but if it gives you the result you want, why not just embed it into a \newenvironment ? for example,
\newenvironment{thmenumerate}{% \leavevmode\vspace{1.4em} \begin{enumerate}[label=(\arabic*),leftmargin=*,align=left] }{% \end{enumerate} }

and use it like this:


\begin{Theorem} \begin{thmenumerate} \item Item 1: More dummy text \item Item 2: More dummy text \end{thmenumerate} \end{Theorem}

edited Jul 17 at 14:00 pluton


5,205 1 18 61

answered Mar 1 '12 at 14:39 barbara beeton


28k 3 44 112

Thanks for helping, Barbara. I was hoping for a more flexible solution since I do not always have the same vertical space (of fixed size such as -1.4em as above) and also not the same enumerate environment (especially the label but also other parameters of the numerate environment often change). Marius Hofert Mar 1 '12 at 14:54

3 of 3

12/25/2013 12:56 PM

Anda mungkin juga menyukai