2

I am trying to find an easy solution for the following. I want my paragraphs inside my definitions, propositions and proofs to have no vertical line spacing between them but with a small indent. Outside these environment there must be no indent and a positive line spacing. This is a minimal example of the current code:

\documentclass{article}


\usepackage{amsthm}
\usepackage{parskip}

\theoremstyle{definition}
\newtheorem{Def}{Definition}[section]

\theoremstyle{remark}
\newtheorem{Exm}{Example}[section]

\theoremstyle{plain}
\newtheorem{Prop}{Proposition}[section]

\setlength{\parskip}{0.3cm plus 0.03cm minus 0.02cm}

\makeatletter
\def\thm@space@setup{%
  \thm@preskip=0.5cm plus 0.05cm minus 0.05cm
  \thm@postskip=0.2cm plus 0.02cm minus 0.01cm
}
\makeatother

\begingroup
    \makeatletter
    \@for\theoremstyle:=remark\do{%
        \expandafter\g@addto@macro\csname th@\theoremstyle\endcsname{%
            \addtolength\thm@preskip\parskip
            }%
        }
\endgroup

\begin{document}

\section{Example}

\begin{Def}
This is a definition.

With two paragraphs.
\end{Def}

Running text.

\begin{Exm}
And an example.

Again with two paragraphs.
\end{Exm}

More running text.

This time with two paragraphs.

\begin{Prop}
Finally a proposition.

With two paragraphs.
\end{Prop}

\begin{proof}
Notice that it is clear.

And therefore it is so.
\end{proof}


\end{document}

However I would like something that looks like the following result, but that is done automatic:

\documentclass{article}


\usepackage{amsthm}
\usepackage{parskip}

\theoremstyle{definition}
\newtheorem{Def}{Definition}[section]

\theoremstyle{remark}
\newtheorem{Exm}{Example}[section]

\theoremstyle{plain}
\newtheorem{Prop}{Proposition}[section]

\setlength{\parskip}{0.3cm plus 0.03cm minus 0.02cm}

\makeatletter
\def\thm@space@setup{%
  \thm@preskip=0.5cm plus 0.05cm minus 0.05cm
  \thm@postskip=0.2cm plus 0.02cm minus 0.01cm
}
\makeatother

\begingroup
    \makeatletter
    \@for\theoremstyle:=remark\do{%
        \expandafter\g@addto@macro\csname th@\theoremstyle\endcsname{%
            \addtolength\thm@preskip\parskip
            }%
        }
\endgroup

\newcommand{\tab}{\hspace*{2em}}

\begin{document}

\section{Example}

\begin{Def}
This is a definition.
\\
\tab With two paragraphs.
\end{Def}

Running text.

\begin{Exm}
And an example.
\\
\tab
Again with two paragraphs.
\end{Exm}

More running text.

This time with two paragraphs.

\begin{Prop}
Finally a proposition.
\\
\tab
With two paragraphs.
\end{Prop}

\begin{proof}
Notice that it is clear.
\\
\tab
And therefore it is so.
\end{proof}


\end{document}

I haven't found any solutions. Any help is appreciated.

1 Answer 1

1

I ended up using something like the following. The solution was easier than I expected and the result was nice enough.

\documentclass{article}


\usepackage{amsthm}
\usepackage{parskip}

\theoremstyle{definition}
\newtheorem{Def}{Definition}[section]

\theoremstyle{remark}
\newtheorem{Exm}{Example}[section]

\theoremstyle{plain}
\newtheorem{Prop}{Proposition}[section]

\setlength{\parskip}{0cm}
\setlength{\parindent}{0.5cm}
\setlength{\topsep}{0.35cm plus 0.2cm minus 0.2cm}

\makeatletter
\def\thm@space@setup{%
  \thm@preskip=0.45cm plus 0.3cm minus 0.16cm
  \thm@postskip=0.25cm plus 0.05cm minus 0.16cm
}
\makeatother

\begin{document}

...


\end{document}

You must log in to answer this question.

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