[subversion-commit] SVN tetex-base commit + diffs: r1667 - in tetex-base/trunk: . debian tex/cslatex tex/csplain tex/latex/shapepar

Frank Küster frank at costa.debian.org
Thu Oct 5 16:38:24 UTC 2006

Author: frank
Date: 2006-10-05 16:38:23 +0000 (Thu, 05 Oct 2006)
New Revision: 1667

license cleanup: new "upstream" tarball generated

Copied: tetex-base/trunk/README.Debian-source (from rev 1666, tetex-base/branches/upstream/current/README.Debian-source)
--- tetex-base/trunk/README.Debian-source	                        (rev 0)
+++ tetex-base/trunk/README.Debian-source	2006-10-05 16:38:23 UTC (rev 1667)
@@ -0,0 +1,25 @@
+This is a repackaged tarball of teTeX-texmf.  In order to comply with
+the DFSG, the following removals and additions were performed:
+In the missing-source subdirectory, sources for the following
+documents are included:
+- The TeX Catalogue from doc/help/catalogue.  The date specified in
+  the catalogue is 2005-02-06 01:28:09.  Therefore, the source has
+  been downloaded with
+cvs -d :pserver:anonymous at cvs.texcatalogue.sarovar.org:/cvsroot/texcatalogue export  -D "2005-02-06 00:00:00" texcatalogue
+  Note, however, that the repository has moved to
+  svn://comedy.dante.de/home/ctan/texcatalogue_svn for new versions. 
+- The TeX Directory Structure specification in doc/help/tds.dvi,
+  downloaded from  ftp://tug.ctan.org/pub/tex-archive/tds.zip
+- The UK TUG TeX FAQ at doc/help/faq/uktug-faq/, downloaded as
+  http://www.tex.ac.uk/tex-arc hive/help/uk-tex-faq.zip

Modified: tetex-base/trunk/debian/changelog
--- tetex-base/trunk/debian/changelog	2006-10-05 16:28:10 UTC (rev 1666)
+++ tetex-base/trunk/debian/changelog	2006-10-05 16:38:23 UTC (rev 1667)
@@ -1,3 +1,9 @@
+tetex-base (3.0.dfsg.1-1) UNRELEASED; urgency=low
+  * (NOT RELEASED YET) New upstream release
+ -- Frank Küster <frank at kuesterei.ch>  Thu,  5 Oct 2006 18:29:22 +0200
 tetex-base (3.0-23) unstable; urgency=medium
   * Let tetex-extra Recommend separately packaged parts of teTeX. [ralf]   

Copied: tetex-base/trunk/missing-source (from rev 1666, tetex-base/branches/upstream/current/missing-source)

Modified: tetex-base/trunk/tex/cslatex/cslatex.ini
--- tetex-base/trunk/tex/cslatex/cslatex.ini	2006-10-05 16:28:10 UTC (rev 1666)
+++ tetex-base/trunk/tex/cslatex/cslatex.ini	2006-10-05 16:38:23 UTC (rev 1667)
@@ -5,19 +5,10 @@
 %% tex -ini \let\enc=w \input cslatex.ini
 %%   see the csplain.doc in csplain.tar/zip for more details
-  \ifx\pdfoutput\relax
-  \else
-    \input pdftexconfig
-    \pdfoutput=0
-  \fi
 \ifx\enc\undefined \else %% Reencoding by encTeX is needed
-   \catcode`\{=1  \catcode`\}=2 \catcode`\#=6
-   \input enc-\enc.tex
+   \catcode`\{=1  \catcode`\}=2 \catcode`\#=6 \catcode`^=7
+   \globaldefs=1 \input csenc-\enc.tex % changed in Sep. 2005
@@ -32,9 +23,31 @@
      \ifnum \count255>255 \let\next=\relax \fi \next}
