0

I like to use the parskip package, making paragraphs separated by vertical space instead of by indentation. However, since (seemingly the same amount of) vertical space is also used in amsthm to separate theorems from surrounding text, the combination makes it impossible to tell where examples, definitions and remarks ends and the main text resumes. (Proper theorems are, of course, distinguishable from the main text by being italicized.) Here's an MWE and how it looks:

\documentclass{article}
\usepackage{parskip}
\usepackage{amsthm}
\theoremstyle{definition}
\newtheorem{exmp}{Example}
\begin{document}

This is not part of the example.

\begin{exmp} This is part of the example. This is part of the example. This is part of the example.

This should be part of the example. This should be part of the example.

\end{exmp}

This should not be part of the example. \end{document}

enter image description here

What I'm looking for is some small tweak which is just noticeable enough so that the reader can see the structure of the document. I'd like to stay close to the amsthm standard; fancy boxes or long lines along the text would in my opinion be too big of a departure.

I'm considering three possible solutions. I'm not sure which one I prefer; Ideally I should be able to try them all out. Arguments in favor of one solution or some other are welcome.

1) Increase the spacing around theorem environments.

2) Let paragraphs in the theorem environments be separated by just an indent, and no vertical space. Thus an example would visually give the impression of "a chunk of text", but still be allowed to be stuctured into paragraphs.

3) Add an end symbol, like the box \qedsymbol which ends proofs. For this option, what symbol(s) if any would be the most standard way to end an example, definition or remark?

Progress so far

1) The amsthm package offers the \newtheoremstyle command to do this. This question helped to give the default values.

While it's logically only neccessary to add spacing at the bottom of some environments, probably both the top and bottom at all theorem-environments should have som extra padding for an intuitive and consistent-looking result.

So putting this in the preamble makes the MWE look better:

\usepackage{amsthm}
\newtheoremstyle{example}{4pt}{4pt}{\normalfont}{0pt}{\bfseries}{.}{5pt plus 1pt minus 1pt}{}
\theoremstyle{example}
\newtheorem{exmp}{Example}

enter image description here

However, perhaps some other spacing specification than 4pt might give better results in other situations. Changing the 4pt spaces to 0.3\baselineskip looks almost identical in the MWE, but adapts to the baseline skip (which I understand can differ slightly from page to page). In a similar vein, perhaps one should include a "rubber length" (parskip itself does this), e.g. \0.3\baselineskip plus 2 pt minus 1 pt?

2) With this option, an example/definition would visually give the impression of "a chunk of text", even though it can be stuctured into paragraphs. This appeals to me. However, including a displayed equation in the example text might break this visual unity.

I have no idea how to actually do it.

3) A custom end symbol can be accomplished with the package thmtools, (see this question). I'm not sure which symbols would be "most standard". In Swedish math books it seems common to end examples with a \qedbox. To me, the qedbox is too associated with the end of a proof to be allowed to end other things, but a different-looking box could work.

Using the default values and the "rubber length" from point 1) above and a small black box as end mark makes the MWE look like this:

\documentclass[10pt]{article}
\usepackage{parskip}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{thmtools}

\declaretheoremstyle[ headfont=\bfseries, bodyfont=\normalfont, spaceabove=0.4em plus 0.2em minus 0.1em, spacebelow=0.4em plus 0.2em minus 0.1em, postheadspace=5pt plus 1pt minus 1pt, qed={$\scriptstyle{\blacksquare}$}, ]{example}

\declaretheorem[ style=example, title=Example, ]{exmp}

\begin{document} This is not part of the example.

\begin{exmp}
    This is part of the example. This is part of the example. This is part of the example.

    This should be part of the example. This should be part of the example.
\end{exmp}

This should not be part of the example.

\end{document}

enter image description here

Lorents
  • 170
  • 2
    Congratulations! You've found another reason for not using paragraph spacing. – egreg Jun 26 '23 at 22:15
  • \baselineskip is a skip (rubber) not dimen (fixed) length but is almost never set to a non-fixed value (as changing line spacing except special display constructs looks weird). You could use italic or a frame in addition to your 3 possibilities – David Carlisle Jun 26 '23 at 22:23
  • (From memory and not tested.) Within the text component of \newtheorem, add \parskip=0pt \parindent=\normalparindent. If my recollection is accurate, this should restore the "theorem" to a block. You may have to insert \par before \end{<theorem>}. – barbara beeton Jun 26 '23 at 22:51
  • @DavidCarlisle I think frames and italics are too big departures from the ams style. Could you clarify what you mean by the first part of your comment on "setting \baselineskip to a non-fixed value"? Is it advice against using \0.3\baselineskip plus 2 pt minus 1 pt? – Lorents Jun 27 '23 at 08:33
  • @barbarabeeton Thanks for the suggestion. But I don't understand where to add the par commands you mentioned; what is "the text component of \newtheorem"? – Lorents Jun 27 '23 at 08:35
  • @egreg Most things I read these days, except for published mathematics, seem to have block paragraphs. Of course, indentation saves a little space, but isn't the general philosophy of LaTeX to put readability before density? What are your reasons against paragraph spacing? – Lorents Jun 27 '23 at 08:43
  • @Lorents It's good for memos or commercial letters. Not for longer texts. In this respect I fully agree with Tschichold. – egreg Jun 27 '23 at 08:56
  • yes baselineskip is almost never set with plus or minus components for normal paragraph text – David Carlisle Jun 27 '23 at 09:20
  • @Lorents -- The location I suggested is in the third argument, where you put \normalfont in your example. It's not documented, but I think it should work. – barbara beeton Jun 27 '23 at 17:49
  • @barbarabeeton Thanks. The only thing that did not work was \parindent=\normalparindent, but setting an explicit lenght like \parindent=15pt works. – Lorents Jun 28 '23 at 11:06

0 Answers0