0

I would like to know if there's some code I can enter in order to find what is the vertical space (in cm or pt) that LaTeX is leaving before and after a theorem.

I'm using

\documentclass[12pt]{article}

and

\usepackage{amsfonts, amsthm, amsmath, amssymb}
User X
  • 513
  • 1
    Do you use a theorem package such as amsthm and/or ntheorem? – Mico May 09 '14 at 13:59
  • Sorry, I forgot to include that information. I'll edit the question. – User X May 09 '14 at 14:00
  • 1
    By default, amsthm uses \topsep, that is, the same spacing used around list environments. – egreg May 09 '14 at 14:02
  • And how can I use \topsep? Basically, I want to be able to manually add a vertical space that is the same as the vertical space before and after a theorem. – User X May 09 '14 at 14:06
  • 3
    \vspace{\topsep}? – egreg May 09 '14 at 14:07
  • Please explain the use case for employing \vspace{\topskip}: Are you constructing some theorem-like environments and want the vertical spacing above and below them be the same as for theorem environments? – Mico May 09 '14 at 14:15
  • Actually, it's \vspace{\topsep}. Suppose we state a theorem for the first time. Of course, we use \begin{theorem} and \end{theorem}. If we want to restate this theorem later on and we don't want LaTeX to assign a new number to this theorem (because we are basically talking about the same theorem), we can't use \begin{theorem} and \end{theorem} again. But what we can do is try to imitate the theorem environment. This includes imitating the vertical space LaTeX leaves before and after the theorem. Maybe other options are possible, but \vspace{\topsep} just worked perfect for me. – User X May 09 '14 at 19:11
  • Also, when I restate the theorem, I want it to have the same theorem number it had when it was first stated, so what I do is write \noindent{\bf Theorem \ref{theorem_label_goes_here}.} and the rest of the text. – User X May 09 '14 at 19:33
  • Besides, if LaTeX doesn't leave a blank line between paragraphs, then we need to manually add the vertical space before and after \noindent{\bf Theorem \ref{theorem_label_goes_here}.} Some text goes here.... – User X May 09 '14 at 19:45
  • There's a much easier way of restating theorems using thmtools. – Gonzalo Medina May 09 '14 at 20:51

2 Answers2

1

Preposterous example via repeating materaial from Non italic text in theorems, definitions, examples

\documentclass{article}
\usepackage{mathtools,amsthm,kantlipsum}

\newtheoremstyle{crampedthm}% <name>
{\topsep}% <Space above>
{-3pt}% <Space below>
{\itshape}% <Body font>
{3cm}% <Indent amount>
{\bfseries\itshape}% <Theorem head font>
{:}% <Punctuation after theorem head>
{.5em}% <Space after theorem headi>
{}% <Theorem head spec (can be left empty, meaning `normal')>


\theoremstyle{crampedthm}
\newtheorem{cthm}{Tight Theorem}

\begin{document}
\kant[1]
\begin{cthm}
Roses are red $\iff$ sky is blue such that it is self-evident that this 
theorem is true.
\end{cthm}
\kant[1-2]
\end{document}

enter image description here

percusse
  • 157,807
0

Here's a list of common length macros from Wikibooks. But as I see from the comments, you already know that \topsep is the length macro you need. If you want to know the length of a length macro, all you have to do is place

\the\textwidth

In your document, which will output the length in pt. Personally, I prefer having metric distances, so I usually just place the pt length into Wolfram-alpha to get an exact conversion.

altabq
  • 360