<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\ProvidesPackage{paravesp}[2016/02/05 space above and below paragraphs]

\newcount\pd@lastpenalty

\newcommand\pd@remember@penalty{\pd@lastpenalty=\lastpenalty\relax}

\newcommand\pd@restore@penalty{\ifnum 0=\pd@lastpenalty \else
  \penalty\pd@lastpenalty\relax \fi}

\newcommand\ParaSpaceAbove[1]{\relax % Mask \ifdim from possible expansion
\ifvmode
  \skip0=#1\relax
  \ifdim\parskip&lt;0pt\relax
    \skip0=0pt\relax
  \fi
  \ifdim\skip0=0pt\relax
    \IssueParaSpace
  \else
    \ifdim\prevdepth&gt;-1000pt\relax
      \advance\parskip by \prevdepth\relax % assumed: was set by SpaceBelow
      \pd@remember@penalty
      \vskip-\prevdepth\relax
      \pd@restore@penalty
      \prevdepth=-1000pt\relax
    \fi
    \ifdim\skip0&gt;\parskip\relax
      \parskip=#1\relax
    \fi
  \fi
\fi
}

\newcommand\ParaSpaceBelow[1]{\relax
\parskip=#1\relax
\advance\parskip by -\prevdepth\relax
\ifdim\parskip&lt;0pt\relax
  \ifdim#1&lt;0pt\relax \parskip=#1\relax \else \parskip=0pt\relax \fi
  \nointerlineskip
\else% &gt;=10000pt
  \ifdim\parskip&gt;999pt\relax \parskip=#1\relax\fi
\fi}

\newcommand\IssueParaSpace{\relax
\ifhmode \typeout{! LaTeX warning: IssueParaSpace in horizontal mode.}\par \fi
\ifdim\parskip&gt;0pt\relax
  \pd@remember@penalty
  \vskip\parskip\relax
  \pd@restore@penalty
  \prevdepth=-1000pt\relax
  \parskip=0pt\relax
\fi
}

\newcommand\IgnoreSpaceAboveNextPara{%
\ParaSpaceBelow{-0.01pt}}

\newcommand\CancelIgnoreSpaceAboveNextPara{%
\relax\ifdim\parskip&lt;0pt\relax \parskip=0pt\relax \fi}
</pre></body></html>