-   \let\enc=\undefined \let\setinputchr=\undefined
-   \let\xordcode=\undefined \let\xchrcode=\undefined \let\xprncode=\undefined
+%   \let\enc=\undefined \let\setinputchr=\undefined
+%   \let\xordcode=\undefined \let\xchrcode=\undefined \let\xprncode=\undefined
+\ifx\pdfoutput\undefined \else % added in Feb. 2005
+   \catcode`\{=1  \catcode`\}=2
+   \def\tmpa{\pdfcslatex}
+   \expandafter\def\expandafter\tmpb\expandafter{\csname\jobname\endcsname}
+   \ifx\tmpa\tmpb %% PDFTeX with PDF output
+      \message {jobname=pdfcslatex, PDF output initialised.}
+      \openin0=pdftexconfig.tex
+      \ifeof0 \message{WARNING: pdftexconfig.tex does not exist. 
+                       I set \string\pdfoutput=1 only.}%
+      \else \closein0 \input pdftexconfig.tex
+      \fi
+      \pdfoutput=1
+   \else
+      \message {jobname=cslatex with pdftex, DVI output initialised.}
+      \pdfoutput=0
+      \let\oripdfoutput=\pdfoutput \let\pdfoutput=\undefined
+   \fi
+   \let\tmpa=\undefined \let\tmpb=\undefined
+   \catcode`\{=12 
 \input latex.ltx

Modified: tetex-base/trunk/tex/csplain/csplain.ini
--- tetex-base/trunk/tex/csplain/csplain.ini	2006-10-05 16:28:10 UTC (rev 1666)
+++ tetex-base/trunk/tex/csplain/csplain.ini	2006-10-05 16:38:23 UTC (rev 1667)
@@ -1,12 +1,3 @@
-  \ifx\pdfoutput\relax
-  \else
-    \input pdftexconfig
-    \pdfoutput=0
-  \fi
 \input csfonts  % re-defines primitive \font
 \input plain    % format Plain
 \restorefont    % original meaning of primitive \font
@@ -14,18 +5,35 @@
 \input hyphen.lan  % czech / slovak hyphenation pattern (may be others too)
 \input plaina4  % \hsize and \vsize for A4
-   \message{The format: csplain <Feb. 2000>.}
+   \message{The format: csplain <Sep. 2005>.}
    \message{The cs-fonts are preloaded and A4 size implicitly defined.}}
-\ifx\enc\undefined \else \input enc-\enc.tex \fi % re-encoding using encTeX
+\ifx\enc\undefined \else \input csenc-\enc.tex \fi % re-encoding using encTeX
 \ifx\xprncode\undefined \else %% The encTeX is detected
    \count255=128               % All codes > 128 are printable: 
    \loop \xprncode\count255=1 \advance\count255 by 1
    \ifnum \count255<256 \repeat
-% The document macros can't test the re-encoding state:
-\let\enc=\undefined \let\setinputchr=\undefined
-\let\xordcode=\undefined \let\xchrcode=\undefined \let\xprncode=\undefined
+\ifx\pdfoutput\undefined \else % added in Feb. 2005
+   \def\tmpa{\pdfcsplain}
+   \expandafter\def\expandafter\tmpb\expandafter{\csname\jobname\endcsname}
+   \ifx\tmpa\tmpb %% PDFTeX with PDF output
+      \message {jobname=pdfcsplain, PDF output initialised.}
+      \openin0=pdftexconfig.tex
+      \ifeof0 \message{WARNING: pdftexconfig.tex does not exist. 
+                       I set \string\pdfoutput=1 only.}%
+      \else \closein0 \input pdftexconfig.tex
+      \fi
+      \pdfoutput=1
+   \else
+      \message {jobname=csplain with pdftex, DVI output initialised.}
+      \pdfoutput=0
+      \let\oripdfoutput=\pdfoutput \let\pdfoutput=\undefined
+   \fi
+   \let\tmpa=\undefined \let\tmpb=\undefined
 Information about changes (since <Apr. 1995>)
@@ -48,7 +56,7 @@
 ** 3 ** <Oct. 1998>
 * The input re-encoding possibility using encTeX primitives added.
 * Files enc-k.tex, enc-w.tex and enc-p.tex added.
-* You can use (for example):   tex -ini \let\enc=k \input csplain.ini
+* You can use (for example):   tex -enc -ini \let\enc=k \input csplain.ini
   to activate the encTeX reencoding
 ** 4 ** <Feb. 2000>
@@ -64,6 +72,24 @@
                               font ptmr8t and hyphenated by right
                               pattern table. \end
+** 5 ** <Feb. 2005>
+* The possibility of csplain initialisation by pdfTeX added
+  (see \ifx\pdfoutput\undefined \else ... \fi).
+* The file pdftexconfig.tex during pdfcsplain initialisation is read
+  (see \ifx\pdfoutput\undefined \else ... \fi).
+* The file t1code.tex corrected (bug in \uccodes removed).
+** 6 ** <Sep. 2005>
+* Files enc-k.tex, enc-w.tex, enc-p.tex renamed to csenc-*.tex because
+  only characters from Czech and Slovak alphabet are declared here.
+* Commands \let\xordcode=\undefined etc. are removed, but user is kindly 
+  asked to use encTeX primitives with care. The result may be unportable 
+  document with another csplain implementations.
+* File csenc-u.tex for UTF8 input encoding using encTeX is added.
+  You can use (for example):  tex -enc -ini \let\enc=u \input csplain.ini
+  if your system (or text editor) is using UTF8 encoding.

Deleted: tetex-base/trunk/tex/latex/shapepar/shapepar.sty
--- tetex-base/trunk/tex/latex/shapepar/shapepar.sty	2006-10-05 16:28:10 UTC (rev 1666)
+++ tetex-base/trunk/tex/latex/shapepar/shapepar.sty	2006-10-05 16:38:23 UTC (rev 1667)
@@ -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)
-  {\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
-% smallest gap allowed; smaller will be eliminated
-% small gap; smaller will be enlarged
-% smallest segment allowed; smaller will be omitted
-% How many times will \shapepar try to get the size of the paragraph?
-% fineness of cutout matching to lines (number of reference points
-% per line of text)
-% Vertical extension of cutout gap (fraction of \baselineskip)
-% --------------------------------------
- \ProvidesPackage{shapepar}[2002/12/30 v 2.0, Shaped paragraphs]
- \DeclareOption{quiet}{\catcode`\*=14}
- \DeclareOption{noisy}{\catcode`\^=10}
- \ProcessOptions
-% --------------------------------------
-% 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
-\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$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
-\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
-%  \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.)
-  \@tempcnta\sqrtcount \sqrtcount\@ne
-  \expandafter\squinitial\the\@tempcnta\relax\relax\relax
-  \squiterate
-  \sqrtcount\@ne 
-\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\diamondpar#1{\shapepar\diamondshape $\diamondsuit$ {#1} $\diamondsuit$\par}
-  {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)
-\ \ $\heartsuit$\par}
-\def\circlepar#1{\Shapepar\circleshape #1\par}
-\def\nutpar#1{\Shapepar\nutshape #1\par}
-\def\starpar#1{\shapepar\starshape #1\par}
-       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
-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
-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).
-        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.
-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.
-\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 Pkg-tetex-commits mailing list