From c09766e27de6513283bdd791e2a19e2e959ab5ec Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 11 Jun 2009 23:05:47 +0000 Subject: new (old) plain package figflow (11jun09) git-svn-id: svn://tug.org/texlive/trunk@13715 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/plain/figflow/README.figflow | 15 ++++ Master/texmf-dist/tex/plain/figflow/figflow.tex | 94 ++++++++++++++++++++++ Master/tlpkg/bin/tlpkg-ctan-check | 2 +- Master/tlpkg/libexec/ctan2tds | 2 + Master/tlpkg/tlpsrc/collection-plainextra.tlpsrc | 1 + Master/tlpkg/tlpsrc/figflow.tlpsrc | 0 6 files changed, 113 insertions(+), 1 deletion(-) create mode 100644 Master/texmf-dist/doc/plain/figflow/README.figflow create mode 100644 Master/texmf-dist/tex/plain/figflow/figflow.tex create mode 100644 Master/tlpkg/tlpsrc/figflow.tlpsrc (limited to 'Master') diff --git a/Master/texmf-dist/doc/plain/figflow/README.figflow b/Master/texmf-dist/doc/plain/figflow/README.figflow new file mode 100644 index 00000000000..24d4a35e111 --- /dev/null +++ b/Master/texmf-dist/doc/plain/figflow/README.figflow @@ -0,0 +1,15 @@ +Subject: Re: Plain TeX macros for text-flowing-around-figures + +Carlos Felippa wrote: +> I wrote my own macros to do this, but they involve +> fiddling with several dimens and picking the +> insertion spot. Also possible interaction with +> footnotes, wide eqs, ejects, etc, often requires +> intervention. Coulnt find anything pertinent in eplain. +> +> Note: I am not interested in LaTeX. + +Here is what I wrote (ages ago, I notice). I don't claim anything great +about it, but it might give you or someone some ideas. + +Ian Hutchinson. diff --git a/Master/texmf-dist/tex/plain/figflow/figflow.tex b/Master/texmf-dist/tex/plain/figflow/figflow.tex new file mode 100644 index 00000000000..c81c85f30f5 --- /dev/null +++ b/Master/texmf-dist/tex/plain/figflow/figflow.tex @@ -0,0 +1,94 @@ +% FIGFLOW: plain TEX macro by Ian Hutchinson, 21 Oct 95. +% Make text flow round figure. +% Usage: \figflow{}{}{<[Figure+][Caption]>} +% at start of new paragraph. Figure top starts at insert. +% #1 figure width dimen. If negative, fig on right, else left. +% #2 figure height (including caption) dimen. (E.g.: 4 truein) +% #3 \special for figure if desired, then \vfill caption. (Both optional). +% Example: figflow{4 truein}{5 truein}{\epsfbox{figure.ps}\vfill Figure 1.} +% User is responsible for the figure fitting within the space defined. +% If figure won't fit on page, it is moved over the page break. +% If a new figflow starts before the old one is finished, a message is given +% and the second figure is skipped. Fix manually. +% Does not work for Latex. + +\newdimen\pageremains\newdimen\pdepth +\newdimen\figwidth +\newdimen\figheight +\newcount\figlines +\newcount\flevel + +\def\figflow#1#2#3{ +\ifnum\flevel>0 +\message{******Figure collision. Ignoring second figure.******} +\else +\figwidth=#1 +\figheight=#2 +\def\contents{#3} +% Put figure contents in an appropriate box. +\def\figure{\let\temp=\par \let\par=\plainpar + \line{\overfullrule=0pt% Avoid black box. + \ifdim \figwidth<0pt \hsize=-\figwidth \hss\else \hsize=\figwidth\fi + \advance \hsize by -10pt% Give a little extra hspace. + \vbox to \figheight{\vfil\noindent\contents} + \ifdim \figwidth>0pt \hss\fi + } \vskip-\figheight + \let\par=\temp% +} +\advance\figheight by \baselineskip +\divide\figheight by \baselineskip% convert height to lines. +\figlines=\figheight \multiply\figheight by \baselineskip +\begingroup\overfullrule=0pt% Turn off black box outside fig +\tolerance=1000% Allow more spaced out lines. +\flevel=1 +% Store \par +\let\plainpar=\par +% Define new \par to process figures each paragraph. +\def\par{ + \ifnum\flevel=1 +% We are starting a new figure. Set to look for enough room. + \plainpar +% End the previous paragraph. + \pageremains=\pagegoal \advance\pageremains by -\pagetotal + \ifdim\pageremains<\figheight \message{Moving figure...}%keep looking + \else +% Found the starting place. Store prevdepth. Remove glue. Place the figure. + \pdepth=\prevdepth + \nointerlineskip + \figure + \hangindent \figwidth \hangafter -\figlines \hfuzz 5 pt + \flevel=2 + \prevgraf=0 + \figheight=\baselineskip% Removed parskip adjust. + \fi + \else + \ifnum\flevel=2%level 2, making the figure. + \ifdim\figheight<\parskip + \advance\figlines -1 \advance\hangafter 1 + \advance\figheight\baselineskip + \else + \advance\figheight -\parskip%\message{else \the\figheight} + \fi + \hangcarrypar\relax% I don't know why, but this is needed. + \fi + \fi +} +\par +\vskip-\pdepth%Restore the prevdepth from the previous paragraph. +\fi +} +% Macros. +\def\endflow{\global\let\par=\plainpar\endgroup}% terminate main group. +\def\hangcarrypar{% Carry the hangindent to next par. +\edef\next{\hangafter=\the\hangafter\hangindent=\the\hangindent} +\plainpar\next +\edef\next{\prevgraf=\the\prevgraf} +\ifnum\prevgraf>0 + \ifnum\prevgraf>\figlines \endflow \flevel=0 + \else + \message{FIGFLOW: line \the\prevgraf, of \the\figlines.} + \leavevmode% Sets prevgraf to 0. So reset it using next. + \next + \fi +\fi +} diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check index a6390f71e8d..2e652d65b24 100755 --- a/Master/tlpkg/bin/tlpkg-ctan-check +++ b/Master/tlpkg/bin/tlpkg-ctan-check @@ -98,7 +98,7 @@ my @WorkingTLP = qw( extpfeil extract extsizes faktor fancybox fancyhdr fancynum fancyref fancytooltips fancyvrb FAQ-en fbs featpost - feyn feynmf fge figbas filecontents fink first-latex-doc + feyn feynmf fge figbas figflow filecontents fink first-latex-doc fixme fixpdfmag flagderiv flippdf float floatrow flowfram fltpoint fmtcount fn2end fnbreak diff --git a/Master/tlpkg/libexec/ctan2tds b/Master/tlpkg/libexec/ctan2tds index d2254bbbf3d..f9f5a44f53f 100755 --- a/Master/tlpkg/libexec/ctan2tds +++ b/Master/tlpkg/libexec/ctan2tds @@ -669,6 +669,7 @@ $standarddest = "texmf-dist"; 'fc', 'fonts', 'feyn', 'fonts', 'fge', 'fonts', + 'figflow', 'plain', 'fltpoint', 'generic', 'fourier', 'fonts', 'fouriernc', 'fonts', @@ -822,6 +823,7 @@ $standardtex='\.(cfg|sty|clo|ldf|cls|def|fd|cmap|4ht)$'; 'esint-type1', 'esint.tex', 'europecv', 'EuropeFlag|europasslogo|\.cls|\.def', 'fancytooltips','fancytipmark\..*|' . $standardtex, + 'figflow', '\.tex', 'fltpoint', '\.sty|\.tex', 'fontch', '\.tex', 'footnpag', 'footnpag\.sty', diff --git a/Master/tlpkg/tlpsrc/collection-plainextra.tlpsrc b/Master/tlpkg/tlpsrc/collection-plainextra.tlpsrc index 6eb83e13cdd..529b80c188c 100644 --- a/Master/tlpkg/tlpsrc/collection-plainextra.tlpsrc +++ b/Master/tlpkg/tlpsrc/collection-plainextra.tlpsrc @@ -2,6 +2,7 @@ name collection-plainextra category Collection shortdesc Plain TeX supplementary packages longdesc Add-on packages and macros that work with plain TeX. +depend figflow depend fixpdfmag depend fontch depend hyplain diff --git a/Master/tlpkg/tlpsrc/figflow.tlpsrc b/Master/tlpkg/tlpsrc/figflow.tlpsrc new file mode 100644 index 00000000000..e69de29bb2d -- cgit v1.2.3