1

Is it possible when defining either the style or declaring the "theorem" to change the vertical spacing after the head (not after the entire "theorem")?

I want to do this with appropriate setting(s) in the preamble, and not each time I invoke the environment. (Obviously I could do it manually each time I invoke the environment.)

In the docs for thmtools, I did not find a key to do that either for \declaretheoremstyle or \declaretheorem.

Example:

\documentclass{article}

\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{kantlipsum}

\declaretheoremstyle[
headfont=\bfseries, headpunct={}, numbered=no,
spaceabove=3\topsep, postheadspace=2em
]{exercs}

\declaretheorem[name=EXERCISES,style=exercs]{problems}

\begin{document}

\kant[1]

\begin{problems}

Solve these problems.

\begin{enumerate}
\item Do this one first.
\item Solve this next.
\end{enumerate}

\end{problems}

\end{document}

I do strongly prefer using the thmtools package method of styling and declaring theorem-like environments, because it seems to give greater control over them than amsthm alone.

Nonetheless, even the "raw" `amsthm" approach as shown, e.g., at Theoremstyle; leaving vertical space between the theorem header and the body of the theorem , merely moves the beginning of the "theorem" body so as to start on a new line; it doesn't seem to allow me to add extra vertical space:

\documentclass{article}

\usepackage{amsthm}
\usepackage{kantlipsum}

\newtheoremstyle{exercises}% name
{\topsep}%Space above
{\topsep}%Space below
{\itshape}%Body font
{0pt}%Indent amount
{\bfseries}% Theorem head font
{}%Punctuation after theorem head
{\newline}%Space after theorem head
{}% theorem head specification

\theoremstyle{exercises}
\newtheorem{problems}{EXERCISES}

\begin{document}

\kant[1]

\begin{problems}

Solve these.

\begin{enumerate}
\item Do this one first.
\item Solve this next.
\end{enumerate}

\end{problems}

\end{document}
  • This may require some kind of sorcery which should be answered soon although here is a hack but use it with discretion as I know its not even close to an answer: \makeatletter \renewcommand{\newline}{\@normalcr\@normalcr\relax} \makeatother Add it in your preamble. Note this may have serious consequences in the end. – azetina Aug 8 '16 at 5:04
2

Here you are: it was enough to consider the line break as a punctuation:

\documentclass{article}

\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{kantlipsum}

\declaretheoremstyle[
headfont=\bfseries,%
headpunct={\vspace{\topsep}\newline}, %
numbered=no,
spaceabove=3\topsep, %
postheadspace=0 pt ]{exercs}

\declaretheorem[name=EXERCISES,style=exercs]{problems}

\begin{document}

\kant[1]

\begin{problems}

Solve these problems.

\begin{enumerate}
\item Do this one first.
\item Solve this next.
\end{enumerate}

\end{problems}

\end{document} 

enter image description here

  • This method oK if the body of the problems environment has text preceding the enumerate list. But if not — if the body consists only of the list, then the vertical space specified in headpunct is ignored, and the first line of the list is on the same line as the theorem head. Yes, I know a workaround is to insert, say, \ (or \mbox{} immediately after \begin{problems}, but then there is far too much space between the head and the first item of the list — the \topskip vertical space plus the spacing before the enumerate. – murray Aug 8 '16 at 14:37
  • There is no general solution which can take into account what may happen if the theorem body is not ordinary text. In the case of a list, you can 1) load the enumitem package; 2) add this optional argument to the list environment: [before=\leavevmode \vspace{-\dimexpr\baselineskip+\topsep\relax}]. – Bernard Aug 8 '16 at 14:54
  • In my real work, I am using the enuitem package. But I think the - before \dimenexpr should not be there: otherwise, the list actually moves upward so that its first item is on the same line as the begin{problems} head! – murray Aug 8 '16 at 19:01
  • Could you post a concrete example? – Bernard Aug 8 '16 at 19:20
  • I cannot reproduce the collision of head with list's first line now. Your method with enumitem seems perfectly OK. Thanks! – murray Aug 9 '16 at 0:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.