[Debian-tex-commits] SVN tetex-src commit + diffs: r1881 -
tetex-src/branches/upstream/current/source/latex/shapepar
Frank Küster
frank at costa.debian.org
Mon Oct 23 11:09:33 UTC 2006
Author: frank
Date: 2006-10-23 11:09:32 +0000 (Mon, 23 Oct 2006)
New Revision: 1881
Removed:
tetex-src/branches/upstream/current/source/latex/shapepar/Canflagshape.def
tetex-src/branches/upstream/current/source/latex/shapepar/TeXshape.def
tetex-src/branches/upstream/current/source/latex/shapepar/candleshape.def
tetex-src/branches/upstream/current/source/latex/shapepar/shapepar.sty
Log:
Load /tmp/tmp.JZOVqz/tetex-src-3.0.dfsg.2 into
tetex-src/branches/upstream/current.
Deleted: tetex-src/branches/upstream/current/source/latex/shapepar/Canflagshape.def
===================================================================
--- tetex-src/branches/upstream/current/source/latex/shapepar/Canflagshape.def 2006-10-23 10:46:39 UTC (rev 1880)
+++ tetex-src/branches/upstream/current/source/latex/shapepar/Canflagshape.def 2006-10-23 11:09:32 UTC (rev 1881)
@@ -1,33 +0,0 @@
-\def\Canflagshape{%
-{32.0}
-{0}b{0}\\
-{0}t{0}{16}\\
-{32}t{0}{16}\\
-{32}e{0}\\
-%
-{2.800} b{32.000}\\
-{6.250} b{27.000} t{30.160}{3.680} b{37.000}\\
-{7.300} t{27.217}{1.654} t{29.600}{4.800} t{35.128}{1.654}\\
-{7.400} t{27.238}{1.812} j t{29.050}{5.900} j t{34.950}{1.812}\\
-{10.450} b{24.500} t{27.869}{8.262} b{39.500}\\
-{11.800} b{19.900} t{23.984}{1.768} t{28.148}{7.703} t{38.248}{1.768} b{44.100}\\
-{12.150} t{20.005}{2.651} t{23.850}{2.227} t{28.221}{7.559} t{37.923}{2.227} t{41.344}{2.651}\\
-{12.200} t{20.021}{3.029} j t{23.050}{3.073} t{28.231}{7.538} t{37.877}{3.073} j t{40.950}{3.029}\\
-{13.500} t{20.412}{6.917} t{28.500}{7.000} t{36.671}{6.917}\\
-{13.900} t{20.533}{7.167} j t{27.700}{8.600} j t{36.300}{7.167}\\
-{15.450} t{21.000}{22.000}\\
-{16.000} t{21.000}{22.000}\\
-{17.000} t{19.550}{24.900}\\
-{22.050} t{25.900}{12.200}\\
-{22.600} t{25.900}{12.200}\\
-{23.550} t{25.489}{5.961} s t{31.450}{1.100} s t{32.550}{5.961}\\
-{24.000} t{25.295}{2.980} t{31.600}{0.800} t{35.725}{2.980}\\
-{24.450} e{25.100} t{31.593}{0.815} e{38.900}\\
-{30.000} t{31.500}{1.000}\\
-{30.000} e{32.0}\\
-%
-{0}b{48}\\
-{0}t{48}{16}\\
-{32}t{48}{16}\\
-{32}e{48}
-}
Deleted: tetex-src/branches/upstream/current/source/latex/shapepar/TeXshape.def
===================================================================
--- tetex-src/branches/upstream/current/source/latex/shapepar/TeXshape.def 2006-10-23 10:46:39 UTC (rev 1880)
+++ tetex-src/branches/upstream/current/source/latex/shapepar/TeXshape.def 2006-10-23 11:09:32 UTC (rev 1881)
@@ -1,37 +0,0 @@
-\def\TeXshape{%
-{3.8}%
- {0}b{0}\\%
- {0}t{-6.35}{7.03}\\%
- {2.5}t{-6.35}{7.03}\\%
- {2.5}t{-4.1}{2.58}\\%
-{10.11}t{-4.1}{2.58}\\%
-{10.11}e{-5}\\%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- {4.03}b{0}\\%
- {4.03}t{0}{6.39}\\%
- {6.52}t{0}{6.39}\\%
- {6.52}t{0}{2.48}\\%
- {8.0}t{0}{2.48}\\%
- {8.0}t{0}{5.27}\\%
-{10.23}t{0}{5.27}\\%
-{10.23}t{0}{2.48}\\%
-{11.69}t{0}{2.48}\\%
-{11.69}t{0}{6.4}\\%
-{14.19}t{0}{6.4}\\%
-{14.19}e{0}\\%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- {0}b{7}b{13}\\%
- {0}t{6.68}{2.5}t{11.96}{2.58}\\%
- {1.39}t{6.68}{2.5}t{11.96}{2.58}\\%
- {2.5}t{6.68}{3.6}t{10.89}{3.65}\\%
- {2.8}t{7}{3.6}jt{10.6}{3.65}\\%
- {4.23}t{8.37}{4.44}\\%
- {5.1}t{9.19}{2.8}\\%
- {6.72}t{7.54}{6.12}\\%
- {7.32}t{6.99}{3.65}st{10.64}{3.62}\\%
- {7.64}t{6.68}{3.59}t{10.95}{3.6}\\%
- {8.2}t{6.68}{3}t{11.48}{3.07}\\%
- {8.68}t{6.68}{2.5}t{11.97}{2.58}\\%
-{10.11}t{6.68}{2.5}t{11.97}{2.58}\\%
-{10.11}e{7}e{13}%
-}
Deleted: tetex-src/branches/upstream/current/source/latex/shapepar/candleshape.def
===================================================================
--- tetex-src/branches/upstream/current/source/latex/shapepar/candleshape.def 2006-10-23 10:46:39 UTC (rev 1880)
+++ tetex-src/branches/upstream/current/source/latex/shapepar/candleshape.def 2006-10-23 11:09:32 UTC (rev 1881)
@@ -1,37 +0,0 @@
-% From: "Timothy C. Burt" <tcburt at comp.uark.edu>
-% ====- Definition of a candle shape -===========================
-\def\candle{%
- {3.1}% Horizontal center
- {0}b{3}\\% Tip of flame
- {0.2}t{2.9}{0.1}\\%
- {0.4}t{2.9}{0.2}\\%
- {0.6}t{2.8}{0.4}\\%
- {0.8}t{2.7}{0.6}\\%
- {1.0}t{2.6}{0.8}\\%
- {1.2}t{2.5}{1.0}\\%
- {1.4}t{2.4}{1.3}\\%
- {1.6}t{2.3}{1.5}\\%
- {1.8}t{2.2}{1.6}\\%
- {2.0}t{2.1}{1.8}\\%
- {2.2}t{2.0}{2.0}\\%
- {2.4}t{2.0}{2.1}\\%
- {2.6}t{2.0}{2.1}\\%
- {2.8}t{1.9}{2.1}\\%
- {3.0}t{2.2}{1.8}\\%
- {3.2}t{2.5}{1.4}\\%
- {3.4}t{3.1}{0.3}\\% Bottom of flame
- {3.6}t{3.3}{0.1}\\% Wick
- {3.8}t{2.1}{2}\\% Top of candlestick
- {9.6}t{2.1}{2}\\% Bottom of candlestick
- {9.8}t{0.15}{6}\\% Top of candleholder
- {10.0}t{0.05}{6.1}\\%
- {10.2}t{0.00}{6.2}\\%
- {10.4}t{0.00}{6.3}\\%
- {10.6}t{0.05}{6.1}\\%
- {10.8}t{0.15}{6.0}\\%
- {11.0}t{0.30}{5.7}\\%
- {11.2}t{0.50}{5.3}\\%
- {11.4}t{1.00}{4.3}\\%
- {11.4}e{3.1}% Bottom of the candleholder ended on the centerline
-}% End of candle definition.
-% ====- End candle -========================================
Deleted: tetex-src/branches/upstream/current/source/latex/shapepar/shapepar.sty
===================================================================
--- tetex-src/branches/upstream/current/source/latex/shapepar/shapepar.sty 2006-10-23 10:46:39 UTC (rev 1880)
+++ tetex-src/branches/upstream/current/source/latex/shapepar/shapepar.sty 2006-10-23 11:09:32 UTC (rev 1881)
@@ -1,1325 +0,0 @@
-% S H A P E P A R . S T Y
-%
-% Typeset paragraphs in various shapes.
-%
-% Version 2.0 (Dec 2002)
-%
-% Copyright (c) 1993,2002 Donald Arseneau
-% These definitions may be freely transmitted, reproduced, or modified
-% provided that any modifications are clearly identified and this notice
-% is left intact.
-%
-% \shapepar: a macro to typeset paragraphs in a specific shape. The
-% size is adjusted automatically so that the entire shape is filled
-% with text. There can be no displayed math, and no "\vadjust"
-% material (no "\vspace"). These macros work for both LaTeX and Plain
-% TeX. For LaTeX, specify \usepackage{shapepar}, or for Plain,
-% \input shapepar.sty . Configuration parameters are set just
-% below here. Instructions for use are given in the LaTeX document
-% shapepar.tex; a short summary is given after \endinput below.
-%
-% ToDo:
-% Vertical correction for character height applied to shape.
-% Shape-based bounding box and reference point for exact placement
-% Allow multiple paragraphs and displayed math in shape
-% Typeset shape text directly when fixed scale (or even always) (register conflicts)
-% Allow text overflow from fixed scale shapes (for magazine style)
-% More assertive \cutout processing
-%
-%---------------------
-% make file load whatever status of @ (hold codes in \squarepar temporarily)
-\edef\squarepar
- {\catcode\string `\string @ \the\catcode `\@
- \catcode\string `\string $ \the\catcode `$
- \catcode\string `\string * \the\catcode `\*
- \catcode\string `\string ^ \the\catcode `\^}
-\catcode\string`\@=11 \catcode\string`\$=11
-\catcode\string`\^=14 \catcode\string`\*=10
-
-% ------ Configuration parameters ------
-
-% horizontal separation between shaped par and cut-out text
-\newskip\cutoutsep
-\cutoutsep=12pt
-
-% smallest gap allowed; smaller will be eliminated
-\def\SmallestGap{.4em}
-
-% small gap; smaller will be enlarged
-\def\SmallGap{1em}
-
-% smallest segment allowed; smaller will be omitted
-\def\SmallestSegment{.2em}
-
-% How many times will \shapepar try to get the size of the paragraph?
-\chardef\ScaleMaxTries=9
-
-% fineness of cutout matching to lines (number of reference points
-% per line of text)
-\chardef\RefineBaselines=3
-
-% Vertical extension of cutout gap (fraction of \baselineskip)
-\def\cutoutsepstretch{.5}
-
-% --------------------------------------
-\ifx\DeclareOption\undefined\else
-
- \ProvidesPackage{shapepar}[2002/12/30 v 2.0, Shaped paragraphs]
- \DeclareOption{quiet}{\catcode`\*=14}
- \DeclareOption{noisy}{\catcode`\^=10}
- \ProcessOptions
-
-\fi
-% --------------------------------------
-
-% Define variables. Use LaTeX names for some, and use aliases to
-% LaTeX allocations and TeX parameters for many others.
-% In the future, the descriptive names may disappear altogether.
-
-\newdimen\SH at scale
-\mathchardef\@dxii=512
-
-\def\@empty{}
-\long\def\@gobble#1{}
-\ifx\@tempdima\undefined \csname newdimen\endcsname \@tempdima \fi
-\ifx\@tempdimb\undefined \csname newdimen\endcsname \@tempdimb \fi
-\ifx\@tempcnta\undefined \csname newcount\endcsname \@tempcnta \fi
-\ifx\@tempcntb\undefined \csname newcount\endcsname \@tempcntb \fi
-\ifx\@tempboxa\undefined \csname newbox\endcsname \@tempboxa \fi
-
-\def\@tempa#1#2#3{% {"count"|"dimen"|"box"|"skip"}{\myname}{\realname}
- \ifx\undefined#3\csname new#1\endcsname#2% allocate new one
- \else\let#2#3\fi % alias is defined, so use it
- }
-
-\@tempa{box}\SH at boxa\rootbox
-\newbox\SH at boxb % global
-\@tempa{count}\SH at ntries\@cla % global
-\@tempa{dimen}\spec at bot\p at renwd
-\@tempa{dimen}\spec at top\jot
-\@tempa{dimen}\spec at height\@wholewidth
-\@tempa{dimen}\spec at incr\@halfwidth
-\@tempa{dimen}\spec at position\@picht
-\@tempa{dimen}\spec at nextpos\@ovxx
-\@tempa{dimen}\spec at prevpos\@ovyy
-\@tempa{dimen}\spec at hcenter\@xdim
-\@tempa{dimen}\SH at refbase\@ydim
-\@tempa{dimen}\SH at dscale\dimen at i % global
-\@tempa{dimen}\SH at tottext\@toproom % global
-\@tempa{dimen}\SH at posseg\@ovro
-\@tempa{dimen}\SH at widseg\@ovri
-\@tempa{dimen}\SH at posold\@ovdx
-\@tempa{dimen}\SH at widold\@ovdy
-\@tempa{dimen}\SH at weight\@dashdim
-\@tempa{count}\SH at npslines\interdisplaylinepenalty
-\@tempa{count}\SH at nline\@savsf
-\@tempa{count}\SH at lowline\delimiterfactor
-\@tempa{count}\SH at highline\doublehyphendemerits
-
-\let\SH at margin\@empty
-\let\SH at xoff\z@
-\let\SH at yoff\z@
-
-% ------- Begin main definitions -------
-
-\def\cutout#1#2{% #1 = r|l #2 = ( or something else
- \par \endgraf
- \lowercase{\def\SH at margin{#1}}%
- \def\@tempa{#2}\def\@tempb{(}%
- \ifx\@tempa\@tempb \let\@tempb\SH at cutopt
- \else \def\@tempb{\SH at cutopt \z@,\z@)#2}%
- \fi \@tempb
-}
-
-\def\SH at cutopt #1,#2){% #1 = x-offset, #2 = y-offset
- \def\SH at xoff{#1}\def\SH at yoff{#2}%
- \edef\SH at cutoutbase{\the\baselineskip}%
- \ifx\SH at margin\@empty\else
- \def\@tempa{l}\ifx\SH at margin\@tempa\else \def\@tempa{r}\fi
- \ifx\SH at margin\@tempa\else
- \errhelp{The \string\cutout\space is ignored; the \string\shapepar\space
- will continue. }\errmessage{Shaped Paragraph Error:
- Cutout side \string"\SH at margin\string" not valid; should be l or r.}%
- \let\SH at margin\@empty
- \fi\fi
- \ifx\SH at margin\@empty\else \begingroup \fi
-}
-
-\def\Shapepar{\ifx\SH at margin\@empty \let\SH at usebox\box \fi \shapepar}
-\let\SH at usebox\unvbox
-
-\def\shapepar#1{\relax % #1 = shape specification or "["
- \begingroup
- \ifx\SH at margin\@empty \let\SH at xoff\z@ \let\SH at yoff\z@ \fi
- \if [\noexpand#1\relax \expandafter\SH at scaledshape
- \else \SH at scale\z@ \SH at start{#1}\fi
-}
-
-\def\SH at scaledshape #1]{\SH at scale #1\relax \SH at start}
-
-\def\SH at start#1{% #1 = shape specification. May be a macro.
- \edef\SH at restog{\global\SH at ntries\the\SH at ntries
- \global\SH at dscale\the\SH at dscale \global\SH at tottext\the\SH at tottext}%
- \ifx\SH at usebox\box\else \par \endgraf \fi
- \xdef\SH at pd{\ifvmode \the\prevdepth \else \z@ \fi}%
- \let\\\relax \xdef\SH at spec{#1}%
- \expandafter\SH at checkspec\SH at spec $% check spec. $
- \hyphenpenalty10 \exhyphenpenalty10 % optimise
- \doublehyphendemerits10 \adjdemerits10
- \hfuzz\maxdimen
- \setbox\SH at boxa\vbox\bgroup % set whole text on one line
- \parindent\z@ \leftskip\z at skip % \rightskip set below
- % \spaceskip .333333emplus.8emminus.15em % optimise stretch
- \parfillskip\z@ plus\@ne fil
- \begingroup
- \linepenalty\@m
- \def\\{\unskip\penalty-200 \hskip1em plus\@m\p@ \penalty-60 }%
- \let\par\SH at endpar \hsize\maxdimen \rightskip\spaceskip
- \pretolerance\m at ne \hyphenpenalty 9000 % make discretionaries
- \ifx\textwidth\undefined\else \textwidth\hsize
- \linewidth\hsize \columnwidth\hsize \fi
- \def\vadjust{{\def\SH at dm{special vertical material}\the\everydisplay}}%
- \everydisplay{\errhelp{Press RETURN, and hope.}\errmessage
- {Shaped Paragraph Error: \SH at dm\space is illegal in a shaped paragraph}}%
- \noindent \penalty\@M \hskip\z at skip % allow hyphenation of first word
- \ignorespaces}
-
-\def\SH at dm{display-math}
-
-\def\SH at endpar{% Insert filler for fixed-scale paragraphs
- \ifdim\SH at scale>\z@ \def~{\hfil\null\hfil\null\hfil\null\hfil\null}%
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\fi
- \xdef\SH at baseset{\noexpand\baselineskip\the\baselineskip \relax}%
- \endgraf \endgroup % still inside \vbox and \begingroup
- \SH at baseset
- \global\SH at dscale\z@
-% get tottext = total length / 256 because total length may be > \maxdimen
- \setbox\@tempboxa\box\voidb at x \global\SH at tottext\z@
- \SH at sumlines % combine multiple lines -> \@tempboxa; width/256 ->\SH at tottext
-^ \message{total length = 256 times \the\SH at tottext;
-^ \string\baselineskip=\the\baselineskip;
-^ and spec height = \Pointless\spec at height. }%
- \unskip\unkern\unpenalty\unskip\unkern\unpenalty
- \setbox\SH at boxa\box\@tempboxa % all the text
- \ifdim\SH at scale>\z@ % for specified fixed scale: only format once
- \global\SH at ntries\ScaleMaxTries
- \else % Automatic scaling. Get a first-guess scale
- % Get 1/256 of total segment length into \@tempdima
- \@tempdima\z@ \spec at prevpos\z@
-^ {\let\\relax\message{Measure area of spec: \SH at spec}}%
- \expandafter\SH at measline\SH at spec \\\delimiter
-^ \message{Spec area/256 = \Pointless\@tempdima}%
-% scale = 1.02 * sqrt( [text_length/256]*\baselineskip / [spec_area/256] )
- \SH at scale \Pointless\SH at tottext\baselineskip
- \fpdivide\SH at scale\@tempdima
- \sqrtofdim\SH at scale
- \SH at scale 1.0\SH at scale % optimize
-^ \message{Initial scale = \the\SH at scale}%
- \global\SH at ntries\z@ % will count maximum \ScaleMaxTries trial scales
- \fi
- \SH at parpars \SH at tryparshape}
-
-% Measure the area covered by segments in the shape spec. Accumulate
-% as length \@tempdima
-
-\def\SH at measline#1#2\\#3{% #1 = this pos, #2 = segments, #3 = next pos
- \ifx\delimiter#3\expandafter\@gobble\else
- % Vertical space multiplier -> tempdimb -> \@tempa (temporarily)
- \@tempdimb #3\p@ \advance\@tempdimb-\spec at prevpos \divide\@tempdimb\@dxii
- \edef\@tempa{\Pointless\@tempdimb}%
- \SH at measseg #2t\fam\fam
- \spec at prevpos#1\p@
- \expandafter\SH at measline
- \fi {#3}}
-
-\def\SH at measseg#1t#2#3{%
- \ifx \fam #3\else
- \@tempdimb #3\p@
- \advance\@tempdima\@tempa\@tempdimb
- \expandafter\SH at measseg
- \fi}
-
-% \SH at tryparshape: try a parshape with scale factor \SH at scale for \SH at spec
-% For a given scale, it would take x lines of text to cover the shape,
-% but only an integer number of lines (counted by \SH at nline) will be
-% used. The excess is evenly distributed at the top and bottom to preserve
-% the symmetry of shapes. The starting point is thus:
-%
-% spec_top + 1/2 * { spec_height - floor[ (spec_height-delta)/incr ]*incr }
-%
-
-\def\SH at tryparshape{%
- \advance\SH at scale\SH at dscale % shift scale factor by delta
-^ \message{------------------------------------------------------------------------}%
-* \message{(\the\SH at ntries) Try shape with scale \the\SH at scale. \space
-* (Delta = \Pointless\SH at dscale). \space }%
- \spec at incr\baselineskip \fpdivide\spec at incr\SH at scale
- \spec at position\spec at height \advance\spec at position-.3\spec at incr % height-delta
- \SH at nline\spec at position \divide\SH at nline\spec at incr % number of lines
- \spec at position-\SH at nline\spec at incr % - height of n lines
- \advance\spec at position\spec at height % difference from desired height
- \divide\spec at position\tw@ % half the excess
- \advance\spec at position\spec at top % starting position
- \xdef\spec at firstposition{\the\spec at position}%
- \SH at widold-\maxdimen
- \SH at makeparshape}
-
-\def\SH at makeparshape{%
- \advance\spec at position-\spec at incr % pre-decrement
- \SH at nline\z@ % initialize counter for lines
- \spec at prevpos \spec at top % -\maxdimen% \spec at position
- \let\SH at Prevspec\@empty
- \let\@elt\relax % simply accumulate lines (reverse order)
- \gdef\SH at parshape{}\gdef\SH at lines{}\SH at npslines\z@
-% \message{Parsing spec, starting at \Pointless\spec at position. }%
- \expandafter \SH at doaline \SH at spec \\\delimiter $\\$}
-% this macro ends instead of continuing with \SH at done so TeX will use
-% tail-recursion as \SH at tryparshape is iterated.
-
-\def\SH at doaline{\SH at updps \SH at widold-\maxdimen
- \advance\SH at nline\@ne \advance\spec at position\spec at incr
- \let\\\SH at findpos \\}
-
-% Get spec lines appropriate for given position (\spec at position):
-% \SH at prevspec,\spec at prevpos for spec line above
-% \SH at nextspec,\spec at nextpos for spec line below
-% (lines may contain several segments)
-%
-\def\SH at findpos#1#2\\{% #1 = spec line vert position, #2 = segments
- \ifx\delimiter#1\let\\\SH at dopara
- \else
- \ifdim#1\p@<\spec at prevpos \SH at backup{#1}\fi % handle backspace
- \ifdim#1\p@>\spec at position
- \def\SH at nextspec{#2{}}\spec at nextpos#1\p@ \def\\{\SH at found{#1}#2\\}%
- \expandafter\def\expandafter\SH at prevspec\expandafter{\SH at Prevspec}%
- \else
- \def\SH at Prevspec{#2{}}\spec at prevpos#1\p@
- \fi\fi \\}
-
-\def\SH at found{% calculate weights to interpolate
-% \message{ -- \number\SH at nline\space-- SH at found \the\spec at position\space
-% between \the\spec at prevpos\space and \the\spec at nextpos. }%
- \ifdim\spec at position<\spec at prevpos
- \let\SH at next\SH at doaline
- \else
- \SH at weight\spec at position \advance\SH at weight-\spec at prevpos
- \@tempdimb\spec at nextpos \advance\@tempdimb-\spec at prevpos
- \fpdivide\SH at weight\@tempdimb % weight = interpolation factor
- \let\SH at next\SH at dosegment
- \fi
- \SH at next}
-
-\def\SH at backup#1{%\tracingall
-% \message{Backup for #1 after \Pointless\spec at prevpos, seeking \Pointless\spec at position. }%
- \ifdim#1\p@<\spec at position
- \advance\SH at nline\m at ne
- \advance\spec at position-\spec at incr
- \advance\spec at prevpos-\spec at incr
- \SH at backup{#1}%
- \fi}
-
-% Get the position and width of a segment of text by taking the weighted
-% average of the specifications from above and below (weighted by nearness).
-% We iterate \SH at dosegment while it handles the segments
-% Most of the confusing bits here are hueristics to deal with narrow gaps.
-% If a gap between two texts is less than a space, the texts are joined
-% over the gap. If the gap is less than 1em, the gap is increased to the
-% average of 1em and the given gap.
-
-\def\SH at dosegment{% do a segment of text on this line
- \SH at posseg\z@ \SH at widseg\z@
- \advance\SH at weight-\p@ \SH at weight-\SH at weight % w1 = 1 - w2
- \SH at getseg A\SH at prevspec % Above
- \advance\SH at weight-\p@ \SH at weight-\SH at weight % w2 = 1 - w1
- \SH at getseg B\SH at nextspec % Below
- \ifdim\SH at widseg>10sp
- \SH at widseg\Pointless\SH at scale\SH at widseg
- \advance\SH at posseg-\spec at hcenter
- \SH at posseg\Pointless\SH at scale\SH at posseg
- \advance\SH at posseg.5\hsize
-% Here are the small-gap heuristics. \@tempdima is the gap and the shift
- \ifdim\SH at widold>10sp
- \@tempdima\SH at posseg
- \advance\@tempdima-\SH at posold \advance\@tempdima-\SH at widold %gap
- \ifdim\@tempdima<\SmallestGap % gap too small; eliminate
-^ \message{Gap is \the\@tempdima--eliminate. }%
- \advance\SH at widold\@tempdimb \advance\SH at widold\SH at widseg % no update
- \else
- \ifdim\@tempdima<\SmallGap % gap small; enlarge it if text not too small
- \ifdim\SH at widold>\SmallGap \ifdim\SH at widseg>\SmallGap
-^ \message{Gap is \the\@tempdima--enlarge}%
- \@tempdima-.25\@tempdima \advance\@tempdima.25em
-^ \message{by 2 x \the\@tempdima. }%
- \advance\SH at widold-\@tempdima
- \advance\SH at widseg-\@tempdima
- \advance\SH at posseg \@tempdima
- \fi\fi\fi
- \SH at updps
- \fi
- \else % no previous, so no update. Just hold.
- \SH at widold\SH at widseg \SH at posold\SH at posseg
- \fi\fi
- \ifx\SH at prevspec\@empty \let\SH at next\SH at doaline \fi
- \ifx\SH at nextspec\@empty \let\SH at next\SH at doaline \fi
- \SH at next}
-
-\def\SH at updps{% Update parshape with `new' info
-^\message{Segment \Pointless\SH at posold, \Pointless\SH at widold}%
-\ifdim\SH at widold>\SmallestSegment
-* \message{.}%
- \xdef\SH at parshape{\SH at parshape\the\SH at posold\the\SH at widold\space}%
- \xdef\SH at lines{\@elt{\the\SH at nline}{\the\SH at posold}{\the\SH at widold}\SH at lines}%
- \advance\SH at npslines\@ne
-\fi \SH at widold\SH at widseg \SH at posold\SH at posseg}
-
-\def\SH at getseg#1#2{% A/B, spec
- \ifx#2\@empty \SH at sperror \fi
- \expandafter \SH at GetseG #2$#1#2}
-
-\def\SH at GetseG#1#2$#3#4{% command, rest of spec, $, A/B, spec
- \expandafter \ifx\csname spec#3$#1\endcsname \relax
- \SH at sperror
- \else
- \csname spec#3$#1\endcsname #2$#4%
- \fi}
-
-% b{pos} begin text at a point at horizontal position pos.
-% e{pos} end text at a point at horizontal position pos.
-% t{pos}{len} make a block of text at position pos with length len
-% s split text (begin whitespace)
-% j join two text blocks (end a gap)
-
-% Behavior of specs Above:
-\def\specA$b#1{\specA$t{#1}{0}}% b(pos) -> t(pos)(0)
-\def\specA$e#1#2{\csname specA$#2\endcsname}% e(pos) ignore
-\def\specA$s#1{\csname specA$#1\endcsname}% s ignore % should never happen
-\def\specA$t#1{\advance\SH at posseg#1\SH at weight \@spec$t jt{#1}}
-
-% Behavior of specs Below:
-\def\specB$e#1{\specB$t{#1}{0}}
-\def\specB$b#1#2{\csname specB$#2\endcsname}
-\def\specB$j#1{\csname specB$#1\endcsname}
-\def\specB$t#1{\advance\SH at posseg#1\SH at weight \@spec$t st{#1}}
-
-\def\@spec$t#1#2#3#4#5{% j|s t pos wid next
- \if t#2\else \SH at sperror \fi
- \advance\SH at widseg#4\SH at weight
- \if#1#5\relax % next is s (below) or j (above): unite two t
- \let\@tempa\@spec$t \else \let\@tempa\SH at redefine \fi
- \@tempa #5}
-
-\def\SH at redefine#1$#2{\def#2{#1}}
-\let\specA$\SH at redefine % bug fix to allow disjoint pieces
-\let\specB$\SH at redefine
-
-\def\SH at dopara#1${% eat remaining spec and test parshape $
-\global\setbox\SH at boxb\vbox{%
- \advance\SH at npslines\@ne
- \parshape\the\SH at npslines\space \SH at parshape \z@ \maxdimen
- \advance\SH at npslines\m at ne
-* \message{Formatting. }%
- \noindent \unhcopy\SH at boxa \endgraf
-* \message{Expected \the\SH at npslines\space lines;
-* got \the\prevgraf\space lines}%
- \ifnum\prevgraf=\SH at npslines % maybe right size; check last line
- \ifdim\SH at widseg>\z@ % yes, we can check
- \ifnum\SH at ntries<\ScaleMaxTries % safe to screw around with \SH at npslines
- \SH at grablast \@tempdima\wd\SH at boxa \advance\@tempdima 20\p@
- \ifdim\@tempdima<.8\SH at widseg % final line underfull % optimise
-* \message{but the last line is too empty. }%
- \advance\SH at npslines\@ne % flag underfullness
- \fi\fi\fi\fi
- \ifnum\prevgraf=\SH at npslines % right size, done
- \aftergroup\SH at done \global\SH at dscale\z@
- \else % Try a new scale factor
- \ifdim\SH at dscale=\z@ % no previous step. Try to guess a good one
- \ifnum\prevgraf<\SH at npslines % underfull
-^ \message{First underfull. }%
- \@tempdima\prevgraf\p@
- \divide\@tempdima\SH at npslines
- \else % overfull
-^ \message{First overfull. }%
- \SH at grablast
- \@tempdimb-\wd\SH at boxa \advance\@tempdimb-20\p@
- \divide\@tempdimb\@cclvi
- \@tempdima\SH at tottext \advance\@tempdimb\@tempdima
- \fpdivide\@tempdima\@tempdimb
-^ \message{overfullness: \the\wd\SH at boxa; ratio: \Pointless\@tempdima}%
- \fi
- \sqrtofdim\@tempdima
- \advance\@tempdima-\p@
- \divide\@tempdima\tw@
- \global\SH at dscale\Pointless\@tempdima\SH at scale
- \gdef\SH at fac{1}% % optimise
- \else % Not first step, scale from previous
- \ifnum\prevgraf>\SH at npslines % overflow now
- \ifdim\SH at dscale>\z@ % previous Overflow
- \global\SH at dscale \SH at fac\SH at dscale
- \else % overflow now, but previous underflow
- \gdef\SH at fac{.53}% % optimise
- \global\SH at dscale -\SH at fac\SH at dscale
- \fi
- \else % underflow now
- \ifdim\SH at dscale>\z@ % previous Overflow
- \gdef\SH at fac{.54}% % optimise
- \global\SH at dscale -\SH at fac\SH at dscale
- \else % overflow now, but previous underflow
- \global\SH at dscale \SH at fac\SH at dscale
- \fi
- \fi
- \fi
- \ifdim-\SH at dscale>.6\SH at scale
- \global\SH at dscale -.6\SH at scale % avoid scale --> 0 !
- \fi
- \global\advance\SH at ntries\@ne
- \ifdim\AbsVal\SH at dscale <.005\p@ \global\SH at ntries\@cclv \fi
- \ifnum \SH at ntries>\ScaleMaxTries \aftergroup\SH at done
- \else \aftergroup\SH at tryparshape
- \fi\fi
-}}% end \vbox, end macro. Must not insert anything between braces!
-
-% Get last hbox off list; rebox it into \SH at boxa, omitting final glue
-%
-\def\SH at grablast{\unskip\unkern\unskip\unpenalty
- \setbox\SH at boxa\lastbox
- \ifhbox\SH at boxa
- \setbox\SH at boxa\hbox{\unhbox\SH at boxa\unskip\unskip\unpenalty}%
- \fi}
-
-\def\SH at parpars{%
- \lineskiplimit-99\p@ \linepenalty\thr@@
- \tolerance9999
- \ifx\emergencystretch\undefined % TeX2
- \rightskip\z@ plus.5emminus.2em % optimise
- \else \rightskip\z at skip \emergencystretch 3em % TeX 3
- \fi \pretolerance\m at ne \hbadness\@MM % avoid error messages
- \SH at baseset
-}
-
-\def\SH at done{\SH at parpars
- \skip@ 1spplus2\p@ minus\p@
- \parfillskip.5\maxdimen % this will drag text to the bottom point.
- \advance\SH at npslines\@ne
-% \message{Parshape: \parshape\the\SH at npslines\space \SH at parshape 0 .5\maxdimen. }%
- \SH at reform % reformat paragraph with new parfillskip
- \ifx\SH at usebox\box % boxed \Shapepar: find min pos
- \let\@elt\SH at measureh \SH at posold\maxdimen \SH at lines
- \else
- \SH at posold\z@
- \fi
-% {\let\@elt\relax \message{SH at lines: \SH at lines. }}%
- \SH at nline\m at ne \SH at highline-\@m \SH at lowline\m at ne \let\@elt\SH at restack
-* \message{Restacking.}%
- % re-stack segments and re-justify lines; put in \vtop or \vbox appropriately
- \global\setbox\SH at boxb \ifx\SH at margin\@empty \vbox \else \vtop \fi {%
- \setbox\SH at boxa\vbox{}\leftskip\z@ plus55sp minus5\p@ % optimise
- \unvbox\SH at boxb
- \SH at lines \unvbox\SH at boxa
- \ifnum\SH at highline<\SH at lowline
- \nobreak
- % \message{After restack, \the\SH at highline<\the\SH at lowline,}
- \advance\SH at lowline-\SH at highline
- % \message{so skip down \the\SH at lowline\space lines. }%
- \vskip\SH at lowline\baselineskip
- \fi
- }% Now we have final \SH at boxb
- \ifx\SH at margin\@empty % stand-alone
- \egroup % end original \setbox\SH at boxa\vbox\bgroup; but \SH at boxa is useless
- \ifx\SH at usebox\unvbox % ordinary \shapepar
- \unvbox\SH at boxb \prevdepth\SH at pd
- \else % boxed \Shapepar
- \vtop{\unvbox\SH at boxb}%
- \ifvmode
- \hrule height-\SH at pd width\z@
- \hbox{\vrule depth\SH at pd width\z@}%
- \fi
- \fi
- \SH at restog % restore global registers
- \endgroup % forgets many local parameters. \prevdepth is global
- \else % \cutout\shapepar Placed on margin of cutout text
- \SH at docutout
- \fi
- \let\SH at usebox\unvbox % completely finished!
- \let\SH at margin\@empty
- \SH at ignorepar
-}
-
-% Note on height and depth:
-% Ordinary \shapepar uses \unvbox, which ignores ordinary \baselineskip
-% figuring, so we start the final formatting of the shape with the
-% prevdepth from outside and above. We use the depth of the \vbox
-% to set the \prevdepth after unboxing it. We can't record \prevdepth
-% from inside because we strip off a box from the bottom.
-% \Shapepar emits the shape in a box. The best way to do that is to
-% record the depth of the \vbox, rebox it as a \vtop (emitted) and then,
-% if vertical mode, make a strut with the proper depth. (Merely setting
-% \prevdepth gets the inter-line skips right, but not the placement at
-% the bottom of a page.)
-
-% Finally, \cutout requires a \smashed \vtop (only depth removed due to
-% the strange behavior of \vtop).
-
-\def\SH at reform{%
-\global\setbox\SH at boxb\vbox\bgroup
-* \message{Reformat paragraph with \string\rightskip = \the\rightskip.}%
- \advance\parfillskip-\rightskip \advance\parfillskip-\leftskip
- \parshape\the\SH at npslines\space \SH at parshape \z@ .5\maxdimen
- %% Maybe use prevdepth from outside, penalty puts \parskip and favors breaks
- \ifx\SH at margin\@empty \ifx\SH at usebox\unvbox
- \prevdepth\SH at pd \ifdim\SH at pd>-\@m\p@ \penalty-50 \fi
- \fi \fi
- \noindent \unhcopy\SH at boxa \unskip\unskip\unpenalty\strut
- \penalty-\@M\hbox{\kern\maxdimen}\endgraf
- \ifnum\prevgraf=\SH at npslines % good, it worked.
- \setbox\SH at boxa\lastbox \unskip\unpenalty % remove mongo last box
- \egroup % end \SH at boxb, just above
- \xdef\SH at pd{\the\dp\SH at boxb}%
- \else % something wrong, increase flexibility and try again
- \egroup % end \SH at boxb, just above
- \ifnum\skip@<64 % try again
- \advance\rightskip\skip@
- \multiply\skip@\tw@
- \expandafter\expandafter\expandafter \SH at reform
- \fi\fi}
-
-\def\SH at measureh#1#2#3{% line num, shift, width
- \ifdim#2<\SH at posold \SH at posold#2\relax \fi
-}
-
-\def\SH at restack#1#2#3{% line num, shift, width
- \unpenalty \skip@\lastskip \unskip \unpenalty
- \advance\skip@\lastskip \unskip \unpenalty\unpenalty
- \setbox\@tempboxa\lastbox
- \setbox\SH at boxa\vbox{%
- \ifhbox\@tempboxa
- \advance\SH at posold-#2% Trim box for \Shapepar
- \moveright-\SH at posold \hbox to#3
- {\hskip\leftskip \unhbox\@tempboxa \unskip \hskip\leftskip}%
- \nobreak
- \fi
- \vskip\skip@
- \ifnum\SH at nline>\z@ \begingroup
- \count@=#1 \advance\count at -\SH at nline \advance\count@\@ne
- \vskip-\count@\baselineskip
- \endgroup\fi
- \unvbox\SH at boxa}%
- \SH at nline#1\relax
- % Keep track of line num for last box (\SH at highline) and
- % lowest box on page (\SH at lowline)
- \ifnum\SH at highline=-\@m \SH at highline\SH at nline \fi
- \ifnum\SH at lowline<\SH at nline \SH at lowline\SH at nline \fi
-}
-
-% Find and record parameters about the shape spec:
-% \spec at hcenter: Horizontal center of spec
-% \spec at top: Vertical position at top of spec
-% \spec at bot: Vertical position at bottom of spec
-% \spec at height: difference between them
-% \spec at left: Horizontal position at leftmost point of spec (macro)
-% \spec at width: Total width of spec (macro)
-% \spec at area: Area covered by spec
-% All in whatever units are used by the spec itself.
-%
-\def\SH at checkspec#1#2#3#4${% h-center, v-origin, "b", rest of spec
- \ifx b#3\else \SH at sperror \fi
- \spec at hcenter#1\p@ \spec at top#2\p@
- \spec at bot-\maxdimen \spec at prevpos-\maxdimen
- \gdef\SH at spec{{#2}b#4}%
- % Measure vertical extrema and check for valid backspacing
- \let\\\SH at CheckSpecLine
- \\{#2}b#4\\{-12345.6}\\[$%
- \ifdim\spec at bot<-\@M\p@ \SH at sperror \fi
- % Measure horizontal extrema
- \spec at height\spec at bot \advance\spec at height-\spec at top
- \SH at posold\maxdimen \SH at widold-\maxdimen\relax
- \SH at CheckSpecSeg b#4\delimiter
- \edef\spec at left{\Pointless\SH at posold}%
- \advance\SH at widold-\SH at posold \edef\spec at width{\Pointless\SH at widold}%
-^ \message{Spec top: \Pointless\spec at top, bottom: \Pointless\spec at bot, height:
-^ \Pointless\spec at height, left: \spec at left, width: \spec at width. }%
-}
-
-% Record vertical positions.
-
-\def\SH at CheckSpecLine#1#2\\{\ifdim#1\p@<-\@M\p@ % finished
- \def\\[${}% $
- \else
- \ifdim#1\p@>\spec at bot \spec at bot #1\p@\relax \fi
- \ifdim#1\p@<\spec at prevpos % allow backspace only between pieces
- \if\SH at only@b#2;\@empty \spec at prevpos#1\p@
- \else \SH at sperror
- \spec at bot-\p@ \def\\##1[${}% $ eat rest
- \fi
- \else \spec at prevpos#1\p@
- \fi\fi \\}
-
-\def\SH at only@b #1#2{% return bb if only "b" specs until ";"
- \if b\noexpand#1\expandafter\SH at only@b
- \else \if ;\noexpand#1bb\else ab\fi
- \fi}
-
-% Record horizontal positions. These are not used, but they anticipate
-% a shape-based bounding box.
-
-\def\SH at CheckSpecSeg#1#2#3{%
- \ifx t#1\relax \SH at SaveSpecSeg{#2}{#3}\else
- \ifx b#1\relax \SH at SaveSpecSeg{#2}0\else
- \ifx e#1\relax \SH at SaveSpecSeg{#2}0\fi\fi\fi
- \ifx\delimiter#3\def\SH at CheckSpecSeg##1##2{}\fi
- \SH at CheckSpecSeg{#2}{#3}}
-
-\def\SH at SaveSpecSeg#1#2{%
- \SH at posseg#1\p@\relax
- \ifdim\SH at posseg<\SH at posold \SH at posold\SH at posseg \fi
- \advance\SH at posseg#2\p@\relax
- \ifdim\SH at posseg>\SH at widold \SH at widold\SH at posseg \fi
- \relax
-}
-
-% Grab all the hboxes in the preceding list, combine their contents in
-% \@tempboxa (removing \rightskip, separating with space), and give
-% SH at tottext = total_width / 256 (note that the total width may be
-% greater than \maxdimen)
-%
-\def\SH at sumlines{\SH at grablast
-\ifhbox\SH at boxa
- \@tempdima\wd\SH at boxa \divide\@tempdima\@cclvi
- \global\advance\SH at tottext\@tempdima
- \setbox\@tempboxa\hbox{%
- \ifvoid\@tempboxa\else \unhbox\@tempboxa\space \fi
- \unhbox\SH at boxa}%
- \expandafter\SH at sumlines
-\fi}
-
-\def\SH at sperror{\errhelp{It would be amazing if you can continue after
- this error.}\errmessage
- {Shaped Paragraph Error: Error in specification. Check carefully!}}%
-
-% Do the cutout in the surrounding text. Do so by regenerating
-% the a \parshape (\SH at lines actually) with a smaller line spacing.
-% Whichever of those lines fall near each line in the outer cutout
-% text contribute to the outer parshape.
-
-\def\SH at docutout{%
- % \message{\string\SH at docutout, with initial y-pos=\the\spec at position, scale=\the\SH at scale. }%
- \spec at position-\SH at yoff\relax \fpdivide\spec at position\SH at scale
- \advance\spec at position\spec at firstposition
- % \message{Spec position of first outer line is \the\spec at position. }%
- % line spacing of surrogate is fraction of the outer baselines.
- % Determine surrogate's "refined" baseline-skip (\SH at refbase),
- % its shape-spec increment (\spec at incr) and the number of lines
- % corresponding to the vertical (expanded) cutout-sep (\SH at highline)
- % Temporarily, \SH at posold is "shoulder" - height of octagon's corner.
- \SH at refbase\SH at cutoutbase
- \@tempdima\cutoutsep
- \SH at posold.414\cutoutsep
- \advance\@tempdima\cutoutsepstretch\SH at refbase % not refbase but cutoutbase
- \advance\SH at posold\cutoutsepstretch\SH at refbase
- \divide\SH at refbase\RefineBaselines % examine multiple positions per line
- % \message{Vertical gap \the\@tempdima, with refined spacing \the\SH at refbase. }%
- \divide\@tempdima\SH at refbase
- \SH at highline\@tempdima \SH at lowline-\SH at highline
- \spec at incr\SH at refbase
- \fpdivide\spec at incr\SH at scale
- % Pre-calculate excluded octagon shape (\SH at posold is "shoulder")
- \begingroup
- \gdef\SH at octcase{}\let\or\relax \SH at nextoctcase
- \xdef\SH at octcase{\noexpand\ifcase\SH at highline\SH at octcase\z@\noexpand\fi}%
- %\toks@\expandafter{\SH at octcase}\message{Octagon cases are: \the\toks@ }%
- \endgroup
- \SH at lowline-\SH at highline
- %\message{Range of lines of interest: \the\SH at lowline\space to \the\SH at highline. }%
- \advance\SH at lowline\@ne \advance\SH at highline\@ne
- % Generate the surrogate refined-lines shape
- \def\SH at dopara##1${}% Don't typeset the refined shape; just gobble to $
- \SH at makeparshape % Get \SH at lines
- % Record highest line number in \SH at lines
- \let\@elt\SH at getmaxline \SH at nline\z@ \SH at lines
- % Use \SH at widold ("hold") to retain: x_off +/- (.5 hsize)
- \SH at widold\SH at xoff \advance\SH at widold\if l\SH at margin-\fi .5\hsize
- % Use \SH at posold ("hold") for initialization for outermost position
- \if l\SH at margin\relax
- \def\@tempb##1##2{##1##2}%
- \SH at posold -\SH at widold
- \else
- \def\@tempb##1##2{\z@##1}%
- \SH at posold\hsize \advance\SH at posold-\SH at widold
- \fi
- % Build cutout's parshape in \SH at parshape
- \gdef\SH at parshape{\@empty\@empty\@empty}\SH at npslines\z@
- \expandafter\let\expandafter\@elt\csname SH at mostopposite\SH at margin\endcsname
- \SH at cutoutline % Builds parshape
- % Pull out indentation of first line
- \afterassignment\SH at dopara % a type of "gobble", see a bit above
- \@tempdima\SH at parshape $% the $ terminates gobble
- \advance\@tempdima-\SH at xoff
- \xdef\SH at xoff{-\the\@tempdima}%
- % Now finalize the parshape lines
- \advance\SH at npslines\@ne
- \xdef\SH at parshape{\number\SH at npslines\space\SH at parshape \z@\hsize}%
- \egroup % end original \setbox\SH at boxa\vbox\bgroup; but \SH at boxa is useless
- \SH at restog % restore global registers
- \endgroup% Have the parshape; end group started by \shapepar
- \global\setbox\SH at boxb\rlap{%
- \kern\if\SH at margin l-\fi.5\hsize
- \kern\SH at xoff
- \lower\SH at yoff \box\SH at boxb
- }%
- % Encourage page break above
- \@tempdima\dp\SH at boxb
- \advance\@tempdima-\SH at cutoutbase
- \advance\@tempdima\cutoutsep
- \dp\SH at boxb\z@
- \vskip \z@ plus .3\@tempdima % optimize
- \penalty \@cclv % optimize
- \vskip \z@ plus -.3\@tempdima % undo above skip
- \ifdim20\p@<\@tempdima % optimize
- \vskip \@tempdima plus 9\p@ % optimize
- \penalty \@m % optimize
- \vskip -\@tempdima plus -9\p@ % undo above skip
- \fi
- \noindent % Outer text is not indented. To indent, use \indent.
- \vadjust{\penalty\@M \vskip\@tempdima
- \penalty9999 % exercise page builder
- \vskip-\@tempdima}%
- \endgroup % end group started by \cutout; out of all groups
- %\message{Parshape: \noexpand\parshape\SH at parshape }%
- \parshape\SH at parshape
- \box\SH at boxb
-}
-
-% for r indent = 0pt (done by \@tempb)
-% width = leftmost_pos + x_offset + ( .5\hsize - gap )
-% for l indent = rightmost_pos + x_offset - ( .5\hsize - gap )
-% width = \hsize - indent
-% Because I allow backspacing, I can't go through the spec, building
-% the parshape. Instead, I have to scan the whole spec, or rather, its
-% instantiation in \SH at lines, for every line of the \parshape...
-% Well, I *could* sort the instantiation first; then I could move
-% though it sequentially.
-%
-% Here I am re-using some scratch variables:
-% \SH at posold = +/- \maxdimen -- starting value of rightmost/leftmost
-% \SH at widold = x_offset +/- ( .5\hsize )
-% \SH at posseg = leftmost/rightmost position
-% \SH at nline = highest number of \@elt lines in \SH at lines
-
-\def\SH at cutoutline{%
- \ifnum\SH at lowline>\SH at nline
- \let\SH at cutoutline\relax
- \else
- \SH at posseg\SH at posold
- \advance\SH at npslines\@ne
- %\message{SH at cutoutline \the\SH at npslines\space between \the\SH at lowline\space and \the\SH at highline. }%
- \SH at lines % Use \@elt to get leftmost/rightmost at this line
- %\message{ posseg \the\SH at posseg, posold \the\SH at posold. }%
- \advance\SH at posseg \SH at widold
- {\advance\hsize-\SH at posseg
- \xdef\SH at parshape{\SH at parshape \@tempb{\the\SH at posseg}{\the\hsize}}}%
- \fi
- \advance\SH at highline\RefineBaselines \advance\SH at lowline\RefineBaselines
- \SH at cutoutline}
-
-% choose leftmost position among \SH at posseg and lines near \SH at nline
-\def\SH at mostoppositer#1#2#3{% #1: line, #2: indent, #3: width
- \ifnum #1<\SH at lowline\else
- \ifnum #1>\SH at highline\else
- \advance\SH at highline-#1
- % \message{Compare #2 #3 at #1. Case \the\SH at highline: \SH at octcase}%
- \dimen@#2\advance\dimen at -\SH at octcase\relax
- \ifdim \dimen@<\SH at posseg \SH at posseg\dimen@\fi
- \advance\SH at highline#1
- \fi\fi}
-
-% choose rightmost position among \SH at posseg and lines near \SH at nline
-\def\SH at mostoppositel#1#2#3{% #1: line, #2: indent, #3: width
- \ifnum #1<\SH at lowline\else
- \ifnum #1>\SH at highline\else
- \advance\SH at highline-#1
- \dimen@#2\advance\dimen@#3\advance\dimen@\SH at octcase\relax
- % \message{Compare #2 #3 at #1. Case \the\SH at highline=\SH at octcase: \the\dimen@}%
- \ifdim \dimen@>\SH at posseg \SH at posseg\dimen@\fi
- \advance\SH at highline#1
- \fi\fi}
-
-%\def\SH at updCOlines{% Update list of lines for cut-out
-%\message{.}%
-% \xdef\SH at lines{\SH at lines\@elt{\the\SH at nline}{\the\SH at posold}{\the\SH at widold}}%
-% \advance\SH at npslines\@ne
-% \SH at widold\SH at widseg \SH at posold\SH at posseg}
-
-\def\SH at getmaxline#1#2#3{\ifnum#1>\SH at nline \SH at nline#1\relax\fi}
-
-\def\SH at nextoctcase{%
- \SH at posseg\AbsVal\SH at lowline\SH at refbase
- \SH at widseg\cutoutsep
- \ifdim\SH at posseg>\SH at posold
- \advance\SH at widseg-\SH at posseg
- \advance\SH at widseg \SH at posold
- \fi
- \xdef\SH at octcase{\SH at octcase \the\SH at widseg \or}%
- \advance\SH at lowline\@ne
- \ifnum\SH at lowline>\SH at highline\else
- \expandafter\SH at nextoctcase \fi}
-
-% Ignore following spaces and \par
-\def\SH at ignorepar{\afterassignment\SH at ignorepaR \let\SH at next=}
-\def\SH at ignorepaR{%\show\SH at next
- \edef\SH at nextspec{\noexpand\SH at next}% Hide \outer macros
- \ifx\par\SH at next \let\SH at nextspec\SH at ignorepar \fi
- \expandafter\ifx\space\SH at next \let\SH at nextspec\SH at ignorepar \fi
- \SH at nextspec}
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% Take a square root of counter \sqrtcount using Newton's method.
-% Usage: \sqrtcount=<number> \sqrtofcount; gives square root in \sqrtcount
-% To take sqrt of a dimen, do:
-% \sqrtcount=\thedimen \sqrtofcount
-% \multiply\sqrtcount by 256 \thedimen=\sqrtcount sp
-% -- see \sqrtofdim
-%
-% (\@tempcnta and \@tempcntb are used and modified.)
-\newcount\sqrtcount
-\def\sqrtofcount{\relax\ifnum\sqrtcount>\z@
- \@tempcnta\sqrtcount \sqrtcount\@ne
- \expandafter\squinitial\the\@tempcnta\relax\relax\relax
- \squiterate
-\else
- \sqrtcount\@ne
-\fi}
-\def\squinitial#1#2{\ifx#1\relax \else
- \ifx #2\relax \multiply\sqrtcount \thr@@ % 3 ~ sqrt(10)
- \else \multiply\sqrtcount 10
- \fi \expandafter \squinitial
- \fi}
-\def\squiterate{\@tempcntb\@tempcnta \divide\@tempcntb\sqrtcount
- %\message{sqrt(\the\@tempcnta) guess: \the\sqrtcount. }%
- \advance\sqrtcount\@tempcntb \divide\sqrtcount\tw@
- \advance \@tempcntb -\sqrtcount
- \ifnum \AbsVal\@tempcntb>\thr@@ % approximate, use 1 for exact
- \expandafter \squiterate \fi}% expandafter to avoid stack overflows
-
-% Take sqrt of dimen register, as described above.
-\def\sqrtofdim#1{% #1 = dimen register
- \sqrtcount#1\sqrtofcount \multiply\sqrtcount\@cclvi #1=\sqrtcount sp\relax}
-
-
-
-\newcount\FPD at hi \FPD at hi=67108863
-
-% Approximate Fixed Point Division of two dimensions
-% 3.14159/2.71828 = 1.15573
-% Two parameters: Numerator and denominator. The answer is returned
-% in the numerator (which must be a register). The denominator is
-% unchanged, but it should also be a dimen register. (It may be given
-% as an explicit *integer* string, "123", which is treated as 0.001877
-% = 123/65536.) % \@tempcntb is used and altered.
-%
-\def\fpdivide#1#2{\let\FPD at nume#1\@tempcntb#2\relax
- \FPD at scale\FPD at scale\FPD at scale\FPD at scale
- \divide#1\@tempcntb}
-
-% Rescale numbers to preserve accuracy. The number 16 is the level of
-% uncertainty. Use a lower power of 2 for more accuracy (2 is most precise).
-% But if you change it, you must change the repetions of \FPD at scale in
-% \fpdivide above: magic_number^repetitions = 65536 (16^4 = 65536).
-%
-\def\FPD at scale{\ifnum\AbsVal\FPD at nume<\FPD at hi
- \multiply\FPD at nume\sixt@@n
- \else
- \divide\@tempcntb\sixt@@n
- \fi}
-
-% take absolute value of TeX number or dimension (dimen must be a register)
-\def\AbsVal#1{\ifnum#1<\z at -\fi#1}
-
-\def\Pointless#1{\expandafter\remove at PT\the#1}
-{\catcode`p=12 \catcode`t=12 \gdef\remove at PT#1pt{#1}}
-
-\squarepar % restore catcodes
-
-% ---------------- Pre-defined shapes --------------------
-% If you have (computer) memory problems, the following shape
-% definitions can be eliminated.
-
-\def\diamondshape{{3}{0}b{3}\\{4}t{0}{6}\\{8}e{3}}
-\def\diamondpar#1{\shapepar\diamondshape $\diamondsuit$ {#1} $\diamondsuit$\par}
-
-\def\squareshape{%
- {1}% centerline at x=1
- {0}b{0}\\% begin at (0,0)
- {0}t{0}{2}\\% text at y=0, width=2
- {2}t{0}{2}\\% text at y=2, width=2
- {2}e{1}% end at (1,2)
-}
-\def\squarepar#1{\shapepar{\squareshape}#1\par}
-
-\def\heartshape{%
-{20}{0}b{13.32}b{26.68}%
-\\{.14}t{10.12}{4.42}t{25.46}{4.42}%
-\\{.7}t{9.14}{7.16}t{23.7}{7.16}%
-\\{1.4}t{8.4}{9.02}t{22.58}{9.02}%
-\\{2.1}t{7.82}{10.42}t{21.76}{10.42}%
-\\{2.8}t{7.36}{11.58}t{21.06}{11.58}%
-\\{3.5}t{6.98}{12.56}t{20.46}{12.56}%
-\\{4.2}t{6.68}{13.32}jt{20}{13.32}%
-\\{4.9}t{6.48}{27.04}%
-\\{5.6}t{6.34}{27.32}%
-\\{6.3}t{6.28}{27.44}%
-\\{7}t{6.26}{27.48}%
-\\{7.7}t{6.27}{27.46}%
-\\{8.4}t{6.32}{27.36}%
-\\{9.1}t{6.4}{27.2}%
-\\{9.8}t{6.52}{26.96}%
-\\{10.5}t{6.68}{26.64}%
-\\{11.9}t{7.12}{25.76}%
-\\{13.3}t{7.72}{24.56}%
-\\{14.7}t{8.51}{22.98}%
-\\{16.1}t{9.5}{21}%
-\\{17.5}t{10.69}{18.62}%
-\\{18.9}t{12.08}{15.84}%
-\\{20.3}t{13.7}{12.6}%
-\\{21.7}t{15.62}{8.76}%
-\\{22.4}t{16.7}{6.6}%
-\\{23.1}t{17.87}{4.26}%
-\\{24.6}e{20}%
-}
-\def\heartpar#1{\shapepar{\heartshape}#1\unskip\unskip\penalty-300
-\ \ $\heartsuit$\par}
-
-\def\circleshape{%
-{0.0}%
-{0.0}b{0}\\%
-{0.017}t{-0.129}{0.259}\\%
-{0.067}t{-0.250}{0.500}\\%
-{0.146}t{-0.354}{0.707}\\%
-{0.250}t{-0.433}{0.866}\\%
-{0.371}t{-0.483}{0.966}\\%
-{0.500}t{-0.500}{1.000}\\%
-{0.629}t{-0.483}{0.966}\\%
-{0.750}t{-0.433}{0.866}\\%
-{0.854}t{-0.354}{0.707}\\%
-{0.933}t{-0.250}{0.500}\\%
-{0.983}t{-0.129}{0.259}\\%
-{1.0}e{0}
-}
-\def\circlepar#1{\Shapepar\circleshape #1\par}
-
-\def\nutshape{%
-{0}%
-{0}b{0}\\%
-{0}t{-12.5}{25}\\%
-{11.65}t{-19.23}{19.23}st{0}{19.23}\\%
-{11.99}t{-19.42}{16.835}t{2.59}{16.835}\\%
-{12.99}t{-20}{15}t{5}{15}\\%
-{14.58}t{-20.92}{13.85}t{7.07}{13.85}\\%
-{16.65}t{-22.11}{13.45}t{8.66}{13.45}\\%
-{19.06}t{-23.51}{13.85}t{9.66}{13.85}\\%
-{21.65}t{-25}{15}t{10}{15}\\%
-{24.24}t{-23.51}{13.85}t{9.66}{13.85}\\%
-{26.65}t{-22.11}{13.45}t{8.66}{13.45}\\%
-{28.72}t{-20.92}{13.85}t{7.07}{13.85}\\%
-{30.31}t{-20}{15}t{5}{15}\\%
-{31.31}t{-19.42}{16.835}t{2.59}{16.835}\\%
-{31.65}t{-19.23}{19.23}jt{0}{19.23}\\%
-{43.3}t{-12.5}{25}\\%
-{43.3}e{0}%
-}
-\def\nutpar#1{\Shapepar\nutshape #1\par}
-
-\def\CDlabshape{%
-{0}%
-{-5.5}b{0}\\%
-{-5.3}t{-1.47}{2.94}\\%
-{-4.8}t{-2.685}{5.37}\\%
-{-3.9}t{-3.878}{7.756}\\%
-{-2.8}t{-4.734}{9.468}\\%
-{-2.5}t{-4.899}{4.899}st{0}{4.899}\\%
-{-2.2}t{-5.04}{3.853}t{1.187}{3.853}\\%
-{-1.2}t{-5.376}{3.174}t{2.193}{3.174}\\%
-{0}t{-5.5}{3}t{2.5}{3}\\%
-{1.2}t{-5.376}{3.174}t{2.193}{3.174}\\%
-{2.2}t{-5.04}{3.853}t{1.187}{3.853}\\%
-{2.5}t{-4.899}{4.899}jt{0}{4.899}\\%
-{2.8}t{-4.734}{9.468}\\%
-{3.9}t{-3.878}{7.756}\\%
-{4.8}t{-2.685}{5.37}\\%
-{5.3}t{-1.47}{2.94}\\%
-{5.5}e{0}%
-}
-\def\CDlabel#1{\Shapepar[1cm]{\CDlabshape}#1\par}
-
-\def\starshape{%
-{0}%
-{-3}b{0}\\%
-{-.927}t{-.674}{1.348}\\%
-{-.927}t{-2.853}{5.706}\\%
-{.354}t{-1.09}{2.18}\\%
-{1.146}t{-1.347}{1.347}st{0}{1.347}\\%
-{2.427}e{-1.763}e{1.763}%
-}
-\def\starpar#1{\shapepar\starshape #1\par}
-
-\endinput
-
-%-------------------------------------------------------------------
-
- S H A P E P A R . S T Y -- Instructions
-
-\shapepar is a macro to typeset paragraphs of a specified shape.
-The total size is adjusted automatically so that the entire shape is
-filled with text. This is distinct from the normal \parshape command
-which specifies a shape *and* a size, which may be only partially
-filled, or over-filled, from top to bottom. In a \shapepar there
-can be no displayed math, and no "\vadjust" material, (including
-"\vspace"). \Shapepar (capital S) is just like \shapepar except the
-paragraph is boxed and not centered. Shaping paragraphs this way is a
-slow process, so this is mainly intended for cards, invitations etc.,
-not for whole books! Although short paragraphs process much faster,
-only long paragraphs accurately fill complex shapes.
-
-These macros work for both LaTeX and plain TeX. For LaTeX, specify
-\usepackage{shapepar}, or for either, \input shapepar.sty.
-
-The command \shapepar should be used at the beginning of a paragraph,
-and it applies to the entire paragraph. There is one optional length
-parameter -- a fixed scale, <scale>, and one required parameter -- a
-description of the shape, <shape_spec>.
-
-\shapepar [<scale>]{<shape_spec>} Text of the paragraph...
-
-The text of the paragraph is not literally a *parameter*, so verbatim
-macros will work there.
-
-Ordinarily, the scale is calculated automatically so the pargaraph
-fills the shape. If a scale length is given, then the shape is
-reproduced so one unit of the <shape_spec> equals the <scale>, and
-the shape is filled with whitespace after the paragraph text.
-
-The <shape_spec> parameter is very complex, but there are a few
-shapes predefined as macros in this file: \diamondshape, \heartshape
-and \nutshape, which are used as examples in the instructions below.
-There are also commands to use these shapes: \diamondpar, \squarepar
-and \heartpar; for example, \heartpar begins \shapepar{\heartshape}#1
-so you can use it like:
-
-\heartpar{This paragraph is too short to be recognized as a heart shape.}
-
-The syntax rules for <shape_spec> are very specific, and must be
-followed closely. (In these rules, { } mean explicit braces, [ ]
-denote optional parts, < > surround a keyword that is defined (perhaps
-loosely), and | means "or"; do not type [ ] < > or |, but do type { }.)
-
-<shape_spec> = {<h_center>} <lines>
-
-<lines> = <line_spec> [\\<lines>]
-
-That is, the shape is specified as a single number in braces, followed
-by the specifications for the lines, with the lines separated by \\. The
-final paragraph will have its <h_center> position centered on the page.
-<h_center> is a number (like 10.5) of arbitrary units; whatever units
-are used for lengths and positions in the <lines>, they just need to be
-consistent.
-
-The lines in the spec are not lines of text; nor are they the lines
-that you would use to draw the shape itself. They are horizontal
-scans across the shape at irregular intervals. Curved shapes need
-many scan lines for accurate rendering while simple shapes need only
-a few. To determine the line specifications, start by drawing the
-shape on paper, then draw a series of horizontal lines across it,
-including lines that just touch the top and the bottom of the figure.
-Each line crosses over pieces of the figure in some region. These
-intersections of line and figure define a <line_spec>.
-
-<line_spec> = {<v_pos>} <segment> [ other <segment>s ]
-
-The <v_pos> is the vertical position of the line. Each <line_spec> must
-usually have a position greater than or equal to that of the previous
-line, and with all <v_pos> > -1000. The exception is that between consecutive
-lines relating to completely disconnected parts of the figure the <vpos>
-may decrease (backspacing). Position is measured from top to bottom, and
-always moving down. Each <segment> represents a region where text will
-go in the final paragraph; it is the segment of the horizontal scan line
-that overlaps the body of the figure. There are five types of segment:
-
-<segment> = t{pos}{len} | b{pos} | e{pos} | s | j
-
- b{pos} begin text at a point at horizontal position pos
- e{pos} end text at a point at horizontal position pos
- t{pos}{len} make a block of text at position pos with length len
- s split text (begin whitespace)
- j join two text blocks (end a gap)
-
-The most common type of segment is t (text). The other types are
-degenerate in that they are single points rather than finite segments.
-Types s and j have no explicit position, but they must appear between
-text segments, and those texts should abut; e.g., t{3}{2}st{5}{4}
-(text from 3 to 5 and text from 5 to 9).
-
-Let's jump right into a simple example, and the meanings will be
-clearer. A "diamond" shape can have the four vertices:
-
- (x=1,y=0)
- .
- +---> x
- ! (0,1) . . (2,1)
- !
- V y .
- (1,2)
-
-
-This shape can be exactly specified by just three scan lines passing
-through the vertices. The specification is:
-
-{1}% h_center: x = 1
-{0}b{1}\\% text block begins at point y=0, x=1
-{1}t{0}{2}\\% this scan (at y=1) crosses text (len=2) starting at x=0
-{2}e{1} text block ends at point y=2, x=1
-
-Other specification lines, like
-
-{1.5}t{0.5}{1}\\%
-
-could be inserted, but would make no difference--the shape is
-interpolated linearly between scan lines.
-
-Every block of text must start with a b specifier and end with an e
-spec on some line below. Every segment specified by t must have a
-length greater than zero. If two blocks of text merge to form one (like
-at the notch of a heart shape) there should be a j spec at the point of
-junction. If one block bifurcates (like at the top of a hole in a
-doughnut) there should be an s spec.
-
-Thus, the first line for any valid shape description must consist
-of only b segment descriptors; the last line can only have e type
-descriptors. Although the definition of the units is arbitrary, the
-numbers should range in magnitude from ~.1 - 100 to avoid numeric
-overflows and underflows.
-
-If there are errors in the format of the specification, \shapepar
-might complain with the error message
-
- Shaped Paragraph Error: Error in specification. Check carefully!
-
-At this point you may as well type x or e, as there is very little
-chance that TeX will continue successfully. You might also get one
-of TeX's regular error messages, like
-
- Illegal unit of measure (pt inserted).
-or
- Missing number, treated as zero.
-
-or you might get no error message at all, just ridiculous formatting.
-Check shape syntax carefully against the rules and the examples before
-running them through TeX.
-
-What to do if the figure does not start at a point--if it has a flat
-top? It can start at a single point, but have the next scan line at
-the same vertical position! A square paragraph is specified by:
-
- {1}% centerline at x=1 (x=1 is horizontally centered on page)
- {0}b{0}\\% begin at (0,0)
- {0}t{0}{2}\\% text at y=0, width=2
- {2}t{0}{2}\\% text at y=2, width=2
- {2}e{1}% end at (1,2)
-
-Both \diamondpar and \squarepar are defined above as paragraphs with
-these shapes.
-
-Now let's get more ambitious. A heart shape must have two simultaneous
-beginnings, a short stretch of separate text, ending with a join,
-whereafter there is just one stretch of text leading to the final
-bottom point. This shape has many scan lines so that the smooth
-flowing curves are preserved.
-
-\def\heartshape{%
-{20}{0}b{13.32}b{26.68}%
-\\{.14}t{10.12}{4.42}t{25.46}{4.42}%
-\\{.7}t{9.14}{7.16}t{23.7}{7.16}%
-\\{1.4}t{8.4}{9.02}t{22.58}{9.02}%
-\\{2.1}t{7.82}{10.42}t{21.76}{10.42}%
-\\{2.8}t{7.36}{11.58}t{21.06}{11.58}%
-\\{3.5}t{6.98}{12.56}t{20.46}{12.56}%
-\\{4.2}t{6.68}{13.32}jt{20}{13.32}%
-\\{4.9}t{6.48}{27.04}%
-\\{5.6}t{6.34}{27.32}%
-\\{6.3}t{6.28}{27.44}%
-\\{7}t{6.26}{27.48}%
-\\{7.7}t{6.27}{27.46}%
-\\{8.4}t{6.32}{27.36}%
-\\{9.1}t{6.4}{27.2}%
-\\{9.8}t{6.52}{26.96}%
-\\{10.5}t{6.68}{26.64}%
-\\{11.9}t{7.12}{25.76}%
-\\{13.3}t{7.72}{24.56}%
-\\{14.7}t{8.51}{22.98}%
-\\{16.1}t{9.5}{21}%
-\\{17.5}t{10.69}{18.62}%
-\\{18.9}t{12.08}{15.84}%
-\\{20.3}t{13.7}{12.6}%
-\\{21.7}t{15.62}{8.76}%
-\\{22.4}t{16.7}{6.6}%
-\\{23.1}t{17.87}{4.26}%
-\\{24.6}e{20}%
-}
-
-Look at \heartshape and find the two b specifiers at the beginning; find
-the j a few lines below. Notice that above the j there are two segments
-per line, but only one below it; the text to the left and right of the
-join meet at the join point: 20. I drew this heart freehand, and measured
-lengths from the sketch, so you should be able to do better!
-
-Text can have holes. For example, a doughnut-shape would have a b on
-the first line, followed by some lines with a single t, then a line with
-t s t at the start of the hole. The hole is represented by lines with two
-t specs--the gap between them is the hole. A line with t j t ends the
-hole. There are more lines with single t, and then an e line to end
-with. Our final example is a nut. Not a doughnut, but a hex-nut (for a
-machine screw) -- a regular hexagon with a circular hole in the center.
-The hexagon is flat on top and bottom so the specification begins and
-ends like the square shape. The circle is rendered as a 24-gon, beginning
-with a split (s) of the surrounding text and ending with a join (j). If
-the spacing of the scan lines looks odd, it is because the hexagon alone
-would need few scans, but the circle needs many; the points on the circle
-are at 15 degree intervals.
-
-\def\nutshape{%
-{0}%
-{0}b{0}\\%
-{0}t{-12.5}{25}\\%
-{11.65}t{-19.23}{19.23}st{0}{19.23}\\%
-{11.99}t{-19.42}{16.835}t{2.59}{16.835}\\%
-{12.99}t{-20}{15}t{5}{15}\\%
-{14.58}t{-20.92}{13.85}t{7.07}{13.85}\\%
-{16.65}t{-22.11}{13.45}t{8.66}{13.45}\\%
-{19.06}t{-23.51}{13.85}t{9.66}{13.85}\\%
-{21.65}t{-25}{15}t{10}{15}\\%
-{24.24}t{-23.51}{13.85}t{9.66}{13.85}\\%
-{26.65}t{-22.11}{13.45}t{8.66}{13.45}\\%
-{28.72}t{-20.92}{13.85}t{7.07}{13.85}\\%
-{30.31}t{-20}{15}t{5}{15}\\%
-{31.31}t{-19.42}{16.835}t{2.59}{16.835}\\%
-{31.65}t{-19.23}{19.23}jt{0}{19.23}\\%
-{43.3}t{-12.5}{25}\\%
-{43.3}e{0}%
-}
-
-\shapepar cheats a bit when the horizontal gap between two bits of text
-is small (like down in the notch of \heartpar). When the gap is less
-than an interword space it is eliminated, and the texts are joined; when
-it is somewhat larger it is expanded to give it more visibility. If you
-want to eliminate this behavior, move the following definitions up into
-the main part of the file.
-
-See shapepar.tex for more detailed instructions.
-
-%-----------------------------------------
-Version 2.00 (Dec 2002) \cutout, disjoint parts, set scale, much rewrite
-Version 1.01 (March 1993) Small changes from initial release.
-
-%
-% Test integrity of file:
-% brackets: round, square, curly, angle: () [] {} <>
-% backslash, slash, vertical, at, dollar, and: \ / | @ $ &
-% hat, grave, acute (apostrophe), quote, tilde: ^ ` ' " ~
More information about the Debian-tex-commits
mailing list