summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/flowfram
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2007-08-24 18:39:51 +0000
committerKarl Berry <karl@freefriends.org>2007-08-24 18:39:51 +0000
commitac2dc0635882400d398bd97198d138880c7bcf64 (patch)
tree156472082946de836583d781b458309d76a23a9c /Master/texmf-dist/tex/latex/flowfram
parentb7edbe05e19bc98b914e35d67cc6ac17c6490bbd (diff)
flowfram 1.10 (21aug07)
git-svn-id: svn://tug.org/texlive/trunk@4801 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/flowfram')
-rw-r--r--Master/texmf-dist/tex/latex/flowfram/flowfram.sty1532
1 files changed, 808 insertions, 724 deletions
diff --git a/Master/texmf-dist/tex/latex/flowfram/flowfram.sty b/Master/texmf-dist/tex/latex/flowfram/flowfram.sty
index 8335fc36430..fb175646edc 100644
--- a/Master/texmf-dist/tex/latex/flowfram/flowfram.sty
+++ b/Master/texmf-dist/tex/latex/flowfram/flowfram.sty
@@ -5,12 +5,24 @@
%% The original source files were:
%%
%% flowfram.dtx (with options: `flowfram.sty,package')
-%% Copyright (C) 2007 Nicola Talbot, all rights reserved.
-%% If you modify this file, you must change its name first.
-%% You are NOT ALLOWED to distribute this file alone. You are NOT
-%% ALLOWED to take money for the distribution or use of either this
-%% file or a changed version, except for a nominal charge for copying
-%% etc.
+%%
+%% flowfram.dtx
+%% Copyright 2007 Nicola Talbot
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license of (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainer of this work is Nicola Talbot.
+%%
+%% This work consists of the files flowfram.dtx and flowfram.ins and the derived file flowfram.sty.
+%%
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
@@ -27,7 +39,7 @@
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{flowfram}[2007/03/09 v1.07]
+\ProvidesPackage{flowfram}[2007/08/21 v1.10]
\RequirePackage{ifthen}
\RequirePackage{keyval}
\RequirePackage{graphics}
@@ -37,28 +49,28 @@
\newcommand{\setffdrafttypeblockcolor}{\color[gray]{0.9}}
\newlength\fflabelsep
\fflabelsep=1pt
-\newcommand{\fflabelfont}{\small\sffamily}
+\newcommand*{\fflabelfont}{\small\sffamily}
\newif\ifshowtypeblock
\newif\ifshowmargins
\newif\ifshowframebbox
-\newcommand{\@ffdraft}{%
+\newcommand*{\@ffdraft}{%
\showtypeblocktrue
\showmarginstrue
\showframebboxtrue
}
-\newcommand{\@ffnodraft}{%
+\newcommand*{\@ffnodraft}{%
\showtypeblockfalse
\showmarginsfalse
\showframebboxfalse
}
-\newcommand{\@fr@meifdraft}[3][\setffdraftcolor]{%
+\newcommand*{\@fr@meifdraft}[3][\setffdraftcolor]{%
\def\ff@backcol{{none}}%
\@ifundefined{color}{\frame{#2}}{#1\frame{#2}}%
\ifthenelse{\equal{#3}{}}{}{%
\makebox[0pt][l]{\hskip\fflabelsep\fflabelfont{[#3]}}}}%
-\newcommand{\@s@tffcol}{}
-\newcommand{\@s@tfftextcol}{}
-\newcommand{\@ffbackground}[1]{#1}
+\newcommand*{\@s@tffcol}{}
+\newcommand*{\@s@tfftextcol}{}
+\newcommand*{\@ffbackground}[1]{#1}
\DeclareOption{draft}{\@ffdraft}
\DeclareOption{final}{\@ffnodraft}
\newif\if@ttb@rotate
@@ -80,11 +92,12 @@
\DeclareOption{ttbnonum}{\@ttb@numfalse}
\DeclareOption{color}{%
\def\flowframecol{{black}}\def\flowframetextcol{{black}}
-\renewcommand\@s@tffcol{\ifthenelse{\equal{\ff@col}{}}{}{%
+\renewcommand*\@s@tffcol{\ifthenelse{\equal{\ff@col}{}}{}{%
\expandafter\color\ff@col}}
-\renewcommand\@s@tfftextcol{\ifthenelse{\equal{\ff@txtcol}{}}{}{%
+\renewcommand*\@s@tfftextcol{\ifthenelse{\equal{\ff@txtcol}{}}{}{%
\expandafter\color\ff@txtcol}}
-\renewcommand{\@ffbackground}[1]{\ifthenelse{\equal{\ff@backcol}{{none}}}{%
+\renewcommand*{\@ffbackground}[1]{%
+\ifthenelse{\equal{\ff@backcol}{{none}}}{%
#1}{{\fboxsep=0pt\expandafter\colorbox\ff@backcol{#1}}}}
}
\DeclareOption{nocolor}{%
@@ -109,7 +122,7 @@
\RequirePackage{color}}
\fi
\@ifundefined{chapter}{}{%
-\newcommand{\chapterfirstpagestyle}{plain}
+\newcommand*{\chapterfirstpagestyle}{plain}
\let\@ff@OLD@chapter\@chapter
\let\@ff@OLD@schapter\@schapter
\renewcommand{\@chapter}{%
@@ -119,12 +132,12 @@
}
\newcounter{maxflow}
\newcounter{thisframe}
-\c@maxflow=0
-\c@thisframe=0
+\c@maxflow=0\relax
+\c@thisframe=0\relax
\newcounter{maxstatic}
-\c@maxstatic=0
+\c@maxstatic=0\relax
\newcounter{maxdynamic}
-\c@maxdynamic=0
+\c@maxdynamic=0\relax
\newcount\@colN
\newcount\@ff@tmpN
\newcount\ff@id
@@ -137,7 +150,7 @@
\flowframesep=\fboxsep
\newlength\flowframerule
\flowframerule=\fboxrule
-\newcommand{\flowframeshowlayout}{%
+\newcommand*{\flowframeshowlayout}{%
\finishthispage
{\@ffdraft\mbox{}\finishthispage\clearpage}}
\newif\ifusedframebreak
@@ -275,7 +288,7 @@
\expandafter
\xdef\csname @col@id@\romannumeral#1\endcsname{\ff@label}%
}
-\newcommand{\@ff@checkuniqueidl}[2]{%
+\newcommand*{\@ff@checkuniqueidl}[2]{%
{\@colN=0\relax
\whiledo{\@colN<\c@maxflow}{%
\advance\@colN by 1\relax
@@ -288,7 +301,7 @@ You can't assign this label, as it is already defined
for flow frame \number\@colN}}{}%
\fi
}}}
-\newcommand{\@flowframeid}[1]{\@colN=0\relax
+\newcommand*{\@flowframeid}[1]{\@colN=0\relax
\ff@id=0\relax
\whiledo{\@colN<\c@maxflow}{\advance\@colN by 1\relax
\ifthenelse{%
@@ -369,15 +382,15 @@ boolean}{You can only specify the values 'true' or 'false'}}}
\equal{#1}{t} \or \equal{#1}{b}}{\def\ff@valign{#1}}{%
\PackageError{flowfram}{Invalid value for 'valign' key}{You
may only specify 'c', 't' or 'b'}}}
-\newcommand{\setallflowframes}[1]{%
+\newcommand*{\setallflowframes}[1]{%
\@colN=0\whiledo{\@colN<\c@maxflow}{\advance\@colN by 1\relax
\@@setflowframe{\@colN}{#1}}}
-\newcommand{\setflowframe}{\@ifstar\@ssetflowframe\@setflowframe}
+\newcommand*{\setflowframe}{\@ifstar\@ssetflowframe\@setflowframe}
\newcommand{\@ssetflowframe}[2]{%
\@for\@ff@id:=#1\do{%
\@flowframeid{\@ff@id}%
\@@setflowframe{\ff@id}{#2}}}
-\newcommand{\@setflowframe}[2]{%
+\newcommand*{\@setflowframe}[2]{%
\ifthenelse{\equal{#1}{all}}{%
\setallflowframes{#2}}{%
\ifthenelse{\equal{#1}{odd} \TE@or \equal{#1}{even}}{%
@@ -400,7 +413,7 @@ may only specify 'c', 't' or 'b'}}}
\@@setflowframe{\@colN}{#2}%
\advance\@colN by 1\relax
}}}}}
-\newcommand{\@@setflowframe}[2]{%
+\newcommand*{\@@setflowframe}[2]{%
\def\ff@frame{}\def\ff@width{}\def\ff@height{}\def\ff@margin{}%
\def\ff@x{}\def\ff@y{}\def\ff@frametype{}\def\ff@col{}%
\def\ff@valign{}\def\ff@style{}%
@@ -476,7 +489,7 @@ may only specify 'c', 't' or 'b'}}}
\PackageError{flowfram}%
{Key 'valign' not available for flow frames}{}}%
}
-\newcommand{\@@flowframeswapcoords}[1]{%
+\newcommand*{\@@flowframeswapcoords}[1]{%
\setlength{\@ff@tmp@x}%
{\csname col@\romannumeral#1@evenx\endcsname}
\expandafter\setlength\csname col@\romannumeral#1@evenx\endcsname
@@ -490,13 +503,13 @@ may only specify 'c', 't' or 'b'}}}
\expandafter\setlength\csname col@\romannumeral#1@posy\endcsname
{\@ff@tmp@y}%
}
-\newcommand{\ffswapoddeven}{%
+\newcommand*{\ffswapoddeven}{%
\@ifstar\@sflowframeswapcoords\@flowframeswapcoords}
-\newcommand{\@sflowframeswapcoords}[1]{%
+\newcommand*{\@sflowframeswapcoords}[1]{%
\@for\@ff@id:=#1\do{%
\@flowframeid{\@ff@id}%
\@@flowframeswapcoords{\ff@id}}}
-\newcommand{\@flowframeswapcoords}[1]{%
+\newcommand*{\@flowframeswapcoords}[1]{%
\ifthenelse{\equal{#1}{all}}{%
\ff@id=0\relax
\whiledo{\ff@id<\c@maxflow}{\advance\ff@id by 1\relax
@@ -522,17 +535,17 @@ may only specify 'c', 't' or 'b'}}}
\@@flowframeswapcoords{\@colN}%
\advance\@colN by 1\relax
}}}}}
-\newcommand{\flowframex}[1]{%
+\newcommand*{\flowframex}[1]{%
\csname col@\romannumeral#1@posx\endcsname}
-\newcommand{\flowframey}[1]{%
+\newcommand*{\flowframey}[1]{%
\csname col@\romannumeral#1@posy\endcsname}
-\newcommand{\flowframeevenx}[1]{%
+\newcommand*{\flowframeevenx}[1]{%
\csname col@\romannumeral#1@evenx\endcsname}
-\newcommand{\flowframeeveny}[1]{%
+\newcommand*{\flowframeeveny}[1]{%
\csname col@\romannumeral#1@eveny\endcsname}
\newcommand{\flowframewidth}[1]{%
\csname colwidth\romannumeral#1\endcsname}
-\newcommand{\flowframeheight}[1]{%
+\newcommand*{\flowframeheight}[1]{%
\csname colheight\romannumeral#1\endcsname}
\def\@setframecol{\@ifnextchar[\@@setframecol\@@setfr@mecol}
\def\@@setframecol[#1]#2\end#3#4#5{%
@@ -540,8 +553,8 @@ may only specify 'c', 't' or 'b'}}}
[#1]{#2}}}
\def\@@setfr@mecol#1\end#2#3#4{%
\expandafter\edef\csname @#4@#3@\romannumeral#2\endcsname{{#1}}}
-\newcommand{\newstaticframe}{\@n@wstaticframe}
-\newcommand{\@n@wstaticframe}{%
+\newcommand*{\newstaticframe}{\@n@wstaticframe}
+\newcommand*{\@n@wstaticframe}{%
\global\advance\c@maxstatic by 1\relax
\newboolean{staticframe\romannumeral\c@maxstatic}%
\@ifstar\@snewstaticframe\@newstaticframe
@@ -552,7 +565,7 @@ may only specify 'c', 't' or 'b'}}}
\newcommand{\@newstaticframe}{%
\setboolean{staticframe\romannumeral\c@maxstatic}{false}%
\@@newstaticframe}
-\newcommand{\@@newstaticframe}[5][all]{%
+\newcommand*{\@@newstaticframe}[5][all]{%
\expandafter
\newbox\csname @staticframe@\romannumeral\c@maxstatic\endcsname
\expandafter
@@ -606,7 +619,7 @@ fbox}%
\@sf@checkuniqueidl{#1}{\ff@label}%
\expandafter
\xdef\csname @sf@id@\romannumeral#1\endcsname{\ff@label}}
-\newcommand{\@sf@checkuniqueidl}[2]{%
+\newcommand*{\@sf@checkuniqueidl}[2]{%
\@colN=0\relax
\whiledo{\@colN<\c@maxstatic}{%
\advance\@colN by 1\relax
@@ -619,7 +632,7 @@ You can't assign this label, as it is already defined
for static frame \number\@colN}}{}%
\fi
}}
-\newcommand{\@staticframeid}[1]{\@colN=0\relax
+\newcommand*{\@staticframeid}[1]{\@colN=0\relax
\ff@id=0\relax
\whiledo{\@colN<\c@maxstatic}{\advance\@colN by 1\relax
\ifthenelse{%
@@ -628,24 +641,24 @@ for static frame \number\@colN}}{}%
\@colN=\c@maxstatic}{}}%
\ifnum\ff@id=0\PackageError{flowfram}{Can't find static frame
id '#1'}{}\fi}
-\newcommand{\staticframex}[1]{%
+\newcommand*{\staticframex}[1]{%
\csname @sf@\romannumeral#1@posx\endcsname}
-\newcommand{\staticframey}[1]{%
+\newcommand*{\staticframey}[1]{%
\csname @sf@\romannumeral#1@posy\endcsname}
-\newcommand{\staticframeevenx}[1]{%
+\newcommand*{\staticframeevenx}[1]{%
\csname @sf@\romannumeral#1@evenx\endcsname}
-\newcommand{\staticframeeveny}[1]{%
+\newcommand*{\staticframeeveny}[1]{%
\csname @sf@\romannumeral#1@eveny\endcsname}
-\newcommand{\setallstaticframes}[1]{%
+\newcommand*{\setallstaticframes}[1]{%
\@colN=0\whiledo{\@colN<\c@maxstatic}{\advance\@colN by 1\relax
\@@setstaticframe{\@colN}{#1}}}
-\newcommand{\setstaticframe}{%
+\newcommand*{\setstaticframe}{%
\@ifstar\@ssetstaticframe\@setstaticframe}
-\newcommand{\@ssetstaticframe}[2]{%
+\newcommand*{\@ssetstaticframe}[2]{%
\@for\@ff@id:=#1\do{%
\@staticframeid{\@ff@id}%
\@@setstaticframe{\ff@id}{#2}}}
-\newcommand{\@setstaticframe}[2]{%
+\newcommand*{\@setstaticframe}[2]{%
\ifthenelse{\equal{#1}{all}}{%
\setallstaticframes{#2}}{%
\ifthenelse{\equal{#1}{odd} \TE@or \equal{#1}{even}}{%
@@ -668,7 +681,7 @@ id '#1'}{}\fi}
\@@setstaticframe{\@colN}{#2}%
\advance\@colN by 1\relax
}}}}}
-\newcommand{\@@setstaticframe}[2]{%
+\newcommand*{\@@setstaticframe}[2]{%
\expandafter\expandafter\expandafter
\@ff@getstaticpos\csname @sf@dim@\romannumeral#1\endcsname
\def\ff@frame{}\edef\ff@width{\the\@ff@tmp@x}\def\ff@angle{}%
@@ -749,48 +762,46 @@ static frames}{Static frames don't have marginal notes}}%
\PackageError{flowfram}{Key 'style' not available for
static frames}{}}%
}
+ %\newcommand*{\simpar}{\hfil\vadjust{\vskip\parskip}\break\indent}
\newcommand*{\simpar}{\hfill\\\indent\mbox{}}
-\let\orgpar\par
-\newcommand{\ffpshpar}{\edef\next{\hangafter=\the\hangafter
-\hangindent=\the\hangindent}\orgpar\next
-\edef\next{\prevgraf=\the\prevgraf}\@ff@parshape\indent\mbox{}\next}
+\let\FLForgpar\par
+\newcommand{\ffpshpar}{\edef\flf@next{\hangafter=\the\hangafter
+\hangindent=\the\hangindent}\FLForgpar\flf@next
+\edef\flf@next{\prevgraf=\the\prevgraf}\@ff@parshape\indent\mbox{}\flf@next}
\def\@ff@parshape{\parshape=0}
-
-\newcommand{\@ff@sectionhead}[1]{%
+\newcommand*{\@ff@sectionhead}[1]{%
\def\ff@sechead{#1}%
\ffpshpar
\@ifstar{\@s@ff@heading}{\@dblarg\@ff@heading}}
-
\def\@s@ff@heading#1{%
\@ifundefined{@ff@old\ff@sechead}{\PackageError{flowfram}{Unknown
heading command '\ff@sechead'}{}}{%
\begingroup
-\edef\next{\hangafter=\the\hangafter
-\hangindent=\the\hangindent}\orgpar\next
-\let\par=\orgpar
-\edef\next{\prevgraf=\the\prevgraf}%
-\csname @ff@old\ff@sechead\endcsname*{\@ff@parshape\next
+\edef\flf@next{\hangafter=\the\hangafter
+\hangindent=\the\hangindent}\FLForgpar\flf@next
+\let\par=\FLForgpar
+\edef\flf@next{\prevgraf=\the\prevgraf}%
+\csname @ff@old\ff@sechead\endcsname*{\@ff@parshape\flf@next
#1}%
-\xdef\next{\@ff@parshape
+\xdef\flf@next{\@ff@parshape
\prevgraf=\the\prevgraf}%
\endgroup
}%
-\mbox{}\next\let\next\undefined}
-
+\mbox{}\flf@next\let\flf@next\undefined}
\def\@ff@heading[#1]#2{%
\@ifundefined{@ff@old\ff@sechead}{\PackageError{flowfram}{Unknown
heading command '\ff@sechead'}{}}{%
\begingroup
-\edef\next{\hangafter=\the\hangafter
-\hangindent=\the\hangindent}\orgpar\next
-\let\par=\orgpar
-\edef\next{\prevgraf=\the\prevgraf}%
-\csname @ff@old\ff@sechead\endcsname[#1]{\@ff@parshape\next
+\edef\flf@next{\hangafter=\the\hangafter
+\hangindent=\the\hangindent}\FLForgpar\flf@next
+\let\par=\FLForgpar
+\edef\flf@next{\prevgraf=\the\prevgraf}%
+\csname @ff@old\ff@sechead\endcsname[#1]{\@ff@parshape\flf@next
#2}%
-\xdef\next{\@ff@parshape
+\xdef\flf@next{\@ff@parshape
\prevgraf=\the\prevgraf}%
\endgroup}%
-\mbox{}\next\let\next\undefined}
+\mbox{}\flf@next\let\flf@next\undefined}
\newcommand*{\@ff@setsecthead}{%
\let\@ff@oldsection=\section
\let\@ff@oldsubsection=\subsection
@@ -841,7 +852,7 @@ sectioning commands within a \string\shapepar}{}}%
\noexpand
\begin{minipage}\csname @sf@dim@\romannumeral#1\endcsname
\noexpand\begingroup
-\noexpand\let\noexpand\orgpar=\noexpand\par
+\noexpand\let\noexpand\FLForgpar=\noexpand\par
}%
\or
\edef\@sf@mpg{%
@@ -849,7 +860,7 @@ sectioning commands within a \string\shapepar}{}}%
\begin{minipage}\csname @sf@dim@\romannumeral#1\endcsname
\@ff@parshape
\noexpand\begingroup
-\noexpand\let\noexpand\orgpar=\noexpand\par
+\noexpand\let\noexpand\FLForgpar=\noexpand\par
\noexpand\let\noexpand\par=\noexpand\ffpshpar
\noexpand\@ff@setsecthead
}%
@@ -869,7 +880,7 @@ sectioning commands within a \string\shapepar}{}}%
\@sf@mpg
\setlength\parindent\sdfparindent
}{\ifnum\ff@shape=2\par
-\else\orgpar\fi\endgroup\end{minipage}\end{lrbox}%
+\else\FLForgpar\fi\endgroup\end{minipage}\end{lrbox}%
\expandafter\global\expandafter\sbox\@sf@thisframe{%
\usebox\staticframe}\ignorespaces
}
@@ -881,7 +892,7 @@ sectioning commands within a \string\shapepar}{}}%
\@staticconts{\ff@id}}
\newcommand{\@staticconts}[2]{\begin{staticcontents}{#1}%
#2\end{staticcontents}}
-\newcommand{\@@staticframeswapcoords}[1]{%
+\newcommand*{\@@staticframeswapcoords}[1]{%
\setlength{\@ff@tmp@x}%
{\csname @sf@\romannumeral#1@evenx\endcsname}
\expandafter\setlength\csname @sf@\romannumeral#1@evenx\endcsname
@@ -895,13 +906,13 @@ sectioning commands within a \string\shapepar}{}}%
\expandafter\setlength\csname @sf@\romannumeral#1@posy\endcsname
{\@ff@tmp@y}%
}
-\newcommand{\sfswapoddeven}{%
+\newcommand*{\sfswapoddeven}{%
\@ifstar\@sstaticframeswapcoords\@staticframeswapcoords}
-\newcommand{\@sstaticframeswapcoords}[1]{%
+\newcommand*{\@sstaticframeswapcoords}[1]{%
\@for\@ff@id:=#1\do{%
\@staticframeid{\@ff@id}%
\@@staticframeswapcoords{\ff@id}}}
-\newcommand{\@staticframeswapcoords}[1]{%
+\newcommand*{\@staticframeswapcoords}[1]{%
\ifthenelse{\equal{#1}{all}}{%
\ff@id=0\relax
\whiledo{\ff@id<\c@maxflow}{\advance\ff@id by 1\relax
@@ -927,18 +938,20 @@ sectioning commands within a \string\shapepar}{}}%
\@@staticframeswapcoords{\@colN}%
\advance\@colN by 1\relax
}}}}}
-\newcommand{\newdynamicframe}{%
+\newcommand*{\newdynamicframe}{%
+\@n@wdynamicframe}
+\newcommand*{\@n@wdynamicframe}{%
\global\advance\c@maxdynamic by 1\relax
\newboolean{dynamicframe\romannumeral\c@maxdynamic}
\@ifstar\@snewdynamicframe\@newdynamicframe
}
-\newcommand{\@snewdynamicframe}{%
+\newcommand*{\@snewdynamicframe}{%
\setboolean{dynamicframe\romannumeral\c@maxdynamic}{true}%
\@@newdynamicframe}
-\newcommand{\@newdynamicframe}{%
+\newcommand*{\@newdynamicframe}{%
\setboolean{dynamicframe\romannumeral\c@maxdynamic}{false}%
\@@newdynamicframe}
-\newcommand{\@@newdynamicframe}[5][all]{%
+\newcommand*{\@@newdynamicframe}[5][all]{%
\expandafter
\gdef\csname @dynamicframe@\romannumeral\c@maxdynamic\endcsname{}%
\expandafter
@@ -993,7 +1006,7 @@ fbox}%
\@df@checkuniqueidl{#1}{\ff@label}%
\expandafter
\xdef\csname @df@id@\romannumeral#1\endcsname{\ff@label}}
-\newcommand{\@df@checkuniqueidl}[2]{%
+\newcommand*{\@df@checkuniqueidl}[2]{%
\@colN=0\relax
\whiledo{\@colN<\c@maxdynamic}{%
\advance\@colN by 1\relax
@@ -1006,7 +1019,7 @@ You can't assign this label, as it is already defined
for dynamic frame \number\@colN}}{}%
\fi
}}
-\newcommand{\@dynamicframeid}[1]{\@colN=0\relax
+\newcommand*{\@dynamicframeid}[1]{\@colN=0\relax
\ff@id=0\relax
\whiledo{\@colN<\c@maxdynamic}{\advance\@colN by 1\relax
\ifthenelse{%
@@ -1015,24 +1028,24 @@ for dynamic frame \number\@colN}}{}%
\@colN=\c@maxdynamic}{}}%
\ifnum\ff@id=0\PackageError{flowfram}{Can't find dynamic frame
id '#1'}{}\fi}
-\newcommand{\dynamicframex}[1]{%
+\newcommand*{\dynamicframex}[1]{%
\csname @df@\romannumeral#1@posx\endcsname}
-\newcommand{\dynamicframey}[1]{%
+\newcommand*{\dynamicframey}[1]{%
\csname @df@\romannumeral#1@posy\endcsname}
-\newcommand{\dynamicframeevenx}[1]{%
+\newcommand*{\dynamicframeevenx}[1]{%
\csname @df@\romannumeral#1@evenx\endcsname}
-\newcommand{\dynamicframeeveny}[1]{%
+\newcommand*{\dynamicframeeveny}[1]{%
\csname @df@\romannumeral#1@eveny\endcsname}
-\newcommand{\setalldynamicframes}[1]{%
+\newcommand*{\setalldynamicframes}[1]{%
\@colN=0\whiledo{\@colN<\c@maxdynamic}{\advance\@colN by 1\relax
\@@setdynamicframe{\@colN}{#1}}}
-\newcommand{\setdynamicframe}{%
+\newcommand*{\setdynamicframe}{%
\@ifstar\@ssetdynamicframe\@setdynamicframe}
-\newcommand{\@ssetdynamicframe}[2]{%
+\newcommand*{\@ssetdynamicframe}[2]{%
\@for\@ff@id:=#1\do{%
\@dynamicframeid{\@ff@id}%
\@@setdynamicframe{\ff@id}{#2}}}
-\newcommand{\@setdynamicframe}[2]{%
+\newcommand*{\@setdynamicframe}[2]{%
\ifthenelse{\equal{#1}{all}}{%
\setalldynamicframes{#2}}{%
\ifthenelse{\equal{#1}{odd} \TE@or \equal{#1}{even}}{%
@@ -1055,7 +1068,7 @@ id '#1'}{}\fi}
\@@setdynamicframe{\@colN}{#2}%
\advance\@colN by 1\relax
}}}}}
-\newcommand{\@@setdynamicframe}[2]{%
+\newcommand*{\@@setdynamicframe}[2]{%
\expandafter\expandafter\expandafter
\@ff@getstaticpos\csname @df@dim@\romannumeral#1\endcsname
\def\ff@frame{}\edef\ff@width{\the\@ff@tmp@x}%
@@ -1130,7 +1143,7 @@ id '#1'}{}\fi}
\PackageError{flowfram}{Key 'margin' not available for dynamic
frames}{dynamic frames don't have marginal notes}}%
}
-\newcommand{\@@dynamicframeswapcoords}[1]{%
+\newcommand*{\@@dynamicframeswapcoords}[1]{%
\setlength{\@ff@tmp@x}%
{\csname @df@\romannumeral#1@evenx\endcsname}%
\expandafter\setlength
@@ -1146,13 +1159,13 @@ frames}{dynamic frames don't have marginal notes}}%
\expandafter\setlength\csname @df@\romannumeral#1@posy\endcsname
{\@ff@tmp@y}%
}
-\newcommand{\dfswapoddeven}{%
+\newcommand*{\dfswapoddeven}{%
\@ifstar\@sdynamicframeswapcoords\@dynamicframeswapcoords}
-\newcommand{\@sdynamicframeswapcoords}[1]{%
+\newcommand*{\@sdynamicframeswapcoords}[1]{%
\@for\@ff@id:=#1\do{%
\@dynamicframeid{\@ff@id}%
\@@dynamicframeswapcoords{\ff@id}}}
-\newcommand{\@dynamicframeswapcoords}[1]{%
+\newcommand*{\@dynamicframeswapcoords}[1]{%
\ifthenelse{\equal{#1}{all}}{%
\ff@id=0\relax
\whiledo{\ff@id<\c@maxflow}{\advance\ff@id by 1\relax
@@ -1178,6 +1191,39 @@ frames}{dynamic frames don't have marginal notes}}%
\@@dynamicframeswapcoords{\@colN}%
\advance\@colN by 1\relax
}}}}}
+\def\dynamiccontents#1{%
+\edef\@flf@{\@currenvir}%
+\def\@flf@idn{#1}%
+\toks@{}\@flf@get@body
+}
+\long\def\@flf@get@body#1\end
+ {\toks@\expandafter{\the\toks@#1}\@flf@find@end}
+\def\@flf@find@end#1{%
+\def\@tempa{#1}%
+\ifx\@tempa\@flf@
+\expandafter\@flf@enddynamiccontents
+\else
+\toks@\expandafter
+ {\the\toks@\end{#1}}\expandafter\@flf@get@body\fi
+}
+\let\enddynamiccontents\relax
+\def\@flf@enddynamiccontents{%
+\ifnum\@flf@idn>\c@maxdynamic
+\PackageError{flowfram}{Dynamic frame \number\@flf@idn\ does not exist}{%
+You have specified dynamic frame number \number\@flf@idn, but there are
+only \number\c@maxdynamic\space dynamic frames currently defined}%
+\else
+\expandafter
+\xdef\csname @dynamicframe@\romannumeral\@flf@idn\endcsname{\the\toks@}%
+\expandafter
+\fi
+\expandafter\end\expandafter{\@flf@}}
+\expandafter\def\csname dynamiccontents*\endcsname#1{%
+\edef\@flf@{\@currenvir}%
+\@dynamicframeid{#1}%
+\edef\@flf@idn{\number\ff@id}%
+\toks@{}\@flf@get@body
+}
\newcommand{\setdynamiccontents}{%
\@ifstar\@ssetdynamiccontents\@setdynamiccontents}
\newcommand{\@ssetdynamiccontents}[2]{%
@@ -1205,17 +1251,172 @@ but there are only
\expandafter\@ff@addtolist
\csname @dynamicframe@\romannumeral#1\endcsname\entry{#2}%
\fi}
-\toksdef\flf@ta=0 \toksdef\flf@tb=2
+\newtoks\flf@ta \newtoks\flf@tb
\long\def\@ff@addtolist#1\entry#2{\flf@ta={{#2}}%
\flf@tb=\expandafter{#1}%
\xdef#1{\the\flf@tb\the\flf@ta}}
-\newcommand{\setinitialframe}[1]{\c@thisframe=#1%
+\newcommand*{\computeleftedgeodd}[1]{%
+\setlength{#1}{-1in}%
+\addtolength{#1}{-\hoffset}%
+\addtolength{#1}{-\oddsidemargin}}
+\newcommand*{\computeleftedgeeven}[1]{%
+\setlength{#1}{-1in}%
+\addtolength{#1}{-\hoffset}%
+\addtolength{#1}{-\evensidemargin}}
+\newcommand*{\computetopedge}[1]{%
+\setlength{#1}{\textheight}%
+\addtolength{#1}{\headheight}%
+\addtolength{#1}{\headsep}%
+\addtolength{#1}{1in}%
+\addtolength{#1}{\voffset}%
+\addtolength{#1}{\topmargin}}
+\newcommand*{\computebottomedge}[1]{%
+\computetopedge{#1}%
+\addtolength{#1}{-\paperheight}}
+\newcommand*{\computerightedgeodd}[1]{%
+\computeleftedgeodd{#1}%
+\addtolength{#1}{\paperwidth}}
+\newcommand*{\computerightedgeeven}[1]{%
+\computeleftedgeeven{#1}%
+\addtolength{#1}{\paperwidth}}
+\newlength\ffareawidth
+\newlength\ffareaheight
+\newlength\ffareax
+\newlength\ffareay
+\newcommand*{\computeflowframearea}{%
+\@ifstar\@scomputeffarea\@computeffarea}
+\newcommand*{\@scomputeffarea}[1]{%
+\setlength{\ffareax}{\paperwidth}%
+\setlength{\ffareay}{\paperheight}%
+\setlength{\@ff@tmp@x}{0pt}%
+\setlength{\@ff@tmp@y}{0pt}%
+\@for\@ff@id:=#1\do{\@flowframeid{\@ff@id}%
+\ifnum\ffareax>\flowframex{\ff@id}%
+\setlength{\ffareax}{\flowframex{\ff@id}}%
+\fi
+\ifnum\ffareay>\flowframey{\ff@id}%
+\setlength{\ffareay}{\flowframey{\ff@id}}%
+\fi
+\setlength{\@ff@offset}{\flowframex{\ff@id}}%
+\addtolength{@ff@offset}{\flowframewidth{\ff@id}}%
+\ifnum\@ff@tmp@x<\@ff@offset
+\setlength{\@ff@tmp@x}{\@ff@offset}%
+\fi
+\setlength{\@ff@offset}{\flowframey{\ff@id}}%
+\addtolength{@ff@offset}{\flowframeheight{\ff@id}}%
+\ifnum\@ff@tmp@y<\@ff@offset
+\setlength{\@ff@tmp@y}{\@ff@offset}%
+\fi
+}%
+\setlength{\ffareawidth}{\@ff@tmp@x}%
+\addtolength{\ffareawidth}{-\ffareax}%
+\setlength{\ffareaheight}{\@ff@tmp@y}%
+\addtolength{\ffareaheight}{-\ffareay}}
+\newcommand*{\@computeffarea}[1]{%
+\setlength{\ffareax}{\paperwidth}%
+\setlength{\ffareay}{\paperheight}%
+\setlength{\@ff@tmp@x}{0pt}%
+\setlength{\@ff@tmp@y}{0pt}%
+\@for\@ff@id:=#1\do{%
+\ff@id=\@ff@id\relax
+\setlength{\@ff@offset}{\flowframex{\ff@id}}%
+\ifdim\ffareax>\@ff@offset
+\setlength{\ffareax}{\@ff@offset}%
+\fi
+\setlength{\@ff@offset}{\flowframey{\ff@id}}%
+\ifdim\ffareay>\@ff@offset
+\setlength{\ffareay}{\@ff@offset}%
+\fi
+\setlength{\@ff@offset}{\flowframex{\ff@id}}%
+\addtolength{\@ff@offset}{\flowframewidth{\ff@id}}%
+\ifdim\@ff@tmp@x<\@ff@offset
+\setlength{\@ff@tmp@x}{\@ff@offset}%
+\fi
+\setlength{\@ff@offset}{\flowframey{\ff@id}}%
+\addtolength{\@ff@offset}{\flowframeheight{\ff@id}}%
+\ifdim\@ff@tmp@y<\@ff@offset
+\setlength{\@ff@tmp@y}{\@ff@offset}%
+\fi
+}%
+\setlength{\ffareawidth}{\@ff@tmp@x}%
+\addtolength{\ffareawidth}{-\ffareax}%
+\setlength{\ffareaheight}{\@ff@tmp@y}%
+\addtolength{\ffareaheight}{-\ffareay}}
+\newcommand*{\@ff@swaplen}[2]{%
+\setlength{\@ff@tmp@x}{#1}%
+\setlength{#1}{#2}%
+\setlength{#2}{\@ff@tmp@x}}
+\newcommand*{\@ff@getdim}[2]{%
+\ifnum#2<1\relax
+\PackageError{flowfram}{Frame IDNs start from 1}{%
+You have specified a frame IDN of '\number#2'}%
+\fi
+\ifcase#1
+\PackageError{flowfram}{Unknown frame ID type '#1'}{%
+Frame ID types are: 1 (flow), 2 (static) and 3 (dynamic)}
+\or
+\ifnum#2>\c@maxflow
+\PackageError{flowfram}{Invalid flow frame IDN '\number#2'}{%
+Flow frame IDNs go from 1 to \number\c@maxflow}
+\else
+\setlength{\ffareax}{\flowframex{#2}}
+\setlength{\ffareay}{\flowframey{#2}}
+\setlength{\ffareawidth}{\flowframewidth{#2}}
+\setlength{\ffareaheight}{\flowframeheight{#2}}
+\fi
+\or
+\ifnum#2>\c@maxstatic
+\PackageError{flowfram}{Invalid static frame IDN '\number#2'}{%
+Static frame IDNs go from 1 to \number\c@maxstatic}
+\else
+\setlength{\ffareax}{\staticframex{#2}}
+\setlength{\ffareay}{\staticframey{#2}}
+\expandafter\expandafter\expandafter
+\@ff@getstaticpos
+\csname @sf@dim@\romannumeral#2\endcsname
+\setlength{\ffareawidth}{\@ff@tmp@x}%
+\setlength{\ffareaheight}{\@ff@tmp@y}%
+\fi
+\or
+\ifnum#2>\c@maxdynamic
+\PackageError{flowfram}{Invalid dynamic frame IDN '\number#2'}{%
+Dynamic frame IDNs go from 1 to \number\c@maxdynamic}
+\else
+\setlength{\ffareax}{\dynamicframex{#2}}
+\setlength{\ffareay}{\dynamicframey{#2}}
+\expandafter\expandafter\expandafter
+\@ff@getstaticpos
+\csname @df@dim@\romannumeral#2\endcsname
+\setlength{\ffareawidth}{\@ff@tmp@x}%
+\setlength{\ffareaheight}{\@ff@tmp@y}%
+\fi
+\else
+\PackageError{flowfram}{Unknown frame ID type '#1'}{%
+Frame ID types are: 1 (flow), 2 (static) and 3 (dynamic)}
+\fi
+}
+\newcommand*{\getstaticbounds}{%
+\@ifstar\@sgetstaticbounds\@getstaticbounds}
+\newcommand*{\@sgetstaticbounds}[1]{%
+\@staticframeid{#1}\@getstaticbounds{\ff@id}}
+\newcommand*{\@getstaticbounds}[1]{\@ff@getdim{1}{#1}}
+\newcommand*{\getflowbounds}{%
+\@ifstar\@sgetflowbounds\@getflowbounds}
+\newcommand*{\@sgetflowbounds}[1]{%
+\@flowframeid{#1}\@getflowbounds{\ff@id}}
+\newcommand*{\@getflowbounds}[1]{\@ff@getdim{2}{#1}}
+\newcommand*{\getdynamicbounds}{%
+\@ifstar\@sgetdynamicbounds\@getdynamicbounds}
+\newcommand*{\@sgetdynamicbounds}[1]{%
+\@dynamicframeid{#1}\@getdynamicbounds{\ff@id}}
+\newcommand*{\@getdynamicbounds}[1]{\@ff@getdim{3}{#1}}
+\newcommand*{\setinitialframe}[1]{\c@thisframe=#1%
\global\usedframebreaktrue
\global\setlength{\hsize}{%
\csname colwidth\romannumeral\c@thisframe\endcsname}}
\newif\if@setfr@mes
\@setfr@mesfalse
-\newcommand{\setframes}{%
+\newcommand*{\setframes}{%
\ifnum\c@thisframe=0\relax
\PackageWarning{flowfram}{Can't find a flow frame on page 1.
\MessageBreak
@@ -1397,7 +1598,6 @@ or text might not appear correctly}%
\baselineskip\z@skip
\lineskip\z@skip
\lineskiplimit\z@
- \@begindvi
\vskip\topmargin\moveright\@themargin
\vbox{%
\vskip\headheight
@@ -1405,7 +1605,7 @@ or text might not appear correctly}%
\box\@outputbox
}}\global\let\if@newlist\@@if@newlist
\stepcounter{page}\let\firstmark\botmark}
-\newcommand{\makedfheaderfooter}{%
+\newcommand*{\makedfheaderfooter}{%
\setlength{\@ff@tmp@y}{\textheight}%
\addtolength{\@ff@tmp@y}{\headsep}%
\newdynamicframe{\textwidth}{\headheight}{0pt}{\@ff@tmp@y}[header]%
@@ -1464,7 +1664,7 @@ or text might not appear correctly}%
\@floatplacement
}
\newif\if@ff@moreframes
-\newcommand{\@ff@checkifmoreframes}{%
+\newcommand*{\@ff@checkifmoreframes}{%
\@ff@moreframesfalse
\@colN=\c@thisframe
\whiledo{\@colN<\c@maxflow}{%
@@ -1484,15 +1684,15 @@ or text might not appear correctly}%
}%
\fi
}
-\newcommand{\@ff@checkpages}[2][\c@page]{%
+\newcommand*{\@ff@checkpages}[2][\c@page]{%
\@for\@ff@pp:=#2\do{%
\@ff@checkthispage{#1}{\@ff@pp}}}
-\newcommand{\@ff@checkthispage}[2]{%
+\newcommand*{\@ff@checkthispage}[2]{%
\ifthenelse{\equal{#2}{all}\or\equal{#2}{even}\or\equal{#2}{odd}}{%
\@ff@moreframestrue}{%
\ifthenelse{\equal{#2}{none}}{}{%
\@ff@checknumrange{#1}{#2}}}}
-\newcommand{\@ff@checknumrange}[2]{%
+\newcommand*{\@ff@checknumrange}[2]{%
\def\@ff@numstart{0}\def\@ff@numend{10000}%
\@ff@getrange{#2}%
\ifnum\@ff@numend>#1\relax
@@ -1504,17 +1704,17 @@ or text might not appear correctly}%
\fi
}
\newcount\c@ffrangenum
-\newcommand{\@ff@getrange}[1]{%
+\newcommand*{\@ff@getrange}[1]{%
\expandafter\@ff@@getrange#1-\relax\end}
\def\@ff@@getrange#1#2\end{%
-\ifx#1<%
-\@ff@getrangeless#1#2\end
-\else
-\ifx#1>%
-\@ff@getrangegreater#1#2\end
+\ifx#1<\relax
+ \@ff@getrangeless#1#2\end
\else
-\@@ff@getrange#1#2\end
-\fi
+ \ifx#1>\relax
+ \@ff@getrangegreater#1#2\end
+ \else
+ \@@ff@getrange#1#2\end
+ \fi
\fi
}
\def\@ff@getrangeless<#1-\relax\end{%
@@ -1540,7 +1740,7 @@ or text might not appear correctly}%
\newif\if@notthiscol
\newif\if@ff@nwpg
\newcount\c@curpg
-\newcommand{\@g@tnextcol}[1]{%
+\newcommand*{\@g@tnextcol}[1]{%
\@ff@checkifmoreframes
\if@ff@moreframes
\else
@@ -1565,12 +1765,12 @@ adding new one}%
\repeat
#1=\@colN
}
-\newcommand{\@ff@chckifthispg}[2]{%
+\newcommand*{\@ff@chckifthispg}[2]{%
\@notthiscoltrue
\edef\ff@pages{\csname @ff@pages@\romannumeral#2\endcsname}%
\@@ff@chckifthispg{#1}%
}
-\newcommand{\@@ff@chckifthispg}[1]{%
+\newcommand*{\@@ff@chckifthispg}[1]{%
\ifthenelse{\equal{\ff@pages}{none}}{}{%
\ifthenelse{\equal{\ff@pages}{all}}{\@notthiscolfalse}{%
\ifthenelse{\equal{\ff@pages}{odd}}{%
@@ -1585,21 +1785,21 @@ adding new one}%
}%
}}}}%
}
-\newcommand{\@sf@chckifthispg}[1]{%
+\newcommand*{\@sf@chckifthispg}[1]{%
\@notthiscoltrue
\edef\ff@pages{\csname @sf@pages@\romannumeral#1\endcsname}%
\@@ff@chckifthispg{\c@page}%
}
-\newcommand{\@df@chckifthispg}[1]{%
+\newcommand*{\@df@chckifthispg}[1]{%
\@notthiscoltrue
\edef\ff@pages{\csname @df@pages@\romannumeral#1\endcsname}%
\@@ff@chckifthispg{\c@page}%
}
-\newcommand{\@setcolbox}[1]{%
+\newcommand*{\@setcolbox}[1]{%
\expandafter\global\expandafter\setbox
\csname column\romannumeral#1\endcsname\box\@outputbox
}
-\newcommand{\@docolbox}[1]{%
+\newcommand*{\@docolbox}[1]{%
\edef\ff@frametype{%
\csname @ff@frametype@\romannumeral#1\endcsname}%
\edef\ff@col{\csname @ff@col@\romannumeral#1\endcsname}%
@@ -1617,7 +1817,7 @@ adding new one}%
{\csname colheight\romannumeral#1\endcsname}{%
\expandafter\box\csname column\romannumeral#1\endcsname}%
}}}
-\newcommand{\@docolbbox}[1]{%
+\newcommand*{\@docolbbox}[1]{%
\@ff@setoffset{#1}%
\def\ff@col{}\def\ff@txtcol{}%
\@fr@meifdraft{%
@@ -1631,7 +1831,7 @@ adding new one}%
#4{\@ff@box{#1}{#2}{#3}}}}
\newcommand{\@ff@box}[3]{{\@ffbackground{\vbox to#2
{\hb@xt@ #1{\hss{\@s@tfftextcol #3}\hss}\vss\kern\z@}}}}
-\newcommand{\@putcolbox}[1]{%
+\newcommand*{\@putcolbox}[1]{%
\@ff@chckifthispg{\c@page}{#1}%
\if@notthiscol
\else
@@ -1656,7 +1856,7 @@ adding new one}%
\fi
\fi
}
-\newcommand{\@putcolbbox}[1]{%
+\newcommand*{\@putcolbbox}[1]{%
\@ff@chckifthispg{\c@page}{#1}%
\if@notthiscol
\else
@@ -1681,24 +1881,24 @@ adding new one}%
\fi
\fi
}
-\newcommand{\@ff@s@t@doubleboxoffset}{%
+\newcommand*{\@ff@s@t@doubleboxoffset}{%
\setlength{\@ff@offset}{-\flowframesep}%
\addtolength{\@ff@offset}{-3.75\flowframerule}%
\addtolength{\@ff@offset}{-.5pt}%
}
-\newcommand{\@ff@s@t@ovalboxoffset}{%
-\@ff@offset=-\fontdimen 8\tenln
-\advance\@ff@offset by -\flowframesep
+\newcommand*{\@ff@s@t@ovalboxoffset}{%
+\@ff@offset=-\fontdimen 8\tenln\relax
+\advance\@ff@offset by -\flowframesep\relax
}
-\newcommand{\@ff@s@t@Ovalboxoffset}{%
-\@ff@offset=-\fontdimen 8\tenlnw
-\advance\@ff@offset by -\flowframesep
+\newcommand*{\@ff@s@t@Ovalboxoffset}{%
+\@ff@offset=-\fontdimen 8\tenlnw\relax
+\advance\@ff@offset by -\flowframesep\relax
}
-\newcommand{\@ff@s@t@defaultoffset}{%
-\@ff@offset=-\flowframesep
+\newcommand*{\@ff@s@t@defaultoffset}{%
+\@ff@offset=-\flowframesep\relax
\addtolength{\@ff@offset}{-\flowframerule}%
}
-\newcommand{\@ff@setoffset}[1]{%
+\newcommand*{\@ff@setoffset}[1]{%
\ifthenelse{\equal{\csname @ff@offset@\romannumeral#1\endcsname}%
{compute}}{%
\ifthenelse{\boolean{columnframe\romannumeral#1}}{%
@@ -1723,7 +1923,7 @@ adding new one}%
\setlength{\@ff@offset}%
{\csname @ff@offset@\romannumeral#1\endcsname}}%
}
-\newcommand{\@sf@setoffset}[1]{%
+\newcommand*{\@sf@setoffset}[1]{%
\ifthenelse{%
\equal{\csname @sf@offset@\romannumeral#1\endcsname}%
{compute}}{%
@@ -1750,7 +1950,7 @@ adding new one}%
\setlength{\@ff@offset}%
{\csname @sf@offset@\romannumeral#1\endcsname}}%
}
-\newcommand{\@df@setoffset}[1]{%
+\newcommand*{\@df@setoffset}[1]{%
\ifthenelse{%
\equal{\csname @df@offset@\romannumeral#1\endcsname}%
{compute}}{%
@@ -1777,7 +1977,7 @@ adding new one}%
\setlength{\@ff@offset}%
{\csname @df@offset@\romannumeral#1\endcsname}}%
}
-\newcommand{\@putmarginbox}[1]{%
+\newcommand*{\@putmarginbox}[1]{%
\@ff@chckifthispg{\c@page}{#1}%
\if@notthiscol
\else
@@ -1816,7 +2016,7 @@ adding new one}%
{\csname colheight\romannumeral#1\endcsname}{}}%
{M:\number#1}\hss}\fi
\ignorespaces}
-\newcommand{\@ff@drawmargins}{%
+\newcommand*{\@ff@drawmargins}{%
\@colN=0\relax
\whiledo{\@colN<\c@maxflow}{%
\advance\@colN by 1\relax
@@ -1826,7 +2026,7 @@ adding new one}%
\def\@ff@getstaticpos[#1][#2][#3]#4{\@ff@tmp@x=#4\relax
\@ff@tmp@y=#2\relax
\def\ff@valign{#3}}
-\newcommand{\@dostaticbox}[1]{%
+\newcommand*{\@dostaticbox}[1]{%
\edef\ff@frametype{%
\csname @sf@frametype@\romannumeral#1\endcsname}%
\edef\ff@col{\csname @sf@col@\romannumeral#1\endcsname}%
@@ -1843,7 +2043,7 @@ adding new one}%
\@ff@box{\@ff@tmp@x}{\@ff@tmp@y}%
{\expandafter\usebox\csname @staticframe@\romannumeral#1\endcsname}%
}}}
-\newcommand{\@dostaticbbox}[1]{%
+\newcommand*{\@dostaticbbox}[1]{%
\edef\ff@col{}%
\@sf@setoffset{#1}%
\expandafter\expandafter\expandafter
@@ -1852,7 +2052,7 @@ adding new one}%
\@ff@box{\@ff@tmp@x}{\@ff@tmp@y}%
{\expandafter\usebox\csname @staticframe@\romannumeral#1\endcsname}%
}{S:\number#1;\csname @sf@id@\romannumeral#1\endcsname}}
-\newcommand{\@putstaticbox}[1]{%
+\newcommand*{\@putstaticbox}[1]{%
\@sf@chckifthispg{#1}%
\if@notthiscol\else
\@killglue
@@ -1875,7 +2075,7 @@ adding new one}%
\@dostaticbox{#1}\hss}%
\fi
\fi}
-\newcommand{\@putstaticbbox}[1]{%
+\newcommand*{\@putstaticbbox}[1]{%
\@sf@chckifthispg{#1}%
\if@notthiscol\else
\@killglue
@@ -1898,19 +2098,19 @@ adding new one}%
\@dostaticbbox{#1}\hss}\ignorespaces
\fi
\fi}
-\newcommand{\@resetst@tics}{%
+\newcommand*{\@resetst@tics}{%
\@colN=0\relax
\whiledo{\@colN<\c@maxstatic}{\advance\@colN by 1\relax
\ifthenelse{\boolean{@sf@clear@\romannumeral\@colN}}{%
\global\sbox{%
\csname @staticframe@\romannumeral\@colN\endcsname}{}}{}}}
-\newcommand{\@resetdyn@mics}{%
+\newcommand*{\@resetdyn@mics}{%
\@colN=0\relax
\whiledo{\@colN<\c@maxdynamic}{\advance\@colN by 1\relax
\ifthenelse{\boolean{@df@clear@\romannumeral\@colN}}{%
\expandafter\global\expandafter
\gdef\csname @dynamicframe@\romannumeral\@colN\endcsname{}}{}}}
-\newcommand{\@dodfparbox}[1]{%
+\newcommand*{\@dodfparbox}[1]{%
\expandafter\let\expandafter
\@ff@parshape\csname @df@shape@\romannumeral#1\endcsname
\expandafter\@ff@getshape\@ff@parshape\relax
@@ -1940,7 +2140,7 @@ adding new one}%
\ff@contents\par}}}%
\fi
}
-\newcommand{\@dodynamicbox}[1]{%
+\newcommand*{\@dodynamicbox}[1]{%
\edef\ff@frametype{%
\csname @df@frametype@\romannumeral#1\endcsname}%
\edef\ff@col{\csname @df@col@\romannumeral#1\endcsname}%
@@ -1960,7 +2160,7 @@ adding new one}%
\@ff@box{\@ff@tmp@x}{\@ff@tmp@y}{%
\@dodfparbox{#1}}%
}}}
-\newcommand{\@dodynamicbbox}[1]{%
+\newcommand*{\@dodynamicbbox}[1]{%
\edef\ff@col{}%
\@df@setoffset{#1}%
\expandafter\expandafter\expandafter
@@ -1971,7 +2171,7 @@ adding new one}%
\parbox\csname @df@dim@\romannumeral#1\endcsname
{}}%
}{D:\number#1;\csname @df@id@\romannumeral#1\endcsname}}
-\newcommand{\@putdynamicbox}[1]{%
+\newcommand*{\@putdynamicbox}[1]{%
\@df@chckifthispg{#1}%
\if@notthiscol\else
\@killglue
@@ -1994,7 +2194,7 @@ adding new one}%
\@dodynamicbox{#1}\hss}\ignorespaces
\fi
\fi}
-\newcommand{\@putdynamicbbox}[1]{%
+\newcommand*{\@putdynamicbbox}[1]{%
\@df@chckifthispg{#1}%
\if@notthiscol\else
\@killglue
@@ -2017,7 +2217,7 @@ adding new one}%
\@dodynamicbbox{#1}\hss}\ignorespaces
\fi
\fi}
-\newcommand{\@@doheader}{%
+\newcommand*{\@@doheader}{%
\setlength\@ff@tmp@y{\textheight}%
\addtolength{\@ff@tmp@y}{\headsep}%
\def\ff@col{}%
@@ -2025,7 +2225,7 @@ adding new one}%
\def\ff@backcol{{none}}%
\@ff@box{0pt}{\@ff@tmp@y}{\makebox[0pt][l]{\@dothehead}}%
}
-\newcommand{\@@dofooter}{%
+\newcommand*{\@@dofooter}{%
\setlength\@ff@tmp@y{-\footskip}%
\def\ff@col{}%
\def\ff@txtcol{}%
@@ -2039,43 +2239,49 @@ adding new one}%
\hss \egroup
\ht\@picbox\@picht \dp\@picbox
\z@ \mbox{\box \@picbox}}}
-\newcommand{\@ff@doallflowframes}{%
-\@colN=0\whiledo{\@colN<\c@maxflow}{\advance\@colN by 1\relax
+\newcommand*{\@ff@doallflowframes}{%
+\@colN=0\relax
+\whiledo{\@colN<\c@maxflow}{\advance\@colN by 1\relax
\@putcolbox{\@colN}}%
}
-\newcommand{\@ff@doallflowframesbbox}{%
-\@colN=0\whiledo{\@colN<\c@maxflow}{\advance\@colN by 1\relax
+\newcommand*{\@ff@doallflowframesbbox}{%
+\@colN=0\relax
+\whiledo{\@colN<\c@maxflow}{\advance\@colN by 1\relax
\@putcolbbox{\@colN}}%
}
-\newcommand{\@ff@doallstatics}{%
-\@colN=0\whiledo{\@colN<\c@maxstatic}{\advance\@colN by 1%
+\newcommand*{\@ff@doallstatics}{%
+\@colN=0\relax
+\whiledo{\@colN<\c@maxstatic}{\advance\@colN by 1\relax
\@putstaticbox{\@colN}}%
}
-\newcommand{\@ff@doallstaticsbbox}{%
-\@colN=0\whiledo{\@colN<\c@maxstatic}{\advance\@colN by 1%
+\newcommand*{\@ff@doallstaticsbbox}{%
+\@colN=0\relax
+\whiledo{\@colN<\c@maxstatic}{\advance\@colN by 1\relax
\@putstaticbbox{\@colN}}%
}
-\newcommand{\@ff@doalldynamics}{%
-\@colN=0\whiledo{\@colN<\c@maxdynamic}{\advance\@colN by 1%
+\newcommand*{\@ff@doalldynamics}{%
+\@colN=0\relax
+\whiledo{\@colN<\c@maxdynamic}{\advance\@colN by 1\relax
\@putdynamicbox{\@colN}}%
}
-\newcommand{\@ff@doalldynamicsbbox}{%
-\@colN=0\whiledo{\@colN<\c@maxdynamic}{\advance\@colN by 1%
+\newcommand*{\@ff@doalldynamicsbbox}{%
+\@colN=0\relax
+\whiledo{\@colN<\c@maxdynamic}{\advance\@colN by 1\relax
\@putdynamicbbox{\@colN}}%
}
-\newcommand{\@ff@dotypeblock}{%
+\newcommand*{\@ff@dotypeblock}{%
\makebox[0pt][l]{\@fr@meifdraft[\setffdrafttypeblockcolor]{%
\vbox to \textheight{\hbox to \textwidth{}}}{}}}
\newlength\ffevenoffset
-\newcommand{\@ff@do@allframes}{%
+\newcommand*{\@ff@do@allframes}{%
\ffevenoffset=0pt\relax
\if@twoside
-\ifodd\c@page
-\else
-\ffevenoffset=-\oddsidemargin\relax
-\advance\ffevenoffset by \evensidemargin\relax
-\kern\ffevenoffset\relax
-\fi
+ \ifodd\c@page
+ \else
+ \ffevenoffset=-\oddsidemargin\relax
+ \advance\ffevenoffset by \evensidemargin\relax
+ \kern\ffevenoffset\relax
+ \fi
\fi
\setlength{\@ff@tmp@x}{\textwidth}%
\advance\@ff@tmp@x by -\ffevenoffset\relax
@@ -2087,15 +2293,15 @@ adding new one}%
\@ff@doallflowframes
\@ff@doalldynamics
\ifshowtypeblock
-\@ff@dotypeblock
+ \@ff@dotypeblock
\fi
\ifshowframebbox
-\@ff@doallstaticsbbox
-\@ff@doallflowframesbbox
-\@ff@doalldynamicsbbox
+ \@ff@doallstaticsbbox
+ \@ff@doallflowframesbbox
+ \@ff@doalldynamicsbbox
\fi
\ifshowmargins
-\@ff@drawmargins
+ \@ff@drawmargins
\fi
}}}
\newcount\@nxtcol
@@ -2122,6 +2328,7 @@ adding new one}%
\let\@thehead\@oddhead
\let\@thefoot\@oddfoot
\fi
+ \@begindvi
\@dodynamicthehead\@dodynamicthefoot
\vbadness=\@M
\setbox\@outputbox\vbox{\hbox to \textwidth{\@ff@do@allframes}}%
@@ -2162,15 +2369,15 @@ adding new one}%
\newlength\columnheight
\newcommand*{\onecolumninarea}{\@onecolumninarea}
\@onlypreamble{\onecolumninarea}
-
\newcommand*{\@onecolumninarea}[5][all]{%
\setlength{\columnheight}{#3}%
\ifffvadjust\adjustheight{\columnheight}\fi%
\@n@wflowframe[#1]{#2}{\columnheight}{#4}{#5}}
-\renewcommand{\twocolumn}{\@twocolumn}
+\renewcommand*{\twocolumn}{\@twocolumn}
\newcommand*{\@twocolumn}[1][all]{%
\@twocolumninarea[#1]{\textwidth}{\textheight}{0pt}{0pt}}
-\newcommand{\twocolumninarea}{\@twocolumninarea}
+\newcommand*{\twocolumninarea}{\@twocolumninarea}
+\@onlypreamble{\twocolumninarea}
\newcommand*{\@twocolumninarea}[5][all]{%
\setlength{\columnheight}{#3}%
\ifffvadjust\adjustheight{\columnheight}\fi%
@@ -2185,72 +2392,71 @@ adding new one}%
\@n@wflowframe[#1]{\columnwidth}{\columnheight}{\@ff@tmp@x}{#5}%
\setflowframe{\c@maxflow}{margin=right}%
}
-\@onlypreamble{\twocolumninarea}
\newcommand*{\Ncolumn}[2][all]{%
\Ncolumninarea[#1]{#2}{\textwidth}{\textheight}{0pt}{0pt}}
\@onlypreamble{\Ncolumn}
-\newcommand{\Ncolumninarea}[6][all]{%
+\newcommand*{\Ncolumninarea}[6][all]{%
\ifnum#2>2\relax
-\@Ncolumninarea[#1]{#2}{#3}{#4}{#5}{#6}%
-\else
-\ifcase#2
-\PackageError{flowfram}{%
-You have requested 0 flowframes!}{%
-It does not make much sense to ask to create 0 flow frames}%
-\or
-\onecolumninarea[#1]{#3}{#4}{#5}{#6}%
-\or
-\twocolumninarea[#1]{#3}{#4}{#5}{#6}%
-\else
-\PackageError{flowfram}{%
-Can't create a negative number of flow frames!}{%
-You have asked for \number#2 \space flow frames
-which really doesn't make sense}%
-\fi
+ \@Ncolumninarea[#1]{#2}{#3}{#4}{#5}{#6}%
+\else
+ \ifcase#2\relax
+ \PackageError{flowfram}{%
+ You have requested 0 flowframes!}{%
+ It does not make much sense to ask to create 0 flow frames}%
+ \or
+ \onecolumninarea[#1]{#3}{#4}{#5}{#6}%
+ \or
+ \twocolumninarea[#1]{#3}{#4}{#5}{#6}%
+ \else
+ \PackageError{flowfram}{%
+ Can't create a negative number of flow frames!}{%
+ You have asked for \number#2 \space flow frames
+ which really doesn't make sense}%
+ \fi
\fi
}
\@onlypreamble{\Ncolumninarea}
-\newcommand{\@Ncolumninarea}[6][all]{%
+\newcommand*{\@Ncolumninarea}[6][all]{%
\@colN=#2\relax
\advance\@colN by -1\relax
\setlength{\columnwidth}{#3}%
\addtolength{\columnwidth}{-\@colN\columnsep}%
\divide\columnwidth by #2\relax
-\setlength{\@ff@tmp@x}{#5}
+\setlength{\@ff@tmp@x}{#5}%
\setlength{\columnheight}{#4}%
\ifffvadjust\adjustheight{\columnheight}\fi%
\@colN=0\relax
\loop
\advance\@colN by 1\relax
-\newflowframe[#1]{\columnwidth}{\columnheight}{\@ff@tmp@x}{#6}
-\addtolength{\@ff@tmp@x}{\columnwidth}
-\addtolength{\@ff@tmp@x}{\columnsep}
+\newflowframe[#1]{\columnwidth}{\columnheight}{\@ff@tmp@x}{#6}%
+\addtolength{\@ff@tmp@x}{\columnwidth}%
+\addtolength{\@ff@tmp@x}{\columnsep}%
\ifnum\@colN<#2
\repeat
}
\newlength{\vcolumnsep}
\setlength{\vcolumnsep}{\columnsep}
-\newcommand{\onecolumntop}[3][all]{%
+\newcommand*{\onecolumntop}[3][all]{%
\onecolumntopinarea[#1]{#2}{#3}{\textwidth}{\textheight}{0pt}{0pt}}
\@onlypreamble{\onecolumntop}
-\newcommand{\onecolumnStop}[2][all]{%
+\newcommand*{\onecolumnStop}[2][all]{%
\onecolumntopinarea[#1]{static}{#2}{\textwidth}{\textheight}{0pt}{0pt}}
-\newcommand{\onecolumnDtop}[2][all]{%
+\newcommand*{\onecolumnDtop}[2][all]{%
\onecolumntopinarea[#1]{dynamic}{#2}{\textwidth}{\textheight}{0pt}{0pt}}
-\newcommand{\newframe}[6][all]{%
+\newcommand*{\newframe}[6][all]{%
\ifthenelse{\equal{#2}{flow}}{%
\@n@wflowframe[#1]{#3}{#4}{#5}{#6}%
}{%
\ifthenelse{\equal{#2}{dynamic}}{%
-\newdynamicframe[#1]{#3}{#4}{#5}{#6}}{%
+\@n@wdynamicframe[#1]{#3}{#4}{#5}{#6}}{%
\ifthenelse{\equal{#2}{static}}{%
\@n@wstaticframe[#1]{#3}{#4}{#5}{#6}}{%
\PackageError{flowfram}{Unknown frame type '#2'}{%
Available frame types are: 'flow', 'static' and 'dynamic'}}}}}
\newlength\@ff@staticH
-\newcommand{\onecolumntopinarea}[7][all]{%
+\newcommand*{\onecolumntopinarea}[7][all]{%
\setlength{\@ff@staticH}{#3}%
\setlength{\@ff@tmp@y}{#5}%
\addtolength{\@ff@tmp@y}{-\@ff@staticH}%
@@ -2263,26 +2469,26 @@ Available frame types are: 'flow', 'static' and 'dynamic'}}}}}
}
\@onlypreamble{\onecolumntopinarea}
-\newcommand{\onecolumnStopinarea}[6][all]{%
+\newcommand*{\onecolumnStopinarea}[6][all]{%
\onecolumntopinarea[#1]{static}{#2}{#3}{#4}{#5}{#6}}
-\newcommand{\onecolumnDtopinarea}[6][all]{%
+\newcommand*{\onecolumnDtopinarea}[6][all]{%
\onecolumntopinarea[#1]{dynamic}{#2}{#3}{#4}{#5}{#6}}
-\newcommand{\twocolumntop}[3][all]{%
+\newcommand*{\twocolumntop}[3][all]{%
\twocolumntopinarea[#1]{#2}{#3}{\textwidth}{\textheight}{0pt}{0pt}}
\@onlypreamble{\twocolumntop}
-\newcommand{\twocolumnStop}[2][all]{%
+\newcommand*{\twocolumnStop}[2][all]{%
\@twocolumntopinarea[#1]{static}{#2}{\textwidth}{\textheight}{0pt}{0pt}}
-\newcommand{\twocolumnDtop}[2][all]{%
+\newcommand*{\twocolumnDtop}[2][all]{%
\twocolumntop[#1]{dynamic}{#2}}
-\newcommand{\twocolumntopinarea}{\@twocolumntopinarea}
-\newcommand{\@twocolumntopinarea}[7][all]{%
+\newcommand*{\twocolumntopinarea}{\@twocolumntopinarea}
+\newcommand*{\@twocolumntopinarea}[7][all]{%
\setlength{\@ff@staticH}{#3}%
-\setlength{\@ff@tmp@y}{#5}
-\addtolength{\@ff@tmp@y}{-\@ff@staticH}
+\setlength{\@ff@tmp@y}{#5}%
+\addtolength{\@ff@tmp@y}{-\@ff@staticH}%
\setlength{\columnheight}{\@ff@tmp@y}%
\addtolength{\@ff@tmp@y}{#7}%
\newframe[#1]{#2}{#4}{\@ff@staticH}{#6}{\@ff@tmp@y}%
-\addtolength{\columnheight}{-\vcolumnsep}
+\addtolength{\columnheight}{-\vcolumnsep}%
\ifffvadjust\adjustheight{\columnheight}\fi%
\setlength{\columnwidth}{#4}%
\addtolength{\columnwidth}{-\columnsep}%
@@ -2296,39 +2502,39 @@ Available frame types are: 'flow', 'static' and 'dynamic'}}}}}
\setflowframe{\c@maxflow}{margin=right}%
}
\@onlypreamble{\twocolumntopinarea}
-\newcommand{\twocolumnStopinarea}[6][all]{%
+\newcommand*{\twocolumnStopinarea}[6][all]{%
\twocolumntopinarea[#1]{static}{#2}{#3}{#4}{#5}{#6}}
-\newcommand{\twocolumnDtopinarea}[6][all]{%
+\newcommand*{\twocolumnDtopinarea}[6][all]{%
\twocolumntopinarea[#1]{dynamic}{#2}{#3}{#4}{#5}{#6}}
-\newcommand{\Ncolumntop}[4][all]{%
+\newcommand*{\Ncolumntop}[4][all]{%
\Ncolumntopinarea[#1]{#2}{#3}{#4}{\textwidth}{\textheight}{0pt}{0pt}}
\@onlypreamble{\Ncolumntop}
-\newcommand{\NcolumnStop}[3][all]{%
+\newcommand*{\NcolumnStop}[3][all]{%
\Ncolumntop[#1]{static}{#2}{#3}}
-\newcommand{\NcolumnDtop}[3][all]{%
+\newcommand*{\NcolumnDtop}[3][all]{%
\Ncolumntop[#1]{dynamic}{#2}{#3}}
-\newcommand{\Ncolumntopinarea}[8][all]{%
+\newcommand*{\Ncolumntopinarea}[8][all]{%
\ifnum#3>2\relax
-\@Ncolumntopinarea[#1]{#2}{#3}{#4}{#5}{#6}{#7}{#8}%
-\else
-\ifcase#3
-\PackageError{flowfram}{%
-You have requested 0 flowframes!}{%
-It does not make much sense to ask to create 0 flow frames}
-\or
-\onecolumntopinarea[#1]{#2}{#4}{#5}{#6}{#7}{#8}%
-\or
-\twocolumntopinarea[#1]{#2}{#4}{#5}{#6}{#7}{#8}%
-\else
-\PackageError{flowfram}{%
-Can't create a negative number of flow frames!}{%
-You have asked for \number#3 \space flow frames
-which really doesn't make sense}%
-\fi
+ \@Ncolumntopinarea[#1]{#2}{#3}{#4}{#5}{#6}{#7}{#8}%
+\else
+ \ifcase#3\relax
+ \PackageError{flowfram}{%
+ You have requested 0 flowframes!}{%
+ It does not make much sense to ask to create 0 flow frames}
+ \or
+ \onecolumntopinarea[#1]{#2}{#4}{#5}{#6}{#7}{#8}%
+ \or
+ \twocolumntopinarea[#1]{#2}{#4}{#5}{#6}{#7}{#8}%
+ \else
+ \PackageError{flowfram}{%
+ Can't create a negative number of flow frames!}{%
+ You have asked for \number#3 \space flow frames
+ which really doesn't make sense}%
+ \fi
\fi
}
\@onlypreamble{\Ncolumntopinarea}
-\newcommand{\@Ncolumntopinarea}[8][all]{%
+\newcommand*{\@Ncolumntopinarea}[8][all]{%
\setlength{\@ff@staticH}{#4}%
\setlength{\@ff@tmp@y}{#6}%
\addtolength{\@ff@tmp@y}{-\@ff@staticH}%
@@ -2352,18 +2558,18 @@ which really doesn't make sense}%
\ifnum\@colN<#3
\repeat
}
-\newcommand{\NcolumnStopinarea}[7][all]{%
+\newcommand*{\NcolumnStopinarea}[7][all]{%
\Ncolumntopinarea[#1]{static}{#2}{#3}{#4}{#5}{#6}{#7}}
-\newcommand{\NcolumnDtopinarea}[7][all]{%
+\newcommand*{\NcolumnDtopinarea}[7][all]{%
\Ncolumntopinarea[#1]{dynamic}{#2}{#3}{#4}{#5}{#6}{#7}}
-\newcommand{\onecolumnbottom}[3][all]{%
+\newcommand*{\onecolumnbottom}[3][all]{%
\onecolumnSbottominarea[#1]{#2}{#3}{\textwidth}{\textheight}{0pt}{0pt}}
\@onlypreamble{\onecolumnbottom}
-\newcommand{\onecolumnSbottom}[2][all]{%
+\newcommand*{\onecolumnSbottom}[2][all]{%
\onecolumnbottom[#1]{static}{#2}}
-\newcommand{\onecolumnDbottom}[2][all]{%
+\newcommand*{\onecolumnDbottom}[2][all]{%
\onecolumnbottom[#1]{dynamic}{#2}}
-\newcommand{\onecolumnbottominarea}[7][all]{%
+\newcommand*{\onecolumnbottominarea}[7][all]{%
\setlength{\@ff@staticH}{#3}%
\setlength{\columnheight}{#5}%
\addtolength{\columnheight}{-\@ff@staticH}%
@@ -2376,23 +2582,23 @@ which really doesn't make sense}%
\newflowframe[#1]{#4}{\columnheight}{#6}{\@ff@tmp@y}%
}
\@onlypreamble{\onecolumnbottominarea}
-\newcommand{\onecolumnSbottominarea}[6][all]{%
+\newcommand*{\onecolumnSbottominarea}[6][all]{%
\onecolumnbottominarea[#1]{static}{#2}{#3}{#4}{#5}{#6}}
-\newcommand{\onecolumnDbottominarea}[6][all]{%
+\newcommand*{\onecolumnDbottominarea}[6][all]{%
\onecolumnbottominarea[#1]{dynamic}{#2}{#3}{#4}{#5}{#6}}
-\newcommand{\twocolumnbottom}[3][all]{%
+\newcommand*{\twocolumnbottom}[3][all]{%
\twocolumnSbottominarea[#1]{#2}{#3}{\textwidth}{\textheight}{0pt}{0pt}}
\@onlypreamble{\twocolumnbottom}
-\newcommand{\twocolumnSbottom}[2][all]{%
+\newcommand*{\twocolumnSbottom}[2][all]{%
\twocolumnbottom[#1]{static}{#2}}
-\newcommand{\twocolumnDbottom}[2][all]{%
+\newcommand*{\twocolumnDbottom}[2][all]{%
\twocolumnbottom[#1]{dynamic}{#2}}
-\newcommand{\twocolumnbottominarea}[7][all]{%
+\newcommand*{\twocolumnbottominarea}[7][all]{%
\setlength{\@ff@staticW}{#4}%
\setlength{\@ff@staticH}{#3}%
-\setlength{\columnheight}{#5}
-\addtolength{\columnheight}{-\@ff@staticH}
-\addtolength{\columnheight}{-\vcolumnsep}
+\setlength{\columnheight}{#5}%
+\addtolength{\columnheight}{-\@ff@staticH}%
+\addtolength{\columnheight}{-\vcolumnsep}%
\ifffvadjust\adjustheight{\columnheight}\fi%
\newframe[#1]{#2}{\@ff@staticW}{\@ff@staticH}{#6}{#7}%
\setlength{\@ff@tmp@y}{#5}%
@@ -2410,44 +2616,44 @@ which really doesn't make sense}%
\setflowframe{\c@maxflow}{margin=right}%
}
\@onlypreamble{\twocolumnbottominarea}
-\newcommand{\twocolumnSbottominarea}[6][all]{%
+\newcommand*{\twocolumnSbottominarea}[6][all]{%
\twocolumnbottominarea[#1]{static}{#2}{#3}{#4}{#5}{#6}}
-\newcommand{\twocolumnDbottominarea}[6][all]{%
+\newcommand*{\twocolumnDbottominarea}[6][all]{%
\twocolumnbottominarea[#1]{dynamic}{#2}{#3}{#4}{#5}{#6}}
-\newcommand{\Ncolumnbottom}[4][all]{%
+\newcommand*{\Ncolumnbottom}[4][all]{%
\Ncolumnbottominarea[#1]{#2}{#3}{#4}{\textwidth}{\textheight}{0pt}{0pt}}
\@onlypreamble{\Ncolumnbottom}
-\newcommand{\NcolumnSbottom}[3][all]{%
+\newcommand*{\NcolumnSbottom}[3][all]{%
\Ncolumnbottom[#1]{static}{#2}{#3}}
-\newcommand{\NcolumnDbottom}[3][all]{%
+\newcommand*{\NcolumnDbottom}[3][all]{%
\Ncolumnbottom[#1]{dynamic}{#2}{#3}}
-\newcommand{\Ncolumnbottominarea}[8][all]{%
+\newcommand*{\Ncolumnbottominarea}[8][all]{%
\ifnum#3>2\relax
-\@Ncolumnbottominarea[#1]{#2}{#3}{#4}{#5}{#6}{#7}{#8}%
-\else
-\ifcase#3
-\PackageError{flowfram}{%
-You have requested 0 flowframes!}{%
-It does not make much sense to ask to create 0 flow frames}
-\or
-\onecolumnbottominarea[#1]{#2}{#4}{#5}{#6}{#7}{#8}%
-\or
-\twocolumnbottominarea[#1]{#2}{#4}{#5}{#6}{#7}{#8}%
-\else
-\PackageError{flowfram}{%
-Can't create a negative number of flow frames!}{%
-You have asked for \number#3 \space flow frames
-which really doesn't make sense}%
-\fi
+ \@Ncolumnbottominarea[#1]{#2}{#3}{#4}{#5}{#6}{#7}{#8}%
+\else
+ \ifcase#3\relax
+ \PackageError{flowfram}{%
+ You have requested 0 flowframes!}{%
+ It does not make much sense to ask to create 0 flow frames}
+ \or
+ \onecolumnbottominarea[#1]{#2}{#4}{#5}{#6}{#7}{#8}%
+ \or
+ \twocolumnbottominarea[#1]{#2}{#4}{#5}{#6}{#7}{#8}%
+ \else
+ \PackageError{flowfram}{%
+ Can't create a negative number of flow frames!}{%
+ You have asked for \number#3 \space flow frames
+ which really doesn't make sense}%
+ \fi
\fi
}
\@onlypreamble{\Ncolumnbottominarea}
-\newcommand{\@NcolumnSbottominarea}[8][all]{%
+\newcommand*{\@NcolumnSbottominarea}[8][all]{%
\setlength{\@ff@staticH}{#4}%
\setlength{\columnheight}{#6}%
\addtolength{\columnheight}{-\@ff@staticH}%
\addtolength{\columnheight}{-\vcolumnsep}%
-\ifffvadjust\adjustheight{\columnheight}\fi%
+\ifffvadjust\adjustheight{\columnheight}\fi
\newframe[#1]{#2}{#5}{\@ff@staticH}{#7}{#8}%
\setlength{\@ff@tmp@y}{#6}%
\addtolength{\@ff@tmp@y}{-\columnheight}%
@@ -2467,30 +2673,31 @@ which really doesn't make sense}%
\ifnum\@colN<#3
\repeat
}
-\newcommand{\NcolumnSbottominarea}[1][all]{%
+\newcommand*{\NcolumnSbottominarea}[1][all]{%
\Ncolumnbottominarea[#1]{static}}
-\newcommand{\NcolumnDbottominarea}[1][all]{%
+\newcommand*{\NcolumnDbottominarea}[1][all]{%
\Ncolumnbottominarea[#1]{dynamic}}
\newcount\@ff@adjh
-\newcommand{\adjustheight}[1]{%
+\newcommand*{\adjustheight}[1]{%
\@ff@adjh=#1\relax
-\divide\@ff@adjh by \baselineskip
-#1=\baselineskip
-\multiply#1 by \@ff@adjh}
-\newcommand{\adjustcolsep}{%
+\divide\@ff@adjh by \baselineskip\relax
+#1=\baselineskip\relax
+\multiply#1 by \@ff@adjh\relax
+}
+\newcommand*{\adjustcolsep}{%
\multiply\columnsep by 2\relax
\addtolength{\columnsep}{\marginparwidth}}
\newlength\@ff@staticW
-\newcommand{\vtwotone}[1][all]{%
+\newcommand*{\vtwotone}[1][all]{%
\def\ff@pages{#1}\@vtwotone}
-\newcommand{\@vtwotone}[1][0pt]{\@@vtwotonebottom{#1}{\paperheight}}
-\newcommand{\@@vtwotonebottom}[8]{%
+\newcommand*{\@vtwotone}[1][0pt]{\@@vtwotonebottom{#1}{\paperheight}}
+\newcommand*{\@@vtwotonebottom}[8]{%
\computeleftedgeodd{\@ff@tmp@x}%
\if@twoside
-\computeleftedgeeven{\@ff@tmp@x@even}%
+ \computeleftedgeeven{\@ff@tmp@x@even}%
\else
-\setlength{\@ff@tmp@x@even}{\@ff@tmp@x}%
+ \setlength{\@ff@tmp@x@even}{\@ff@tmp@x}%
\fi
\computebottomedge{\@ff@tmp@y}%
\addtolength{\@ff@tmp@x}{#1}%
@@ -2500,23 +2707,23 @@ which really doesn't make sense}%
}
\@onlypreamble{\vtwotone}
-\newcommand{\vtwotonebottom}[1][all]{%
+\newcommand*{\vtwotonebottom}[1][all]{%
\def\ff@pages{#1}\@vtwotonebottom}
\@onlypreamble{\vtwotonebottom}
-\newcommand{\@vtwotonebottom}[2][0pt]{\@@vtwotonebottom{#1}{#2}}
-\newcommand{\vtwotonetop}[1][all]{%
+\newcommand*{\@vtwotonebottom}[2][0pt]{\@@vtwotonebottom{#1}{#2}}
+\newcommand*{\vtwotonetop}[1][all]{%
\def\ff@pages{#1}\@vtwotonetop}
-\newcommand{\@vtwotonetop}[2][0pt]{\@@vtwotonetop{#1}{#2}}
+\newcommand*{\@vtwotonetop}[2][0pt]{\@@vtwotonetop{#1}{#2}}
-\newcommand{\@@vtwotonetop}[8]{%
+\newcommand*{\@@vtwotonetop}[8]{%
\computeleftedgeodd{\@ff@tmp@x}%
\if@twoside
-\computeleftedgeeven{\@ff@tmp@x@even}%
+ \computeleftedgeeven{\@ff@tmp@x@even}%
\else
-\setlength{\@ff@tmp@x@even}{\@ff@tmp@x}%
+ \setlength{\@ff@tmp@x@even}{\@ff@tmp@x}%
\fi
\computetopedge{\@ff@tmp@y}%
\addtolength{\@ff@tmp@y}{-#2}%
@@ -2525,27 +2732,29 @@ which really doesn't make sense}%
\@nextvband{\ff@pages}{#2}{#3}{#4}{#5}%
\@nextvband{\ff@pages}{#2}{#6}{#7}{#8}%
}
-\newcommand{\@nextvband}[5]{%
+\newcommand*{\@nextvband}[5]{%
\setlength{\@ff@staticW}{#3}%
\ifthenelse{\equal{#5}{}}{%
\newstaticframe[#1]{\@ff@staticW}{#2}{\@ff@tmp@x}{\@ff@tmp@y}}%
{\newstaticframe[#1]{\@ff@staticW}{#2}{\@ff@tmp@x}{\@ff@tmp@y}[#5]}%
-\expandafter\global\expandafter\setlength\csname @sf@\romannumeral\c@maxstatic @evenx\endcsname{\@ff@tmp@x@even}%
+\expandafter\global\expandafter\setlength
+ \csname @sf@\romannumeral\c@maxstatic @evenx\endcsname{%
+ \@ff@tmp@x@even}%
\@setframecol#4\end{\c@maxstatic}{backcol}{sf}%
\addtolength{\@ff@tmp@x}{\@ff@staticW}%
\addtolength{\@ff@tmp@x@even}{\@ff@staticW}%
}
\newcount\@thisstrip
-\newcommand{\vNtone}[1][all]{%
+\newcommand*{\vNtone}[1][all]{%
\def\ff@pages{#1}\@vNtone}
-\newcommand{\@vNtone}[2][0pt]{%
+\newcommand*{\@vNtone}[2][0pt]{%
\@@vNtone{#1}{#2}{\paperheight}}
-\newcommand{\@@vNtone}[3]{%
+\newcommand*{\@@vNtone}[3]{%
\computeleftedgeodd{\@ff@tmp@x}%
\if@twoside
-\computeleftedgeeven{\@ff@tmp@x@even}%
+ \computeleftedgeeven{\@ff@tmp@x@even}%
\else
-\setlength{\@ff@tmp@x@even}{\@ff@tmp@x}%
+ \setlength{\@ff@tmp@x@even}{\@ff@tmp@x}%
\fi
\computebottomedge{\@ff@tmp@y}%
\addtolength{\@ff@tmp@x}{#1}%
@@ -2554,37 +2763,34 @@ which really doesn't make sense}%
\setlength{\@ff@staticH}{#3}%
\@nextvNband%
}
-\newcommand{\@nextvNband}{%
+\newcommand*{\@nextvNband}{%
\ifnum\@thisstrip>0\relax
- \let\next\@@nextvNband%
+ \let\flf@next\@@nextvNband
\else
- \let\next\relax%
+ \let\flf@next\relax
\fi
\advance\@thisstrip by -1\relax
-\next}
-\newcommand{\@@nextvNband}[3]{%
+\flf@next}
+\newcommand*{\@@nextvNband}[3]{%
\@nextvband{\ff@pages}{\@ff@staticH}{#1}{#2}{#3}\@nextvNband}
\@onlypreamble{\vNtone}
-\newcommand{\vNtonebottom}[1][all]{%
+\newcommand*{\vNtonebottom}[1][all]{%
\def\ff@pages{#1}\@vNtonebottom}
-
\@onlypreamble{\vNtonebottom}
-
-\newcommand{\@vNtonebottom}[3][0pt]{%
+\newcommand*{\@vNtonebottom}[3][0pt]{%
\@@vNtone{#1}{#2}{#3}}
-\newcommand{\vNtonetop}[1][all]{%
+\newcommand*{\vNtonetop}[1][all]{%
\def\ff@pages{#1}\@vNtonetop}
-
\@onlypreamble{\vNtonetop}
-\newcommand{\@vNtonetop}[3][0pt]{%
+\newcommand*{\@vNtonetop}[3][0pt]{%
\@@vNtonetop{#1}{#2}{#3}}
-\newcommand{\@@vNtonetop}[3]{%
+\newcommand*{\@@vNtonetop}[3]{%
\computeleftedgeodd{\@ff@tmp@x}%
\if@twoside
-\computeleftedgeeven{\@ff@tmp@x@even}%
+ \computeleftedgeeven{\@ff@tmp@x@even}%
\else
-\setlength{\@ff@tmp@x@even}{\@ff@tmp@x}%
+ \setlength{\@ff@tmp@x@even}{\@ff@tmp@x}%
\fi
\computetopedge{\@ff@tmp@y}%
\addtolength{\@ff@tmp@y}{-#3}%
@@ -2594,16 +2800,15 @@ which really doesn't make sense}%
\setlength{\@ff@staticH}{#3}%
\@nextvNband%
}
-\newcommand{\htwotone}[1][all]{%
+\newcommand*{\htwotone}[1][all]{%
\def\ff@pages{#1}\@htwotone}
-
-\newcommand{\@htwotone}[1][0pt]{\@@htwotoneleft{#1}{\paperwidth}}
-\newcommand{\@@htwotoneleft}[8]{%
+\newcommand*{\@htwotone}[1][0pt]{\@@htwotoneleft{#1}{\paperwidth}}
+\newcommand*{\@@htwotoneleft}[8]{%
\computeleftedgeodd{\@ff@tmp@x}%
\if@twoside
-\computeleftedgeeven{\@ff@tmp@x@even}%
+ \computeleftedgeeven{\@ff@tmp@x@even}%
\else
-\setlength{\@ff@tmp@x@even}{\@ff@tmp@x}%
+ \setlength{\@ff@tmp@x@even}{\@ff@tmp@x}%
\fi
\computebottomedge{\@ff@tmp@y}%
\addtolength{\@ff@tmp@y}{#1}%
@@ -2612,23 +2817,20 @@ which really doesn't make sense}%
}
\@onlypreamble{\htwotone}
-\newcommand{\htwotoneleft}[1][all]{%
+\newcommand*{\htwotoneleft}[1][all]{%
\def\ff@pages{#1}\@htwotoneleft}
-
-\newcommand{\@htwotoneleft}[2][0pt]{\@@htwotoneleft{#1}{#2}}
-
\@onlypreamble{\htwotoneleft}
-\newcommand{\htwotoneright}[1][all]{%
+\newcommand*{\@htwotoneleft}[2][0pt]{\@@htwotoneleft{#1}{#2}}
+\newcommand*{\htwotoneright}[1][all]{%
\def\ff@pages{#1}\@htwotoneright}
-
-\newcommand{\@htwotoneright}[2][0pt]{\@@htwotoneright{#1}{#2}}
-
-\newcommand{\@@htwotoneright}[8]{%
+\@onlypreamble{\htwotoneright}
+\newcommand*{\@htwotoneright}[2][0pt]{\@@htwotoneright{#1}{#2}}
+\newcommand*{\@@htwotoneright}[8]{%
\computerightedgeodd{\@ff@tmp@x}%
\if@twoside
-\computerightedgeeven{\@ff@tmp@x@even}%
+ \computerightedgeeven{\@ff@tmp@x@even}%
\else
-\setlength{\@ff@tmp@x@even}{\@ff@tmp@x}%
+ \setlength{\@ff@tmp@x@even}{\@ff@tmp@x}%
\fi
\computebottomedge{\@ff@tmp@y}%
\addtolength{\@ff@tmp@y}{#1}%
@@ -2637,20 +2839,17 @@ which really doesn't make sense}%
\@nexthband{\ff@pages}{#2}{#3}{#4}{#5}%
\@nexthband{\ff@pages}{#2}{#6}{#7}{#8}%
}
-
-\@onlypreamble{\htwotoneright}
-\newcommand{\hNtone}[1][all]{%
+\newcommand*{\hNtone}[1][all]{%
\def\ff@pages{#1}\@hNtone}
-
-\newcommand{\@hNtone}[2][0pt]{%
+\@onlypreamble{\hNtone}
+\newcommand*{\@hNtone}[2][0pt]{%
\@@hNtone{#1}{#2}{\paperwidth}}
-
-\newcommand{\@@hNtone}[3]{%
+\newcommand*{\@@hNtone}[3]{%
\computeleftedgeodd{\@ff@tmp@x}%
\if@twoside
-\computeleftedgeeven{\@ff@tmp@x@even}%
+ \computeleftedgeeven{\@ff@tmp@x@even}%
\else
-\setlength{\@ff@tmp@x@even}{\@ff@tmp@x}%
+ \setlength{\@ff@tmp@x@even}{\@ff@tmp@x}%
\fi
\computebottomedge{\@ff@tmp@y}%
\addtolength{\@ff@tmp@y}{#1}%
@@ -2658,29 +2857,22 @@ which really doesn't make sense}%
\setlength{\@ff@staticW}{#3}%
\@nexthNband%
}
-
-\@onlypreamble{\hNtone}
-\newcommand{\hNtoneleft}[1][all]{%
+\newcommand*{\hNtoneleft}[1][all]{%
\def\ff@pages{#1}\@hNtoneleft}
-
\@onlypreamble{\hNtoneleft}
-
-\newcommand{\@hNtoneleft}[3][0pt]{%
+\newcommand*{\@hNtoneleft}[3][0pt]{%
\@@hNtone{#1}{#2}{#3}}
-\newcommand{\hNtoneright}[1][all]{%
+\newcommand*{\hNtoneright}[1][all]{%
\def\ff@pages{#1}\@hNtoneright}
-
\@onlypreamble{\hNtoneright}
-
-\newcommand{\@hNtoneright}[3][0pt]{%
+\newcommand*{\@hNtoneright}[3][0pt]{%
\@@hNtoneright{#1}{#2}{#3}}
-
-\newcommand{\@@hNtoneright}[3]{%
+\newcommand*{\@@hNtoneright}[3]{%
\computerightedgeodd{\@ff@tmp@x}%
\if@twoside
-\computerightedgeeven{\@ff@tmp@x@even}%
+ \computerightedgeeven{\@ff@tmp@x@even}%
\else
-\setlength{\@ff@tmp@x@even}{\@ff@tmp@x}%
+ \setlength{\@ff@tmp@x@even}{\@ff@tmp@x}%
\fi
\computebottomedge{\@ff@tmp@y}%
\addtolength{\@ff@tmp@y}{#1}%
@@ -2690,7 +2882,7 @@ which really doesn't make sense}%
\setlength{\@ff@staticW}{#3}%
\@nexthNband%
}
-\newcommand{\@nexthband}[5]{%
+\newcommand*{\@nexthband}[5]{%
\setlength{\@ff@staticH}{#3}%
\ifthenelse{\equal{#5}{}}{%
\newstaticframe[#1]{#2}{\@ff@staticH}{\@ff@tmp@x}{\@ff@tmp@y}}%
@@ -2701,28 +2893,27 @@ which really doesn't make sense}%
\@setframecol#4\end{\c@maxstatic}{backcol}{sf}%
\addtolength{\@ff@tmp@y}{\@ff@staticH}%
}
-\newcommand{\@nexthNband}{%
+\newcommand*{\@nexthNband}{%
\ifnum\@thisstrip>0\relax
- \let\next\@@nexthNband%
+ \let\flf@next\@@nexthNband%
\else
- \let\next\relax%
+ \let\flf@next\relax%
\fi
\advance\@thisstrip by -1\relax
-\next}
-
-\newcommand{\@@nexthNband}[3]{%
+\flf@next}
+\newcommand*{\@@nexthNband}[3]{%
\@nexthband{\ff@pages}{\@ff@staticW}{#1}{#2}{#3}\@nexthNband}
-\newcommand{\makebackgroundframe}[1][all]{%
+\newcommand*{\makebackgroundframe}[1][all]{%
\ifnum\c@maxstatic>0\relax
-\PackageWarning{flowfram}{Background frame is not
-first static frame to be defined. All previously defined
-static frames may be obscured.}%
+ \PackageWarning{flowfram}{Background frame is not
+ first static frame to be defined. All previously defined
+ static frames may be obscured.}%
\fi
\computeleftedgeodd{\@ff@tmp@x}%
\if@twoside
-\computeleftedgeeven{\@ff@tmp@x@even}%
+ \computeleftedgeeven{\@ff@tmp@x@even}%
\else
-\setlength{\@ff@tmp@x@even}{\@ff@tmp@x}%
+ \setlength{\@ff@tmp@x@even}{\@ff@tmp@x}%
\fi
\computebottomedge{\@ff@tmp@y}%
\newstaticframe[#1]{\paperwidth}{\paperheight}{\@ff@tmp@x}%
@@ -2730,9 +2921,10 @@ static frames may be obscured.}%
\expandafter\global\expandafter
\setlength\csname @sf@\romannumeral\c@maxstatic @evenx\endcsname
{\@ff@tmp@x@even}}
-\setlength{\columnseprule}{2pt}
-\newcommand{\insertvrule}{\@ifstar\@sinsertvrule\@insertvrule}
-\newcommand{\@insertvrule}[1][0pt]{%
+\newlength\ffcolumnseprule
+\setlength{\ffcolumnseprule}{2pt}
+\newcommand*{\insertvrule}{\@ifstar\@sinsertvrule\@insertvrule}
+\newcommand*{\@insertvrule}[1][0pt]{%
\@ifnextchar[{\@@insertvrule[#1]}{\@@insertvrule[#1][0pt]}}
\newlength\@ff@left@x
\newlength\@ff@left@y
@@ -2755,20 +2947,20 @@ type '#5'}{Available frame types are: 'flow', 'static'
or 'dynamic'}}}}%
\@@insert@vrule{#1}{#2}{\@ff@type@i}{#4}{\@ff@type@ii}{#6}%
}
-\newcommand{\@@insert@vrule}[6]{
+\newcommand*{\@@insert@vrule}[6]{%
\@ff@getdim{#3}{#4}%
\setlength{\@ff@left@x}{\ffareax}%
\setlength{\@ff@left@y}{\ffareay}%
\setlength{\@ff@left@width}{\ffareawidth}%
\setlength{\@ff@left@height}{\ffareaheight}%
\@ff@getdim{#5}{#6}%
-\ifnum\@ff@left@x>\ffareax
-\@ff@swaplen{\@ff@left@x}{\ffareax}%
-\@ff@swaplen{\@ff@left@y}{\ffareax}%
-\@ff@swaplen{\@ff@left@evenx}{\ffareaevenx}%
-\@ff@swaplen{\@ff@left@eveny}{\ffareaevenx}%
-\@ff@swaplen{\@ff@left@width}{\ffareawidth}%
-\@ff@swaplen{\@ff@left@height}{\ffareaheight}%
+\ifnum\@ff@left@x>\ffareax\relax
+ \@ff@swaplen{\@ff@left@x}{\ffareax}%
+ \@ff@swaplen{\@ff@left@y}{\ffareax}%
+ \@ff@swaplen{\@ff@left@evenx}{\ffareaevenx}%
+ \@ff@swaplen{\@ff@left@eveny}{\ffareaevenx}%
+ \@ff@swaplen{\@ff@left@width}{\ffareawidth}%
+ \@ff@swaplen{\@ff@left@height}{\ffareaheight}%
\fi
\setlength{\@ff@tmp@x}{\@ff@left@x}
\addtolength{\@ff@tmp@x}{\@ff@left@width}%
@@ -2779,12 +2971,12 @@ or 'dynamic'}}}}%
\setlength{\@ff@tmp@y}{\ffareay}%
\addtolength{\@ff@tmp@y}{\ffareaheight}%
\ifnum\@ff@tmp@y>\@ff@staticH
-\setlength{\@ff@staticH}{\@ff@tmp@y}%
+ \setlength{\@ff@staticH}{\@ff@tmp@y}%
\fi
-\ifnum\@ff@left@y<\ffareay
-\setlength{\@ff@tmp@y}{\@ff@left@y}%
+\ifnum\@ff@left@y<\ffareay\relax
+ \setlength{\@ff@tmp@y}{\@ff@left@y}%
\else
-\setlength{\@ff@tmp@y}{\ffareay}%
+ \setlength{\@ff@tmp@y}{\ffareay}%
\fi
\addtolength{\@ff@staticH}{-\@ff@tmp@y}%
\newstaticframe{\@ff@staticW}{\@ff@staticH}%
@@ -2792,73 +2984,20 @@ or 'dynamic'}}}}%
\addtolength{\@ff@staticH}{#1}%
\addtolength{\@ff@staticH}{#2}%
\setstaticcontents{\c@maxstatic}{\hfill
-\rule[-#2]{\columnseprule}{\@ff@staticH}\hfill\mbox{}}
-\ifcase#3
-\or \edef\@ff@pages{\csname @ff@pages@\romannumeral#4\endcsname}
-\or \edef\@ff@pages{\csname @sf@pages@\romannumeral#4\endcsname}
-\or \edef\@ff@pages{\csname @df@pages@\romannumeral#4\endcsname}
+\rule[-#2]{\ffcolumnseprule}{\@ff@staticH}\hfill\mbox{}}%
+\ifcase#3\relax
+\or \edef\@ff@pages{\csname @ff@pages@\romannumeral#4\endcsname}%
+\or \edef\@ff@pages{\csname @sf@pages@\romannumeral#4\endcsname}%
+\or \edef\@ff@pages{\csname @df@pages@\romannumeral#4\endcsname}%
\fi
\setstaticframe{\c@maxstatic}{pages=\@ff@pages}%
-\addtolength{\@ff@tmp@x}{\@ff@left@evenx}
-\addtolength{\@ff@tmp@x}{-\@ff@left@x}
-\addtolength{\@ff@tmp@y}{\@ff@left@eveny}
-\addtolength{\@ff@tmp@y}{-\@ff@left@y}
+\addtolength{\@ff@tmp@x}{\@ff@left@evenx}%
+\addtolength{\@ff@tmp@x}{-\@ff@left@x}%
+\addtolength{\@ff@tmp@y}{\@ff@left@eveny}%
+\addtolength{\@ff@tmp@y}{-\@ff@left@y}%
\setstaticframe{\c@maxstatic}{evenx=\@ff@tmp@x,eveny=\@ff@tmp@y}%
}
-\newcommand{\@ff@swaplen}[2]{%
-\setlength{\@ff@tmp@x}{#1}%
-\setlength{#1}{#2}%
-\setlength{#2}{\@ff@tmp@x}}
-\newcommand{\@ff@getdim}[2]{%
-\ifnum#2<1\relax
-\PackageError{flowfram}{Frame IDNs start from 1}{%
-You have specified a frame IDN of '\number#2'}%
-\fi
-\ifcase#1
-\PackageError{flowfram}{Unknown frame ID type '#1'}{%
-Frame ID types are: 1 (flow), 2 (static) and 3 (dynamic)}
-\or
-\ifnum#2>\c@maxflow
-\PackageError{flowfram}{Invalid flow frame IDN '\number#2'}{%
-Flow frame IDNs go from 1 to \number\c@maxflow}
-\else
-\setlength{\ffareax}{\flowframex{#2}}
-\setlength{\ffareay}{\flowframey{#2}}
-\setlength{\ffareawidth}{\flowframewidth{#2}}
-\setlength{\ffareaheight}{\flowframeheight{#2}}
-\fi
-\or
-\ifnum#2>\c@maxstatic
-\PackageError{flowfram}{Invalid static frame IDN '\number#2'}{%
-Static frame IDNs go from 1 to \number\c@maxstatic}
-\else
-\setlength{\ffareax}{\staticframex{#2}}
-\setlength{\ffareay}{\staticframey{#2}}
-\expandafter\expandafter\expandafter
-\@ff@getstaticpos
-\csname @sf@dim@\romannumeral#2\endcsname
-\setlength{\ffareawidth}{\@ff@tmp@x}%
-\setlength{\ffareaheight}{\@ff@tmp@y}%
-\fi
-\or
-\ifnum#2>\c@dynamic
-\PackageError{flowfram}{Invalid dynamic frame IDN '\number#2'}{%
-Dynamic frame IDNs go from 1 to \number\c@maxdynamic}
-\else
-\setlength{\ffareax}{\dynamicframex{#2}}
-\setlength{\ffareay}{\dynamicframey{#2}}
-\expandafter\expandafter\expandafter
-\@ff@getstaticpos
-\csname @df@dim@\romannumeral#2\endcsname
-\setlength{\ffareawidth}{\@ff@tmp@x}%
-\setlength{\ffareaheight}{\@ff@tmp@y}%
-\fi
-\else
-\PackageError{flowfram}{Unknown frame ID type '#1'}{%
-Frame ID types are: 1 (flow), 2 (static) and 3 (dynamic)}
-\fi
-}
-\newcommand{\@sinsertvrule}[1][0pt]{%
+\newcommand*{\@sinsertvrule}[1][0pt]{%
\@ifnextchar[{\@@sinsertvrule[#1]}{\@@sinsertvrule[#1][0pt]}}
\def\@@sinsertvrule[#1][#2]#3#4#5#6{%
\ifthenelse{\equal{#3}{flow}}{%
@@ -2882,8 +3021,8 @@ or 'dynamic'}}}}%
\@@insert@vrule{#1}{#2}{\@ff@type@i}{\@ff@tmpN}%
{\@ff@type@ii}{\ff@id}%
}
-\newcommand{\inserthrule}{\@ifstar\@sinserthrule\@inserthrule}
-\newcommand{\@inserthrule}[1][0pt]{%
+\newcommand*{\inserthrule}{\@ifstar\@sinserthrule\@inserthrule}
+\newcommand*{\@inserthrule}[1][0pt]{%
\@ifnextchar[{\@@inserthrule[#1]}{\@@inserthrule[#1][0pt]}}
\def\@@inserthrule[#1][#2]#3#4#5#6{%
\ifthenelse{\equal{#3}{flow}}{%
@@ -2900,20 +3039,20 @@ type '#5'}{Available frame types are: 'flow', 'static'
or 'dynamic'}}}}%
\@@insert@hrule{#1}{#2}{\@ff@type@i}{#4}{\@ff@type@ii}{#6}%
}
-\newcommand{\@@insert@hrule}[6]{
+\newcommand*{\@@insert@hrule}[6]{%
\@ff@getdim{#3}{#4}%
\setlength{\@ff@left@x}{\ffareax}%
\setlength{\@ff@left@y}{\ffareay}%
\setlength{\@ff@left@width}{\ffareawidth}%
\setlength{\@ff@left@height}{\ffareaheight}%
\@ff@getdim{#5}{#6}%
-\ifnum\@ff@left@y>\ffareay
-\@ff@swaplen{\@ff@left@x}{\ffareax}%
-\@ff@swaplen{\@ff@left@y}{\ffareay}%
-\@ff@swaplen{\@ff@left@width}{\ffareawidth}%
-\@ff@swaplen{\@ff@left@height}{\ffareaheight}%
+\ifnum\@ff@left@y>\ffareay\relax
+ \@ff@swaplen{\@ff@left@x}{\ffareax}%
+ \@ff@swaplen{\@ff@left@y}{\ffareay}%
+ \@ff@swaplen{\@ff@left@width}{\ffareawidth}%
+ \@ff@swaplen{\@ff@left@height}{\ffareaheight}%
\fi
-\setlength{\@ff@tmp@y}{\@ff@left@y}
+\setlength{\@ff@tmp@y}{\@ff@left@y}%
\addtolength{\@ff@tmp@y}{\@ff@left@height}%
\setlength{\@ff@staticH}{\ffareay}%
\addtolength{\@ff@staticH}{-\@ff@tmp@y}%
@@ -2921,13 +3060,13 @@ or 'dynamic'}}}}%
\addtolength{\@ff@staticW}{\@ff@left@width}%
\setlength{\@ff@tmp@x}{\ffareax}%
\addtolength{\@ff@tmp@x}{\ffareawidth}%
-\ifnum\@ff@tmp@x>\@ff@staticW
-\setlength{\@ff@staticW}{\@ff@tmp@x}%
+\ifnum\@ff@tmp@x>\@ff@staticW\relax
+ \setlength{\@ff@staticW}{\@ff@tmp@x}%
\fi
-\ifnum\@ff@left@x<\ffareax
-\setlength{\@ff@tmp@x}{\@ff@left@x}%
+\ifnum\@ff@left@x<\ffareax\relax
+ \setlength{\@ff@tmp@x}{\@ff@left@x}%
\else
-\setlength{\@ff@tmp@x}{\ffareax}%
+ \setlength{\@ff@tmp@x}{\ffareax}%
\fi
\addtolength{\@ff@staticW}{-\@ff@tmp@x}%
\newstaticframe{\@ff@staticW}{\@ff@staticH}%
@@ -2935,20 +3074,20 @@ or 'dynamic'}}}}%
\addtolength{\@ff@staticW}{#1}%
\addtolength{\@ff@staticW}{#2}%
\setstaticcontents{\c@maxstatic}{%
-\hspace*{-#1}\rule{\@ff@staticW}{\columnseprule}}
-\ifcase#3
-\or \edef\@ff@pages{\csname @ff@pages@\romannumeral#4\endcsname}
-\or \edef\@ff@pages{\csname @sf@pages@\romannumeral#4\endcsname}
-\or \edef\@ff@pages{\csname @df@pages@\romannumeral#4\endcsname}
+\hspace*{-#1}\rule{\@ff@staticW}{\ffcolumnseprule}}%
+\ifcase#3\relax
+\or \edef\@ff@pages{\csname @ff@pages@\romannumeral#4\endcsname}%
+\or \edef\@ff@pages{\csname @sf@pages@\romannumeral#4\endcsname}%
+\or \edef\@ff@pages{\csname @df@pages@\romannumeral#4\endcsname}%
\fi
\setstaticframe{\c@maxstatic}{pages=\@ff@pages}%
-\addtolength{\@ff@tmp@x}{\@ff@left@evenx}
-\addtolength{\@ff@tmp@x}{-\@ff@left@x}
-\addtolength{\@ff@tmp@y}{\@ff@left@eveny}
-\addtolength{\@ff@tmp@y}{-\@ff@left@y}
+\addtolength{\@ff@tmp@x}{\@ff@left@evenx}%
+\addtolength{\@ff@tmp@x}{-\@ff@left@x}%
+\addtolength{\@ff@tmp@y}{\@ff@left@eveny}%
+\addtolength{\@ff@tmp@y}{-\@ff@left@y}%
\setstaticframe{\c@maxstatic}{evenx=\@ff@tmp@x,eveny=\@ff@tmp@y}%
}
-\newcommand{\@sinserthrule}[1][0pt]{%
+\newcommand*{\@sinserthrule}[1][0pt]{%
\@ifnextchar[{\@@sinserthrule[#1]}{\@@sinserthrule[#1][0pt]}}
\def\@@sinserthrule[#1][#2]#3#4#5#6{%
\ifthenelse{\equal{#3}{flow}}{%
@@ -2972,99 +3111,13 @@ or 'dynamic'}}}}%
\@@insert@hrule{#1}{#2}{\@ff@type@i}{\@ff@tmpN}%
{\@ff@type@ii}{\ff@id}%
}
-\newcommand*{\computeleftedgeodd}[1]{%
-\setlength{#1}{-1in}%
-\addtolength{#1}{-\hoffset}%
-\addtolength{#1}{-\oddsidemargin}}
-\newcommand*{\computeleftedgeeven}[1]{%
-\setlength{#1}{-1in}%
-\addtolength{#1}{-\hoffset}%
-\addtolength{#1}{-\evensidemargin}}
-\newcommand*{\computetopedge}[1]{%
-\setlength{#1}{\textheight}%
-\addtolength{#1}{\headheight}%
-\addtolength{#1}{\headsep}%
-\addtolength{#1}{1in}%
-\addtolength{#1}{\voffset}%
-\addtolength{#1}{\topmargin}}
-\newcommand*{\computebottomedge}[1]{%
-\computetopedge{#1}%
-\addtolength{#1}{-\paperheight}}
-\newcommand*{\computerightedgeodd}[1]{%
-\computeleftedgeodd{#1}%
-\addtolength{#1}{\paperwidth}}
-\newcommand*{\computerightedgeeven}[1]{%
-\computeleftedgeeven{#1}%
-\addtolength{#1}{\paperwidth}}
-\newlength\ffareawidth
-\newlength\ffareaheight
-\newlength\ffareax
-\newlength\ffareay
-\newcommand{\computeflowframearea}{%
-\@ifstar\@scomputeffarea\@computeffarea}
-\newcommand{\@scomputeffarea}[1]{%
-\setlength{\ffareax}{\paperwidth}%
-\setlength{\ffareay}{\paperheight}%
-\setlength{\@ff@tmp@x}{0pt}%
-\setlength{\@ff@tmp@y}{0pt}%
-\@for\@ff@id:=#1\do{\@flowframeid{\@ff@id}%
-\ifnum\ffareax>\flowframex{\ff@id}%
-\setlength{\ffareax}{\flowframex{\ff@id}}%
-\fi
-\ifnum\ffareay>\flowframey{\ff@id}%
-\setlength{\ffareay}{\flowframey{\ff@id}}%
-\fi
-\setlength{\@ff@offset}{\flowframex{\ff@id}}%
-\addtolength{@ff@offset}{\flowframewidth{\ff@id}}%
-\ifnum\@ff@tmp@x<\@ff@offset
-\setlength{\@ff@tmp@x}{\@ff@offset}%
-\fi
-\setlength{\@ff@offset}{\flowframey{\ff@id}}%
-\addtolength{@ff@offset}{\flowframeheight{\ff@id}}%
-\ifnum\@ff@tmp@y<\@ff@offset
-\setlength{\@ff@tmp@y}{\@ff@offset}%
-\fi
-}%
-\setlength{\ffareawidth}{\@ff@tmp@x}%
-\addtolength{\ffareawidth}{-\ffareax}%
-\setlength{\ffareaheight}{\@ff@tmp@y}%
-\addtolength{\ffareaheight}{-\ffareay}}
-\newcommand{\@computeffarea}[1]{%
-\setlength{\ffareax}{\paperwidth}%
-\setlength{\ffareay}{\paperheight}%
-\setlength{\@ff@tmp@x}{0pt}%
-\setlength{\@ff@tmp@y}{0pt}%
-\@for\@ff@id:=#1\do{%
-\ff@id=\@ff@id\relax
-\setlength{\@ff@offset}{\flowframex{\ff@id}}%
-\ifdim\ffareax>\@ff@offset
-\setlength{\ffareax}{\@ff@offset}%
-\fi
-\setlength{\@ff@offset}{\flowframey{\ff@id}}%
-\ifdim\ffareay>\@ff@offset
-\setlength{\ffareay}{\@ff@offset}%
-\fi
-\setlength{\@ff@offset}{\flowframex{\ff@id}}%
-\addtolength{\@ff@offset}{\flowframewidth{\ff@id}}%
-\ifdim\@ff@tmp@x<\@ff@offset
-\setlength{\@ff@tmp@x}{\@ff@offset}%
-\fi
-\setlength{\@ff@offset}{\flowframey{\ff@id}}%
-\addtolength{\@ff@offset}{\flowframeheight{\ff@id}}%
-\ifdim\@ff@tmp@y<\@ff@offset
-\setlength{\@ff@tmp@y}{\@ff@offset}%
-\fi
-}%
-\setlength{\ffareawidth}{\@ff@tmp@x}%
-\addtolength{\ffareawidth}{-\ffareax}%
-\setlength{\ffareaheight}{\@ff@tmp@y}%
-\addtolength{\ffareaheight}{-\ffareay}}
-\newcommand{\dfchaphead}{%
+\newcommand*{\dfchaphead}{%
\@ifstar\@sdynamicchap\@dynamicchap}
\newcommand{\DFchapterstyle}[1]{#1}
\newcommand{\DFschapterstyle}[1]{#1}
\newcommand{\@dynamicchap}[1]{%
-\@ifundefined{chapter}{\PackageError{flowfram}{Chapters aren't defined}{The document
+\@ifundefined{chapter}{\PackageError{flowfram}{Chapters aren't
+defined}{The document
class you are using does not define chapters}}{%
\let\@ff@OLDmakechapterhead\@makechapterhead
\let\@ff@OLDmakeschapterhead\@makeschapterhead
@@ -3081,11 +3134,11 @@ class you are using does not define chapters}}{%
\@dynamicframeid{#1}\@dynamicchap{\ff@id}}
\newcounter{maxthumbtabs}
\@ifundefined{chapter}{%
-\newcommand{\defaultthumbtabtype}{section}}{
-\newcommand{\defaultthumbtabtype}{chapter}
+\newcommand*{\defaultthumbtabtype}{section}}{
+\newcommand*{\defaultthumbtabtype}{chapter}
}
-\newcommand{\@ttb@type}{\defaultthumbtabtype}
-\newcommand{\makethumbtabs}[2][0pt]{%
+\newcommand*{\@ttb@type}{\defaultthumbtabtype}
+\newcommand*{\makethumbtabs}[2][0pt]{%
\@ifnextchar[{\@makethumbtabs[#1]{#2}}{%
\@makethumbtabs[#1]{#2}[\defaultthumbtabtype]}%
}
@@ -3103,14 +3156,16 @@ Unknown section type '#3'}{}}{%
\let\@ttb@old@chapter\@chapter
\def\@chapter[##1]##2{%
\@ttb@old@chapter[##1]{##2}%
-\addtocontents{ttb}{\protect\thumbtab{\thepage}{\thechapter}{##1}{chapter.\thechapter}}%
+\addtocontents{ttb}{\protect\thumbtab
+ {\thepage}{\thechapter}{##1}{chapter.\thechapter}}%
\@afterheading
}}
\newcommand{\@makethumbpart}{
\let\@ttb@old@part\@part
\@ifundefined{@endpart}{%
\def\@part[##1]##2{\@ttb@old@part[##1]{##2}%
-\addtocontents{ttb}{\protect\thumbtab{\thepage}{\thepart}{##1}{part.\thepage}}%
+\addtocontents{ttb}{\protect\thumbtab
+ {\thepage}{\thepart}{##1}{part.\thepage}}%
\@afterheading}}{%
\let\@ttb@old@endpart\@endpart
\def\@part[##1]##2{%
@@ -3123,7 +3178,7 @@ Unknown section type '#3'}{}}{%
{\thepart}{\@parttitle}{part.\thepage}}%
\@ttb@old@endpart
}}}
-\newcommand{\@makethumbsection}[1]{%
+\newcommand*{\@makethumbsection}[1]{%
\let\@ttb@old@sect=\@sect
\def\@sect##1##2##3##4##5##6[##7]##8{%
\@ttb@old@sect{##1}{##2}{##3}{##4}{##5}{##6}[##7]{##8}%
@@ -3147,29 +3202,30 @@ Unknown section type '#3'}{}}{%
\expandafter
\gdef\csname thumbtab@link@\romannumeral\c@maxthumbtabs\endcsname
{#4}}
-\newcommand{\@dothumbtabs}[2]{%
+\newcommand*{\@dothumbtabs}[2]{%
\@colN=0\relax
\whiledo{\@colN<\c@maxthumbtabs}{%
-\advance\@colN by 1\relax
-\edef\ff@pages{%
-\csname thumbtab@pages@\romannumeral\@colN\endcsname}%
-\ifnum\@colN=\c@maxthumbtabs
-\expandafter
-\xdef\csname thumbtab@pages@\romannumeral\@colN\endcsname{%
-\ff@pages,>\ff@pages}%
-\else
-\advance\@colN by 1\relax
-\edef\ff@endpage{%
-\csname thumbtab@pages@\romannumeral\@colN\endcsname}%
-\advance\@colN by -1\relax
-\@ff@tmpN=\ff@endpage
-\advance\@ff@tmpN by -1\relax
-\ifnum\@ff@tmpN>\ff@pages
-\expandafter
-\xdef\csname thumbtab@pages@\romannumeral\@colN\endcsname{%
-\ff@pages-\number\@ff@tmpN}%
-\fi
-\fi}%
+ \advance\@colN by 1\relax
+ \edef\ff@pages{%
+ \csname thumbtab@pages@\romannumeral\@colN\endcsname}%
+ \ifnum\@colN=\c@maxthumbtabs
+ \expandafter
+ \xdef\csname thumbtab@pages@\romannumeral\@colN\endcsname{%
+ \ff@pages,>\ff@pages}%
+ \else
+ \advance\@colN by 1\relax
+ \edef\ff@endpage{%
+ \csname thumbtab@pages@\romannumeral\@colN\endcsname}%
+ \advance\@colN by -1\relax
+ \@ff@tmpN=\ff@endpage\relax
+ \advance\@ff@tmpN by -1\relax
+ \ifnum\@ff@tmpN>\ff@pages
+ \expandafter
+ \xdef\csname thumbtab@pages@\romannumeral\@colN\endcsname{%
+ \ff@pages-\number\@ff@tmpN}%
+ \fi
+ \fi
+}%
\@@dothumbtabs{#1}{#2}%
}
\newlength{\thumbtabwidth}
@@ -3188,18 +3244,41 @@ Unknown section type '#3'}{}}{%
\parbox[c][#2]{\thumbtabwidth}{%
\centering\@ttb@stack{#1}}%
\fi}
-\newcommand{\@ttb@stack}[1]{%
-{\obeyspaces\expandafter\@@ttb@stack#1\end}}
-
-\def\@@ttb@stack#1{%
-\ifx#1\end\let\next\relax
+\def\@flf@subsp#1 #2{%
+\expandafter\flf@ta\expandafter{\@flf@subsptext}%
+\flf@tb{#1}%
+\edef\@flf@subsptext{\the\flf@ta\the\flf@tb}%
+\def\@flf@tmp{#2}%
+\ifx\@flf@tmp\@nnil
+ \let\@flf@donextsubsp=\@gobble
\else
-#1\par
-\let\next\@@ttb@stack
+ \expandafter\flf@ta\expandafter{\@flf@subsptext}%
+ \edef\@flf@subsptext{\the\flf@ta\noexpand\space}%
+ \let\@flf@donextsubsp=\@flf@subsp
\fi
-\next}
+\@flf@donextsubsp{#2}%
+}
+\newcommand{\@ttb@stack}[1]{%
+\def\@flf@subsptext{}%
+\expandafter\@flf@subsp#1 \@nil\relax
+\begin{tabular}{l}%
+\expandafter\@@ttb@stack\@flf@subsptext\@nil\relax
+\end{tabular}}
+\def\@@ttb@stack#1#2{%
+\def\@flf@tmp{#1}%
+\ifx\@flf@tmp\@nnil
+ \let\flf@next\relax
+\else
+ #1\\%
+ \def\@flf@tmp{#2}%
+ \ifx\@nnil#2\relax
+ \let\flf@next\@gobble
+ \else
+ \let\flf@next\@@ttb@stack
+ \fi
+\fi
+\flf@next{#2}}
\newcount\@greyscale
-
\newcommand{\@@dothumbtabs}[2]{%
\setlength{\@ff@tmp@y}{\textheight}%
\addtolength{\@ff@tmp@y}{-#2}%
@@ -3209,82 +3288,82 @@ Unknown section type '#3'}{}}{%
\computeleftedgeeven{\@ff@tmp@x@even}%
\@ff@tmpN=0\relax
\whiledo{\@ff@tmpN<\c@maxthumbtabs}{%
-\advance\@ff@tmpN by 1\relax
-\@greyscale=\@ff@tmpN\relax
-\multiply\@greyscale by 60\relax
-\divide\@greyscale by \c@maxthumbtabs
-\advance\@greyscale by 25\relax
-\edef\@ff@greyscale{0.\number\@greyscale}%
-\newdynamicframe[none]{\thumbtabwidth}{#2}%
-{\@ff@tmp@x}{\@ff@tmp@y}[thumbtab\number\@ff@tmpN]%
-\expandafter\global\expandafter
-\setlength\csname @df@\romannumeral\c@maxdynamic @evenx\endcsname
-{\@ff@tmp@x@even}%
-\ifthenelse{\boolean{@ttb@title}\and\boolean{@ttb@num}}{%
-\expandafter
-\xdef\csname @dynamicframe@\romannumeral\c@maxdynamic\endcsname{%
-\noexpand\thumbtabformat{%
-\csname thumbtab@num@\romannumeral\@ff@tmpN\endcsname\
-\csname thumbtab@title@\romannumeral\@ff@tmpN\endcsname
-}{#2}}
-}{%
-\if@ttb@title
-\expandafter
-\xdef\csname @dynamicframe@\romannumeral\c@maxdynamic\endcsname{%
-\noexpand\thumbtabformat{%
-\csname thumbtab@title@\romannumeral\@ff@tmpN\endcsname
-}{#2}}
-\fi
-\if@ttb@num
-\expandafter
-\xdef\csname @dynamicframe@\romannumeral\c@maxdynamic\endcsname{%
-\noexpand\thumbtabformat{%
-\csname thumbtab@num@\romannumeral\@ff@tmpN\endcsname
-}{#2}}
-\fi
-}%
-\expandafter
-\xdef\csname @df@backcol@\romannumeral\c@maxdynamic\endcsname
-{[gray]{\@ff@greyscale}}
-\newdynamicframe[none]{\thumbtabwidth}{#2}%
-{\@ff@tmp@x}{\@ff@tmp@y}[thumbtabindex\number\@ff@tmpN]%
-\expandafter\global\expandafter
-\setlength\csname @df@\romannumeral\c@maxdynamic @evenx\endcsname
-{\@ff@tmp@x@even}%
-\expandafter
-\ifthenelse{\boolean{@ttb@title}\and\boolean{@ttb@num}}{%
-\expandafter
-\xdef\csname @dynamicframe@\romannumeral\c@maxdynamic\endcsname{%
-\noexpand\thumbtabindexformat{%
-\csname thumbtab@link@\romannumeral\@ff@tmpN\endcsname}{%
-\csname thumbtab@num@\romannumeral\@ff@tmpN\endcsname\
-\csname thumbtab@title@\romannumeral\@ff@tmpN\endcsname
-}{#2}}
-}{%
-\if@ttb@title
-\expandafter
-\xdef\csname @dynamicframe@\romannumeral\c@maxdynamic\endcsname{%
-\noexpand\thumbtabindexformat{%
-\csname thumbtab@link@\romannumeral\@ff@tmpN\endcsname}{%
-\csname thumbtab@title@\romannumeral\@ff@tmpN\endcsname
-}{#2}}
-\fi
-\if@ttb@num
-\expandafter
-\xdef\csname @dynamicframe@\romannumeral\c@maxdynamic\endcsname{%
-\noexpand\thumbtabindexformat{%
-\csname thumbtab@link@\romannumeral\@ff@tmpN\endcsname}{%
-\csname thumbtab@num@\romannumeral\@ff@tmpN\endcsname
-}{#2}}
-\fi
-}%
-\expandafter
-\xdef\csname @df@backcol@\romannumeral\c@maxdynamic\endcsname
-{[gray]{\@ff@greyscale}}
-\addtolength{\@ff@tmp@y}{-#2}%
+ \advance\@ff@tmpN by 1\relax
+ \@greyscale=\@ff@tmpN\relax
+ \multiply\@greyscale by 60\relax
+ \divide\@greyscale by \c@maxthumbtabs
+ \advance\@greyscale by 25\relax
+ \edef\@ff@greyscale{0.\number\@greyscale}%
+ \newdynamicframe[none]{\thumbtabwidth}{#2}%
+ {\@ff@tmp@x}{\@ff@tmp@y}[thumbtab\number\@ff@tmpN]%
+ \expandafter\global\expandafter
+ \setlength\csname @df@\romannumeral\c@maxdynamic @evenx\endcsname
+ {\@ff@tmp@x@even}%
+ \ifthenelse{\boolean{@ttb@title}\and\boolean{@ttb@num}}{%
+ \expandafter
+ \xdef\csname @dynamicframe@\romannumeral\c@maxdynamic\endcsname{%
+ \noexpand\thumbtabformat{%
+ \csname thumbtab@num@\romannumeral\@ff@tmpN\endcsname\
+ \csname thumbtab@title@\romannumeral\@ff@tmpN\endcsname
+ }{#2}}%
+ }{%
+ \if@ttb@title
+ \expandafter
+ \xdef\csname @dynamicframe@\romannumeral\c@maxdynamic\endcsname{%
+ \noexpand\thumbtabformat{%
+ \csname thumbtab@title@\romannumeral\@ff@tmpN\endcsname
+ }{#2}}%
+ \fi
+ \if@ttb@num
+ \expandafter
+ \xdef\csname @dynamicframe@\romannumeral\c@maxdynamic\endcsname{%
+ \noexpand\thumbtabformat{%
+ \csname thumbtab@num@\romannumeral\@ff@tmpN\endcsname
+ }{#2}}%
+ \fi
+ }%
+ \expandafter
+ \xdef\csname @df@backcol@\romannumeral\c@maxdynamic\endcsname
+ {[gray]{\@ff@greyscale}}
+ \newdynamicframe[none]{\thumbtabwidth}{#2}%
+ {\@ff@tmp@x}{\@ff@tmp@y}[thumbtabindex\number\@ff@tmpN]%
+ \expandafter\global\expandafter
+ \setlength\csname @df@\romannumeral\c@maxdynamic @evenx\endcsname
+ {\@ff@tmp@x@even}%
+ \expandafter
+ \ifthenelse{\boolean{@ttb@title}\and\boolean{@ttb@num}}{%
+ \expandafter
+ \xdef\csname @dynamicframe@\romannumeral\c@maxdynamic\endcsname{%
+ \noexpand\thumbtabindexformat{%
+ \csname thumbtab@link@\romannumeral\@ff@tmpN\endcsname}{%
+ \csname thumbtab@num@\romannumeral\@ff@tmpN\endcsname\
+ \csname thumbtab@title@\romannumeral\@ff@tmpN\endcsname
+ }{#2}}%
+ }{%
+ \if@ttb@title
+ \expandafter
+ \xdef\csname @dynamicframe@\romannumeral\c@maxdynamic\endcsname{%
+ \noexpand\thumbtabindexformat{%
+ \csname thumbtab@link@\romannumeral\@ff@tmpN\endcsname}{%
+ \csname thumbtab@title@\romannumeral\@ff@tmpN\endcsname
+ }{#2}}%
+ \fi
+ \if@ttb@num
+ \expandafter
+ \xdef\csname @dynamicframe@\romannumeral\c@maxdynamic\endcsname{%
+ \noexpand\thumbtabindexformat{%
+ \csname thumbtab@link@\romannumeral\@ff@tmpN\endcsname}{%
+ \csname thumbtab@num@\romannumeral\@ff@tmpN\endcsname
+ }{#2}}%
+ \fi
+ }%
+ \expandafter
+ \xdef\csname @df@backcol@\romannumeral\c@maxdynamic\endcsname
+ {[gray]{\@ff@greyscale}}
+ \addtolength{\@ff@tmp@y}{-#2}%
}%
}%
-\newcommand{\enablethumbtabs}{%
+\newcommand*{\enablethumbtabs}{%
\ifnum\c@maxthumbtabs>0
\@ff@tmpN=0\relax
\@dynamicframeid{thumbtab1}%
@@ -3295,7 +3374,7 @@ Unknown section type '#3'}{}}{%
\advance\ff@id by 2\relax
}%
\else\PackageWarning{flowfram}{No thumb tabs defined}\fi}
-\newcommand{\disablethumbtabs}{%
+\newcommand*{\disablethumbtabs}{%
\ifnum\c@maxthumbtabs>0
\@ff@tmpN=0\relax
\@dynamicframeid{thumbtab1}%
@@ -3308,7 +3387,7 @@ Unknown section type '#3'}{}}{%
{none}%
\advance\ff@id by 1\relax
}\fi}
-\newcommand{\thumbtabindex}{%
+\newcommand*{\thumbtabindex}{%
\ifnum\c@maxthumbtabs>0\relax
\@ff@tmpN=0\relax
\@dynamicframeid{thumbtabindex1}%
@@ -3346,27 +3425,27 @@ ttb file may not be up-to-date}}{%
\@for\@ttb@id:=#1\do{\@setthumbtabindex{\@ttb@id}{#2}}}}
\newcommand{\@setthumbtabindex}[2]{%
\ifthenelse{\(\c@maxthumbtabs<#1\) \or \(#1<1\)}{%
-\PackageWarning{flowfram}{Can't find thumbtab number '#1',
+\PackageWarning{flowfram}{Can't find thumbtab number `\number#1',
ttb file may not be up-to-date}}{%
\@dynamicframeid{thumbtabindex\number#1}%
\@@setdynamicframe{\ff@id}{#2}}}
-\newcommand{\tocandthumbtabindex}{%
+\newcommand*{\tocandthumbtabindex}{%
\aligntoctrue
\tableofcontents
\thumbtabindex
\aligntocfalse
}
-\newcommand{\@ttb@minitoctype}{\@ttb@type}
+\newcommand*{\@ttb@minitoctype}{\@ttb@type}
\let\@ttb@old@starttoc\@starttoc
\newif\if@storetoc
\@storetocfalse
-\renewcommand{\@starttoc}[1]{%
+\renewcommand*{\@starttoc}[1]{%
\if@storetoc
-\@ttb@storetoc{#1}%
+ \@ttb@storetoc{#1}%
\else
-\@ttb@old@starttoc{#1}%
+ \@ttb@old@starttoc{#1}%
\fi}
-\newcommand{\@ttb@storetoc}[1]{%
+\newcommand*{\@ttb@storetoc}[1]{%
\begingroup
\makeatletter
\@storefileconts{\jobname.#1}%
@@ -3376,14 +3455,15 @@ ttb file may not be up-to-date}}{%
\fi
\@nobreakfalse
\endgroup}
-\newcommand{\@storefileconts}[1]{\IfFileExists{#1}{%
+\newcommand*{\@storefileconts}[1]{\IfFileExists{#1}{%
\@@storefileconts\@filef@und}{%
-\typeout{No file #1.}}}
+\PackageInfo{flowfram}{No file #1.}}}
\newcount\c@maxtocunits
\newcount\c@maxminitoc
\newcommand{\@@storefileconts}[1]{%
-\@ifundefined{\@ttb@minitoctype}{\@ttb@minitoclevel=6}{%
-\expandafter\@ttb@minitoclevel\expandafter=\csname @ttb@\@ttb@minitoctype @level\endcsname}%
+\@ifundefined{\@ttb@minitoctype}{\@ttb@minitoclevel=6\relax}{%
+\expandafter\@ttb@minitoclevel\expandafter
+ =\csname @ttb@\@ttb@minitoctype @level\endcsname}%
\newread\@ttb@toc
\openin\@ttb@toc=#1\relax
\c@maxtocunits=0\relax
@@ -3413,21 +3493,25 @@ ttb file may not be up-to-date}}{%
\flf@tb=\expandafter\expandafter\expandafter{\csname @toc@\romannumeral#2\endcsname}%
\expandafter\xdef\csname @toc@\romannumeral#2\endcsname{\the\flf@tb\the\flf@ta}}%
\if@minitoc
-\if@contsline
-\@ifundefined{\@ttb@contstype}{\@ttb@level=6}{%
-\@ttb@level=\csname @ttb@\@ttb@contstype @level\endcsname}%
-\relax
-\ifnum\@ttb@level=\@ttb@minitoclevel
- \global\advance\c@maxminitoc by 1\relax
- \expandafter\gdef\csname @minitoc@\romannumeral\c@maxminitoc\endcsname{}\relax
-\else
- \ifnum\@ttb@level>\@ttb@minitoclevel
- \flf@ta=\expandafter{#1}\relax
- \flf@tb=\expandafter\expandafter\expandafter{\csname @minitoc@\romannumeral\c@maxminitoc\endcsname}\relax
- \expandafter\xdef\csname @minitoc@\romannumeral\c@maxminitoc\endcsname{\the\flf@tb\the\flf@ta}
- \fi
-\fi
-\fi
+ \if@contsline
+ \@ifundefined{\@ttb@contstype}{\@ttb@level=6}{%
+ \@ttb@level=\csname @ttb@\@ttb@contstype @level\endcsname}%
+ \relax
+ \ifnum\@ttb@level=\@ttb@minitoclevel
+ \global\advance\c@maxminitoc by 1\relax
+ \expandafter
+ \gdef\csname @minitoc@\romannumeral\c@maxminitoc\endcsname{}%
+ \else
+ \ifnum\@ttb@level>\@ttb@minitoclevel
+ \flf@ta=\expandafter{#1}\relax
+ \flf@tb=\expandafter\expandafter\expandafter
+ {\csname @minitoc@\romannumeral\c@maxminitoc\endcsname}\relax
+ \expandafter
+ \xdef\csname @minitoc@\romannumeral\c@maxminitoc\endcsname{%
+ \the\flf@tb\the\flf@ta}
+ \fi
+ \fi
+ \fi
\fi
}
\def\@ttb@part@level{-1}
@@ -3439,9 +3523,9 @@ ttb file may not be up-to-date}}{%
\def\@ttb@subparagraph@level{5}
\long\def\@checkcontentsline#1#2\end{%
\ifx#1\contentsline
-\@contslinetrue
+ \@contslinetrue
\else
-\@contslinefalse
+ \@contslinefalse
\fi}
\def\@gettype\contentsline#1#2\end{%
\def\@ttb@contstype{#1}}
@@ -3449,13 +3533,13 @@ ttb file may not be up-to-date}}{%
\aligntocfalse
\let\@ttb@old@tableofcontents\tableofcontents
-\renewcommand{\tableofcontents}{
+\renewcommand{\tableofcontents}{%
\@storetoctrue
\@ttb@old@tableofcontents
\ifaligntoc
-\@printalignedtoc
+ \@printalignedtoc
\else
-\@printtoc
+ \@printtoc
\fi
\@storetocfalse
\global\c@minitoc=0\relax}
@@ -3463,26 +3547,26 @@ ttb file may not be up-to-date}}{%
\setlength{\beforeminitocskip}{0pt}
\newlength\afterminitocskip
\setlength{\afterminitocskip}{\baselineskip}
-\newcommand{\dominitoc}[1]{%
-\if@minitoc \@dominitoc{#1} \fi}
-\newcommand{\@dominitoc}[1]{\@@dominitoc{#1}}
+\newcommand*{\dominitoc}[1]{%
+\if@minitoc \@dominitoc{#1}\fi}
+\newcommand*{\@dominitoc}[1]{\@@dominitoc{#1}}
\newcommand{\minitocstyle}[1]{\normalfont\normalsize\normalcolor
#1}
-\newcommand{\@@dominitoc}[1]{%
+\newcommand*{\@@dominitoc}[1]{%
{\minitocstyle{%
\vskip\beforeminitocskip
\csname @minitoc@\romannumeral#1\endcsname}}
\vskip\afterminitocskip}
-\newcommand{\appenddfminitoc}{%
+\newcommand*{\appenddfminitoc}{%
\renewcommand{\beforeminitocskip}{\baselineskip}%
\@ifstar\@sappendminitocdf\@appendminitocdf}
-\newcommand{\@sappendminitocdf}[1]{%
+\newcommand*{\@sappendminitocdf}[1]{%
\renewcommand{\@dominitoc}[1]{%
\@sappenddynamic{#1}{\@@dominitoc{##1}}}}
-\newcommand{\@appendminitocdf}[1]{%
+\newcommand*{\@appendminitocdf}[1]{%
\renewcommand{\@dominitoc}[1]{%
\@appenddynamic{#1}{\@@dominitoc{##1}}}}
-\newcommand{\@printtoc}{%
+\newcommand*{\@printtoc}{%
\@colN=0\relax
\csname @toc@\romannumeral\@colN\endcsname
\whiledo{\@colN<\c@maxtocunits}{%
@@ -3514,15 +3598,15 @@ ttb file may not be up-to-date}}{%
\newif\if@minitoc
\@minitocfalse
-\newcommand{\enableminitoc}[1][\@ttb@type]{%
+\newcommand*{\enableminitoc}[1][\@ttb@type]{%
\@minitoctrue
\setcounter{minitoc}{0}%
-\@ifundefined{#1}{
-\PackageError{flowfram}{Sectioning type '#1' not defined}{}}{%
+\@ifundefined{#1}{%
+\PackageError{flowfram}{Sectioning type `#1' not defined}{}}{%
\renewcommand{\@ttb@minitoctype}{#1}%
\ifthenelse{\equal{#1}{chapter}}{\@makeminitocchapter}{%
\ifthenelse{\equal{#1}{part}}{\@makeminitocpart}{%
-\@makeminitocsection{#1}}}}
+\@makeminitocsection{#1}}}}%
}
\@onlypreamble{\enableminitoc}
\newcommand{\@makeminitocchapter}{