summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/ptptex/wrapft.sty
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/ptptex/wrapft.sty
Initial commit
Diffstat (limited to 'macros/latex/contrib/ptptex/wrapft.sty')
-rw-r--r--macros/latex/contrib/ptptex/wrapft.sty35
1 files changed, 35 insertions, 0 deletions
diff --git a/macros/latex/contrib/ptptex/wrapft.sty b/macros/latex/contrib/ptptex/wrapft.sty
new file mode 100644
index 0000000000..9bfd271bda
--- /dev/null
+++ b/macros/latex/contrib/ptptex/wrapft.sty
@@ -0,0 +1,35 @@
+\ProvidesPackage{wrapft}[2004/05/24 ver.0.95]
+\RequirePackage{wrapfig}[1999/10/12 \space v 3.3]
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\newdimen\WFcolsep %horizontal separation between fig and text
+\newdimen\WFtextsep %vspace on the top and the bottom of the figure
+\WFcolsep=1.6\columnsep
+\WFtextsep=\intextsep
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\def\WF@rapt[#1]#2{% final two args: #1 = overhang, #2 = width,
+ \ifnum `c=\WF@place % fig in the center
+ \@tempdima\hsize \advance\@tempdima-#2 \divide\@tempdima\tw@
+ \vskip\WFtextsep
+ \noindent \hspace*{\@tempdima}\begin{minipage}[t]{#2}%
+ \else
+ \gdef\WF@ovh{#1}% hold overhang for later, when \width is known
+ \global\setbox\WF@box\vtop\bgroup \setlength\hsize{#2}%
+ \ifdim\hsize>\z@ \@parboxrestore \else
+ \setbox\z@\hbox\bgroup \let\wf@@caption\caption \let\caption\wf@caption
+ \ignorespaces \fi
+ \fi}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\let\WF@@putfigmaybe\WF@putfigmaybe
+\def\WF@putfigmaybe{%
+ \columnsep \WFcolsep \intextsep \WFtextsep
+ \WF@@putfigmaybe}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\let\@endwr@pfigure\endwrapfigure
+\def\endwrapfigure{%
+ \ifnum `c=\WF@place % fig in the center
+ \end{minipage} \vskip\WFtextsep
+ \else
+ \@endwr@pfigure
+ \fi}
+\let\endwraptable\endwrapfigure
+%----- end of wrapft.sty ---------