Bringen Sie Wörter aus dem Theorem herunter

Bringen Sie Wörter aus dem Theorem herunter

Ich habe einen Satz, der wie folgt geht:

\documentclass[12pt]{book} 

\begin{document}

\newtheorem{definition}{Definition}[section]

\begin{definition}[Integers]
Integers are positive and negative whole numbers, including 0.\\
e.g. $..., -3, -2, -1, 0, 1, 2, 3, 4, ...$
\end{definition}

\end{document}

Definition

Wie bringe ich die Aussage „Ganze Zahlen sind positiv und negativ…“ auf eine Zeile?

Ich habe es mit \\ versucht, aber dadurch entsteht die Fehlermeldung „Keine Zeile zum Ende“ und die Meldung „Ganzzahlen sind positiv und negativ …“ wird auch nicht behoben.

Danke schön!

Antwort1

Sie können amsthmIhre eigenen Theoremstile verwenden und definieren.

\documentclass[12pt]{book}
\usepackage{amsthm,amsmath}

\newtheoremstyle{breakthm}
  {\topsep}%   Space above
  {\topsep}%   Space below
  {\itshape}%  Body font
  {}%          Indent amount (empty = no indent, \parindent = para indent)
  {\bfseries}% Thm head font
  {.}%         Punctuation after thm head
  {\newline}%  Space after thm head: " " = normal interword space;
  {}%          Thm head spec (can be left empty, meaning `normal')
\newtheoremstyle{breakdef}
  {\topsep}%   Space above
  {\topsep}%   Space below
  {\upshape}%  Body font
  {}%          Indent amount (empty = no indent, \parindent = para indent)
  {\bfseries}% Thm head font
  {.}%         Punctuation after thm head
  {\newline}%  Space after thm head: " " = normal interword space;
  {}%          Thm head spec (can be left empty, meaning `normal')

\theoremstyle{breakthm}
\newtheorem{theorem}{Theorem}[section]

\theoremstyle{breakdef}
\newtheorem{definition}[theorem]{Definition}

\begin{document}

\begin{definition}[Integers]
Integers are positive and negative whole numbers, including $0$,
e.g.
\[
\dots, -3, -2, -1, 0, 1, 2, 3, 4,\dotsc
\]
\end{definition}

\begin{theorem}
The integers are useful.
\end{theorem}

\end{document}

Bildbeschreibung hier eingeben

Meiner Meinung nach ist das allerdings reine Platzverschwendung.

Beachten Sie, dass amsthmdies viel bessere Anpassungsmöglichkeiten bietet. Mit theorem(oder besser noch ntheorem) müssen Sie einen neuen Theoremstil definieren, wenn Sie die Textschriftart in Definitionen aufrecht haben möchten, wie es üblich ist.

Eine andere Möglichkeit ist die Verwendung von thmtools, was die Definition neuer Theoremstile recht einfach macht. Dasselbe wie zuvor kann mit

\documentclass[12pt]{book}
\usepackage{amsmath,amsthm,thmtools}

\declaretheoremstyle[
  postheadspace=\newline,
  bodyfont=\itshape,
]{breakthm}% main style

\declaretheoremstyle[
  style=breakthm,
  bodyfont=\normalfont,
]{breakdef}% override the bodyfont

\declaretheorem[
  name=Theorem,
  style=breakthm,
  numberwithin=section,
]{theorem}

\declaretheorem[
  name=Definition,
  style=breakdef,
  numberlike=theorem,
]{definition}

\begin{document}

\begin{definition}[Integers]
Integers are positive and negative whole numbers, including $0$,
e.g.
\[
\dots, -3, -2, -1, 0, 1, 2, 3, 4,\dotsc
\]
\end{definition}

\begin{theorem}
The integers are useful.
\end{theorem}

\end{document}

Antwort2

Es gibt viele Pakete zum Anpassen von Theoremen, unter anderem theoremin der Latex-Kerndistribution:

\documentclass[12pt]{book}
\usepackage{theorem}
\theoremstyle{break}
\newtheorem{definition}{Definition}[section]
 \begin{document} 
 \begin{definition}[Integers]
 Integers are positive and negative whole numbers, including 0.\\
e.g. $..., -3, -2, -1, 0, 1, 2, 3, 4, ...$ 
\end{definition}
 \end{document} 

verwandte Informationen