summaryrefslogtreecommitdiff
path: root/info/examples/tex-in-practice/ola-2p.tip
diff options
context:
space:
mode:
Diffstat (limited to 'info/examples/tex-in-practice/ola-2p.tip')
-rw-r--r--info/examples/tex-in-practice/ola-2p.tip121
1 files changed, 121 insertions, 0 deletions
diff --git a/info/examples/tex-in-practice/ola-2p.tip b/info/examples/tex-in-practice/ola-2p.tip
new file mode 100644
index 0000000000..69b86108fa
--- /dev/null
+++ b/info/examples/tex-in-practice/ola-2p.tip
@@ -0,0 +1,121 @@
+% This macro source file is from the four volume series
+% "TeX in Practice" by Stephan von Bechtolsheim, published
+% 1993 by Springer-Verlag, New York.
+% Copyright 1993 Stephan von Bechtolsheim.
+% No warranty or liability is assumed.
+% This macro may be copied freely if no fees other than
+% media cost or shipping charges are charged and as long
+% as this copyright and the following source code itself
+% is not changed. Please see the series for further information.
+%
+% Version: 1.0
+% Date: May 1, 1993
+%
+%
+% This source code is documented in 36.2.4, p. IV-141.
+% Original source in file "o3.TEX", starting line 444.
+\wlog{L: "ola-2p.tip" ["o3.TEX," l. 444, p. IV-141]}%
+% This file DOES NOT belong to format "texip."
+\InputD{namedef.tip}
+\catcode`\@ = 11
+\def\FigurePlacementFileName{\jobname.fip }
+\newcount\Fco
+\newread\FigurePlacementStreamIn
+\newwrite\FigurePlacementStreamOut
+\def\ReadTheFigurePlacementFile{%
+ \Fco = 1
+ \openin\FigurePlacementStreamIn = \FigurePlacementFileName
+ \ActuallyReadFigurePlacementFile
+ \immediate\openout\FigurePlacementStreamOut =
+ \FigurePlacementFileName
+}
+\def\ActuallyReadFigurePlacementFile{%
+ \ifeof\FigurePlacementStreamIn
+ \closein\FigurePlacementStreamIn
+ \let\ReadInFigurePlacementFileNext = \relax
+ \else
+ \read\FigurePlacementStreamIn to \ALineFromTheFile
+ \def\ParMeansDone{\par}%
+ \ifx\ALineFromTheFile\ParMeansDone
+ \else
+ \NameEdef{Fig-\the\Fco}{\ALineFromTheFile}
+ \advance\Fco by 1
+ \fi
+ \let\ReadInFigurePlacementFileNext =
+ \ActuallyReadFigurePlacementFile
+ \fi
+ \ReadInFigurePlacementFileNext
+}
+\newcount\FBTwoCount
+\FBTwoCount = 1
+\newif\ifLeftSideCaption
+\def\FBTwoPass #1#2#3{%
+ \PrepareFigureBoxes{#1}{#2}{#3}
+ \insert\FigureIns{%
+ \write\FigurePlacementStreamOut{\the\pageno}
+ \if\NameDefinedConditional{Fig-\the\FBTwoCount}%
+ \wlog{Figure \the\FBTwoCount:
+ \NameUse{Fig-\the\FBTwoCount}}%
+ \expandafter\ifodd\NameUse{Fig-\the\FBTwoCount}%
+ \LeftSideCaptionfalse
+ \else
+ \LeftSideCaptiontrue
+ \fi
+ \else
+ \LeftSideCaptiontrue
+ \fi
+ \ifLeftSideCaption
+ \hbox{%
+ \valign{%
+ ##\vfil
+ \cr
+ \copy 1\cr
+ \copy 0\cr
+ }%
+ }%
+ \else
+ \hbox{%
+ \valign{%
+ ##\vfil
+ \cr
+ \copy 0\cr
+ \copy 1\cr
+ }%
+ }%
+ \fi
+ }
+ \advance\FBTwoCount by 1
+}
+\def\OutCaptionGameTwoPass{%
+ \setbox0 = \box\voidb@x
+ \setbox1 = \box\voidb@x
+ \ifodd\pageno
+ \dimen0 = 0pt
+ \let\Header = \RightHeader
+ \let\Footer = \RightFooter
+ \else
+ \dimen0 = \DiffWidth
+ \let\Header = \LeftHeader
+ \let\Footer = \LeftFooter
+ \fi
+ \shipout\vbox{%
+ \hrule height 1pt
+ \vskip 5pt
+ \Header
+ \vskip 12pt
+ \ifvoid\FigureIns
+ \else
+ \box\FigureIns
+ \vskip\skip\FigureIns
+ \fi
+ \moveright\dimen0 \BoxR 255
+ \vskip 12pt
+ \Footer
+ }
+ \global\advance\pageno by 1
+ \ifnum\outputpenalty > -20000
+ \else
+ \dosupereject
+ \fi
+}
+\catcode`\@ = 12