5

EDIT Playing around with the nice amsthm solution by egreg below I realized that I really would prefer an equivalent ntheorem construction. Can anyone help out here?


There are Math books which use a "loose" section/paragraph numbering style like this:

Chapter 1 Foundations

(1.1) Definition

[...]

(1.2) Remark

[...]

(1.3)

[Some more content without an explicit title, possibly spanning several paragraphs.]

(1.4) Theorem

[...]

Proof [...]

(1.5)

[Some other background story without explicit title, possibly spanning several paragraphs.]

(1.6) Some free title like "Further insight"

[...]

I hope you get the idea. What is the recommended way to achieve such a numbering style in Latex? Is it possible within the amsthm or ntheorem Package?

Addition

The style I observed in some books is that the numbering is always given in parentheses (maybe to distinguish them from normal chapter/sectioning numbering). Number and (if given) title are in bold font, but same font size as normal text.

2
  • Is there an associated ToC? If so, what do you put for the empty numbered paragraphs? Also, did you mean to place brackets around the numbering?
    – Werner
    Commented Oct 28, 2019 at 15:10
  • @Werner No ToC is needed, but \ref{...} should work. I've added some info on parentheses and font to my question.
    – azimut
    Commented Oct 28, 2019 at 15:39

2 Answers 2

5

Not so difficult with amsthm: it just takes to define some suitable theorem styles. See https://tex.stackexchange.com/a/17555/4427 and https://tex.stackexchange.com/a/353540/4427

\documentclass{book}
\usepackage{amsthm}

