summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/parades
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-03-15 18:11:08 +0000
committerKarl Berry <karl@freefriends.org>2016-03-15 18:11:08 +0000
commit2bca8b813afec1acf56a3d243c50f9ffbe5ea665 (patch)
treedd961b508f5fe28dacc66d236e74f1e6d60c3e53 /Master/texmf-dist/tex/latex/parades
parent9b92252d80eba01cd25cc9610ad64908af57ba08 (diff)
parades (missed earlier)
git-svn-id: svn://tug.org/texlive/trunk@40029 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/parades')
-rw-r--r--Master/texmf-dist/tex/latex/parades/paravesp.sty58
1 files changed, 58 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/parades/paravesp.sty b/Master/texmf-dist/tex/latex/parades/paravesp.sty
new file mode 100644
index 00000000000..5f983dd3166
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/parades/paravesp.sty
@@ -0,0 +1,58 @@
+\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<0pt\relax
+ \skip0=0pt\relax
+ \fi
+ \ifdim\skip0=0pt\relax
+ \IssueParaSpace
+ \else
+ \ifdim\prevdepth>-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>\parskip\relax
+ \parskip=#1\relax
+ \fi
+ \fi
+\fi
+}
+
+\newcommand\ParaSpaceBelow[1]{\relax
+\parskip=#1\relax
+\advance\parskip by -\prevdepth\relax
+\ifdim\parskip<0pt\relax
+ \ifdim#1<0pt\relax \parskip=#1\relax \else \parskip=0pt\relax \fi
+ \nointerlineskip
+\else% >=10000pt
+ \ifdim\parskip>999pt\relax \parskip=#1\relax\fi
+\fi}
+
+\newcommand\IssueParaSpace{\relax
+\ifhmode \typeout{! LaTeX warning: IssueParaSpace in horizontal mode.}\par \fi
+\ifdim\parskip>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<0pt\relax \parskip=0pt\relax \fi}