0

I would like to use parskip to avoid indent and also to have some space between paragraphs. However, I would like this feature only in the text inbetween proofs (like introduction etc). Inside the proofs I want to have zero parskip.

I am using ntheorem.sty and with the following settings for the proofs:

    \theoremstyle{nonumberplain}
    \theoremheaderfont{\itshape}
    \theorembodyfont{\normalfont}
    \theoremseparator{.} % e.g. Proof.
    \theorempreskip{\topsep}
    \theorempostskip{\topsep} %\topsep refers to the space that LATEX inserts above and below lists
    \theoremindent0cm
    \theoremsymbol{\ensuremath\square} % at the end of the Theorem
    \qedsymbol{$\Box$}

    \newtheorem{proof}{Proof}

Thank you very much in advance!

  • Welcome to TeX SX! I suppose in this case you want a non-zero \parindent inside proofs? – Bernard Dec 20 '16 at 21:26
  • 1
    Please post a complete minimal example. This doesn't even tell us how you are changing \parskip. Are you using the parskip package, which is recommended? (Insofar as this is recommended at all. Perhaps less strongly dis-recommended would be better.) – cfr Dec 21 '16 at 1:18
2

Possibly something like this:

\documentclass{article}
\newlength\normalparindent
\setlength\normalparindent{\parindent}
\usepackage{parskip,kantlipsum,ntheorem,etoolbox}
\newlength\normalparskip
\setlength\normalparskip{\parskip}
\theoremstyle{nonumberplain}
\theoremheaderfont{\itshape}
\theorembodyfont{\normalfont}
\theoremseparator{.}
\theorempreskip{\normalparskip}
\theorempostskip{\topsep}
\theoremindent0cm
\theoremsymbol{\ensuremath\square}
\qedsymbol{$\Box$}

\newtheorem{proof}{Proof}
\pretocmd{\proof}{\setlength\parindent{\normalparindent}\setlength\parskip{0pt}}{\typeout{Patched proof OK.}}{\typeout{Patching proof failed.}}

\begin{document}
\kant[1-2]

\begin{proof}
  \kant[3-4]
\end{proof}

\kant[5-6]
\end{document}

Kant around proof

EDIT

In response to your deleted answer, which was really a comment, note first that my initial answer above was, basically a waste of time. This is my fault: I shouldn't have answered a question without code. In essence, your follow-up is an entirely different question as it is about KOMA Script.

This is why (very nearly almost absolutely) all questions should include code for a minimal document which can be used to reproduce the problem.

In any case, I do not really think this is entirely wise with a KOMA class. In particular, to get good results, you need to set parskip to full. Otherwise, pages will not be flush at the bottom. (I'm not sure if full is sufficient to ensure this, but it hopefully is and should certainly help.) To my eye, this looks silly as the skip is too large. But the other option, half, will result in ragged page bottoms, which looks even worse. Especially, it looks worse with a KOMA class, I think, as KOMA tries so hard to avoid this kind of thing.

Anyway, in this case, you can, if you must, use something like the following.

\documentclass[parskip=full]{scrartcl}
\usepackage{kantlipsum,ntheorem,etoolbox}
\theoremstyle{nonumberplain}
\theoremheaderfont{\itshape}
\theorembodyfont{\normalfont}
\theoremseparator{.}
\theoremsymbol{\ensuremath\square}
\qedsymbol{$\Box$}

\newtheorem{proof}{Proof}
\pretocmd{\proof}{\KOMAoptions{parskip=false}}{\typeout{Patched proof OK.}}{\typeout{Patching proof failed.}}

\begin{document}

\kant[1-2]

\begin{proof}
  \kant[3-4]
\end{proof}

\kant[5-10]

\end{document}

KOMA case

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.