1

I have a real issue with defining my theorem style. I need indentation after the theorem, but cannot achive it. I google for hours and didn't find a solution. Hope you can help me. By the way, I'm using Lyx 2.1 on Windows.

If you also know how to remove the whitespace between the number and the colon I would appreciate it very much.

I want an indentation like this:

enter image description here

But I get this:

enter image description here

I define this:

 \newtheoremstyle{hypstyle}% name
 {\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
 {.5em}%     Space after thm head: " " = normal interword space;
 {\thmname{#1}\thmnumber{#2}\thmnote{ #3}  } % Thm head spec (can be left empty, meaning `normal')
 \theoremstyle{hypstyle} % use plain, definition, remark
 \newtheorem{hyp}{Hypothese}
 \renewenvironment{thm}{\begin{hyp}}{\end{hyp}}

And use it like this:

\begin{thm}
Bei Anwendungen mit einer hohen Allokationsrate (800 MB/s) besteht keine lineare Beziehung zwischen dem \texttt{NewRatio}-Wert und der STW-Summe, für Anwendungen mit einer geringen Allokationsrate dagegen schon. 
\textbf{Vorbedingung:} Text
\textbf{Änderung:} Text
\textbf{Nachbedingung:} Text
\end{thm}

1 Answer 1

4

Make sure you put the headings as separate paragraphs, i.e., with a blank line between them in the source:

Sample output

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[german]{babel}
\usepackage{amsthm}

\newtheoremstyle{hypstyle}% name
 {\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
 {.5em}%     Space after thm head: " " = normal interword space;
 {\thmname{#1}\thmnumber{#2}\thmnote{ #3}  } % Thm head spec (can be left empty, meaning `normal')

\newtheorem{thm}{Satz}
\theoremstyle{hypstyle} % use plain, definition, remark
\newtheorem{hyp}{Hypothese}
\renewenvironment{thm}{\begin{hyp}}{\end{hyp}}

\begin{document}

\begin{thm}
  Bei Anwendungen mit einer hohen Allokationsrate (800 MB/s) besteht
  keine lineare Beziehung zwischen dem \texttt{NewRatio}-Wert und der
  STW-Summe, für Anwendungen mit einer geringen Allokationsrate
  dagegen schon.

  \textbf{Vorbedingung:} Text

  \textbf{Änderung:} Text

  \textbf{Nachbedingung:} Text
\end{thm}

\end{document}

You must log in to answer this question.

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