\makeatletter
\newtheoremstyle{azimutplain}
  {\topsep}   % ABOVESPACE
  {\topsep}   % BELOWSPACE
  {\itshape}  % BODYFONT
  {0pt}       % INDENT (empty value is the same as 0pt)
  {\bfseries} % HEADFONT
  {}          % HEADPUNCT
  {5pt plus 1pt minus 1pt} % HEADSPACE
  {(\thmnumber{#2}) \thmname{#1}\@ifnotempty{#3}{ (\thmnote{#3})}.} % CUSTOM-HEAD-SPEC
\newtheoremstyle{azimutdefinition}
  {\topsep}   % ABOVESPACE
  {\topsep}   % BELOWSPACE
  {\normalfont}  % BODYFONT
  {0pt}       % INDENT (empty value is the same as 0pt)
  {\bfseries} % HEADFONT
  {}          % HEADPUNCT
  {5pt plus 1pt minus 1pt} % HEADSPACE
  {(\thmnumber{#2}) \thmname{#1}\@ifnotempty{#3}{ (\thmnote{#3})}.} % CUSTOM-HEAD-SPEC
\newtheoremstyle{azimutloose}
  {\topsep}   % ABOVESPACE
  {\topsep}   % BELOWSPACE
  {\normalfont}  % BODYFONT
  {0pt}       % INDENT (empty value is the same as 0pt)
  {\bfseries} % HEADFONT
  {}          % HEADPUNCT
  {5pt plus 1pt minus 1pt} % HEADSPACE
  {(\thmnumber{#2})\@ifnotempty{#3}{ \thmnote{#3}.}} % CUSTOM-HEAD-SPEC
\makeatother

\theoremstyle{azimutplain}
\newtheorem{theorem}{Theorem}[chapter]

\theoremstyle{azimutdefinition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{remark}[theorem]{Remark}

\theoremstyle{azimutloose}
\newtheorem{looseinner}[theorem]{}
\makeatletter
\newenvironment{loose}[1][]
 {\@ifempty{#1}{\looseinner}{\looseinner[#1]}}
 {\endlooseinner}
\makeatother

\begin{document}

\chapter{Foundations}

\begin{definition}
Some text
\end{definition}

\begin{remark}
Some text
\end{remark}

\begin{loose}
Some more content without an explicit title, possibly spanning several paragraphs.

Some more content without an explicit title, possibly spanning several paragraphs.
\end{loose}

\begin{theorem}
Some text
\end{theorem}
\begin{proof}
Some text
\begin{loose}
Some other background story without explicit title, possibly spanning several paragraphs.

Some other background story without explicit title, possibly spanning several paragraphs.\qedhere
\end{loose}
\end{proof}

\begin{loose}[Further insight]
Some text
\end{loose}

\end{document}

enter image description here

2
  • Thank you. This looks nice indeed. As I'm currently an ntheorem-user, is there a solution for ntheorem, too?
    – azimut
    Commented Oct 28, 2019 at 21:51
  • @azimut Sorry, I never consider ntheorem.
    – egreg
    Commented Oct 28, 2019 at 21:52
3
+100

egreg's solution can easily be modified to use ntheorem instead of amsthm:

\documentclass{book}

\usepackage{ntheorem}

\makeatletter
  \newtheoremstyle{azimut}%
    {\item[\rlap{\vbox{\hbox{\hskip\labelsep \theorem@headerfont
            (##2)\ ##1\theorem@separator}\hbox{\strut}}}]}%
    {\item[\rlap{\vbox{\hbox{\hskip\labelsep \theorem@headerfont
            (##2)\ ##1:\ ##3\theorem@separator}\hbox{\strut}}}]}
  \newtheoremstyle{azimutnoname}%
    {\item[\rlap{\vbox{\hbox{\hskip\labelsep \theorem@headerfont
            (##2)\theorem@separator}\hbox{\strut}}}]}%
    {\item[\rlap{\vbox{\hbox{\hskip\labelsep \theorem@headerfont
            (##2)\ ##3\theorem@separator}\hbox{\strut}}}]}
  \newtheoremstyle{azimutnonumber}%
    {\item[\rlap{\vbox{\hbox{\hskip\labelsep \theorem@headerfont
            ##1\theorem@separator}\hbox{\strut}}}]}%
    {\item[\rlap{\vbox{\hbox{\hskip\labelsep \theorem@headerfont
            ##1:\ ##3\theorem@separator}\hbox{\strut}}}]}
\makeatother

\theoremstyle{azimut}
\newtheorem{theorem}{Theorem}[chapter]
\newtheorem{definition}[theorem]{Definition}
\newtheorem{remark}[theorem]{Remark}

\theoremstyle{azimutnoname}
\newtheorem{looseinner}[theorem]{}
\makeatletter
  \newenvironment{loose}[1][]
    {\ifx\relax#1\relax\looseinner\else\looseinner[#1]\fi}
    {\endlooseinner}
\makeatother

\theoremstyle{azimutnonumber}
\newtheorem{proof}{Proof}


\begin{document}

\chapter{Foundations}

\begin{definition}
Some text
\end{definition}

\begin{remark}
Some text
\end{remark}

\begin{loose}
Some more content without an explicit title, possibly spanning several paragraphs.

Some more content without an explicit title, possibly spanning several paragraphs.
\end{loose}

\begin{theorem}
Some text
\end{theorem}
\begin{proof}
Some text
\begin{loose}
Some other background story without explicit title, possibly spanning several paragraphs.

Some other background story without explicit title, possibly spanning several paragraphs.
\end{loose}
\end{proof}

\begin{loose}[Further insight]
Some text
\end{loose}

\end{document}

MWE output


The style definitions above are just an adapted version of ntheorem's default style break. If you want to omit the line break after headings, use adapted versions of the plain style instead.

\makeatletter
  \newtheoremstyle{azimut}%
    {\item[\hskip\labelsep \theorem@headerfont (##2)\ ##1\theorem@separator]}%
    {\item[\hskip\labelsep \theorem@headerfont (##2)\ ##1:\ ##3\theorem@separator]}
  \newtheoremstyle{azimutnoname}%
    {\item[\hskip\labelsep \theorem@headerfont (##2)\theorem@separator]}%
    {\item[\hskip\labelsep \theorem@headerfont (##2)\ ##3\theorem@separator]}
  \newtheoremstyle{azimutnonumber}%
    {\item[\hskip\labelsep \theorem@headerfont ##1\theorem@separator]}%
    {\item[\hskip\labelsep \theorem@headerfont ##1:\ ##3\theorem@separator]}
\makeatother
3
  • Many thanks! One more question: Is there a way to get rid of the newline at (1.3) and (1.5), such that the text starts right of the numbering, as in the answer of egreg?
    – azimut
    Commented Apr 19, 2020 at 11:46
  • @azimut I added the required definitions to my answer.
    – schtandard
    Commented Apr 19, 2020 at 18:04
  • Thank you! I gave the bounty to you now. I decided to accept the other answer, as it was the first working answer to the original question.
    – azimut
    Commented Apr 21, 2020 at 13:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .