From 2b0321dafd5d992f9fad9d473404b5108ddbc5c7 Mon Sep 17 00:00:00 2001 From: Reinhard Kotucha Date: Sun, 8 Apr 2007 18:18:21 +0000 Subject: update flowfram to v1.07 git-svn-id: svn://tug.org/texlive/trunk@4132 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/flowfram/flowfram.sty | 439 ++++++++++++++++------ 1 file changed, 332 insertions(+), 107 deletions(-) (limited to 'Master/texmf-dist/tex/latex/flowfram') diff --git a/Master/texmf-dist/tex/latex/flowfram/flowfram.sty b/Master/texmf-dist/tex/latex/flowfram/flowfram.sty index 06a2a252751..8335fc36430 100644 --- a/Master/texmf-dist/tex/latex/flowfram/flowfram.sty +++ b/Master/texmf-dist/tex/latex/flowfram/flowfram.sty @@ -5,7 +5,7 @@ %% The original source files were: %% %% flowfram.dtx (with options: `flowfram.sty,package') -%% Copyright (C) 2005 Nicola Talbot, all rights reserved. +%% 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 @@ -27,11 +27,12 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{flowfram}[2005/11/24 v1.02] +\ProvidesPackage{flowfram}[2007/03/09 v1.07] \RequirePackage{ifthen} \RequirePackage{keyval} \RequirePackage{graphics} \RequirePackage{afterpage} +\@ifundefined{@ldc@l@r}{\RequirePackage{color}}{} \newcommand{\setffdraftcolor}{\color[gray]{0.8}} \newcommand{\setffdrafttypeblockcolor}{\color[gray]{0.9}} \newlength\fflabelsep @@ -109,10 +110,8 @@ \fi \@ifundefined{chapter}{}{% \newcommand{\chapterfirstpagestyle}{plain} - \let\@ff@OLD@chapter\@chapter \let\@ff@OLD@schapter\@schapter - \renewcommand{\@chapter}{% \thispagestyle{\chapterfirstpagestyle}\@ff@OLD@chapter} \renewcommand{\@schapter}{% @@ -133,6 +132,7 @@ \newlength\@ff@tmp@x \newlength\@ff@tmp@x@even \newlength\@ff@tmp@y +\newlength\sdfparindent \newlength\flowframesep \flowframesep=\fboxsep \newlength\flowframerule @@ -146,13 +146,13 @@ {\parfillskip=0pt\pagebreak[#1]\parskip=0pt\par\noindent}} \newcommand{\finishthispage}{% \@colN=\c@thisframe -\clearpage +\newpage \whiledo{\@colN<\c@maxflow}{\advance\@colN by 1\relax \@ff@chckifthispg{\c@page}{\@colN}% \if@notthiscol\else -\mbox{}\vfill\clearpage% -\fi} -} +\mbox{}\newpage% +\fi +}} \def\cleardoublepage{\finishthispage \if@twoside \ifodd\c@page @@ -193,37 +193,62 @@ \@onlypreamble{\newflowframe} \newcommand{\@n@wflowframe}{% \global\advance\c@maxflow by 1\relax -\expandafter\global\expandafter\newif\csname ifcolumnframe\romannumeral\c@maxflow\endcsname +\expandafter\global\expandafter +\newif\csname ifcolumnframe\romannumeral\c@maxflow\endcsname \@ifstar\@snewflowframe\@newflowframe } \newcommand{\@snewflowframe}{% -\expandafter\global\expandafter\let\csname ifcolumnframe\romannumeral\c@maxflow\endcsname\iftrue +\expandafter\global\expandafter +\let\csname ifcolumnframe\romannumeral\c@maxflow\endcsname\iftrue \@@newflowframe} \newcommand{\@newflowframe}{% -\expandafter\global\expandafter\let\csname ifcolumnframe\romannumeral\c@maxflow\endcsname\iffalse +\expandafter\global\expandafter +\let\csname ifcolumnframe\romannumeral\c@maxflow\endcsname\iffalse \@@newflowframe} \newcommand{\@@newflowframe}[5][all]{% -\expandafter\global\expandafter\newbox\csname column\romannumeral\c@maxflow\endcsname -\expandafter\global\expandafter\newlength\csname colwidth\romannumeral\c@maxflow\endcsname -\expandafter\global\expandafter\newlength\csname colheight\romannumeral\c@maxflow\endcsname -\expandafter\global\expandafter\newlength\csname col@\romannumeral\c@maxflow @posx\endcsname -\expandafter\global\expandafter\newlength\csname col@\romannumeral\c@maxflow @posy\endcsname -\expandafter\global\expandafter\setlength\csname colwidth\romannumeral\c@maxflow\endcsname{#2} -\expandafter\global\expandafter\setlength\csname colheight\romannumeral\c@maxflow\endcsname{#3} -\expandafter\global\expandafter\setlength\csname col@\romannumeral\c@maxflow @posx\endcsname{#4} -\expandafter\global\expandafter\setlength\csname col@\romannumeral\c@maxflow @posy\endcsname{#5} -\expandafter\global\expandafter\newlength\csname col@\romannumeral\c@maxflow @evenx\endcsname -\expandafter\global\expandafter\newlength\csname col@\romannumeral\c@maxflow @eveny\endcsname -\expandafter\global\expandafter\setlength\csname col@\romannumeral\c@maxflow @evenx\endcsname{#4} -\expandafter\global\expandafter\setlength\csname col@\romannumeral\c@maxflow @eveny\endcsname{#5} -\expandafter\gdef\csname @ff@frametype@\romannumeral\c@maxflow\endcsname{fbox}% -\expandafter\gdef\csname @ff@col@\romannumeral\c@maxflow\endcsname{\flowframecol} -\expandafter\gdef\csname @ff@txtcol@\romannumeral\c@maxflow\endcsname{\flowframetextcol} -\expandafter\gdef\csname @ff@backcol@\romannumeral\c@maxflow\endcsname{{none}} -\expandafter\gdef\csname @ff@pages@\romannumeral\c@maxflow\endcsname{#1} -\expandafter\gdef\csname @ff@offset@\romannumeral\c@maxflow\endcsname{compute} -\expandafter\gdef\csname @ff@angle@\romannumeral\c@maxflow\endcsname{0}% -\expandafter\gdef\csname @ff@margin@\romannumeral\c@maxflow\endcsname{right} +\expandafter\global\expandafter +\newbox\csname column\romannumeral\c@maxflow\endcsname +\expandafter\global\expandafter +\newlength\csname colwidth\romannumeral\c@maxflow\endcsname +\expandafter\global\expandafter +\newlength\csname colheight\romannumeral\c@maxflow\endcsname +\expandafter\global\expandafter +\newlength\csname col@\romannumeral\c@maxflow @posx\endcsname +\expandafter\global\expandafter +\newlength\csname col@\romannumeral\c@maxflow @posy\endcsname +\expandafter\global\expandafter +\setlength\csname colwidth\romannumeral\c@maxflow\endcsname{#2} +\expandafter\global\expandafter +\setlength\csname colheight\romannumeral\c@maxflow\endcsname{#3} +\expandafter\global\expandafter +\setlength\csname col@\romannumeral\c@maxflow @posx\endcsname{#4} +\expandafter\global\expandafter +\setlength\csname col@\romannumeral\c@maxflow @posy\endcsname{#5} +\expandafter\global\expandafter +\newlength\csname col@\romannumeral\c@maxflow @evenx\endcsname +\expandafter\global\expandafter +\newlength\csname col@\romannumeral\c@maxflow @eveny\endcsname +\expandafter\global\expandafter +\setlength\csname col@\romannumeral\c@maxflow @evenx\endcsname{#4} +\expandafter\global\expandafter +\setlength\csname col@\romannumeral\c@maxflow @eveny\endcsname{#5} +\expandafter +\gdef\csname @ff@frametype@\romannumeral\c@maxflow\endcsname{fbox}% +\expandafter +\gdef\csname @ff@col@\romannumeral\c@maxflow\endcsname{\flowframecol} +\expandafter +\gdef\csname @ff@txtcol@\romannumeral\c@maxflow\endcsname{% +\flowframetextcol} +\expandafter +\gdef\csname @ff@backcol@\romannumeral\c@maxflow\endcsname{{none}} +\expandafter +\gdef\csname @ff@pages@\romannumeral\c@maxflow\endcsname{#1} +\expandafter +\gdef\csname @ff@offset@\romannumeral\c@maxflow\endcsname{compute} +\expandafter +\gdef\csname @ff@angle@\romannumeral\c@maxflow\endcsname{0}% +\expandafter +\gdef\csname @ff@margin@\romannumeral\c@maxflow\endcsname{right} \ifnum\c@thisframe=0\relax \ifthenelse{\equal{#1}{all}\TE@or\equal{#1}{odd}}{% \c@thisframe=\c@maxflow @@ -242,11 +267,13 @@ \fi }}}% \fi -\@ifnextchar[{\@s@tflowframeid{\c@maxflow}}{\@s@tflowframeid{\c@maxflow}[\number\c@maxflow]}} +\@ifnextchar[{\@s@tflowframeid{\c@maxflow}}{% +\@s@tflowframeid{\c@maxflow}[\number\c@maxflow]}} \def\@s@tflowframeid#1[#2]{% \edef\ff@label{#2}% \@ff@checkuniqueidl{#1}{\ff@label}% -\expandafter\xdef\csname @col@id@\romannumeral#1\endcsname{\ff@label}% +\expandafter +\xdef\csname @col@id@\romannumeral#1\endcsname{\ff@label}% } \newcommand{\@ff@checkuniqueidl}[2]{% {\@colN=0\relax @@ -254,7 +281,8 @@ \advance\@colN by 1\relax \ifnum\@colN=#1\relax \else -\ifthenelse{\equal{#2}{\csname @col@id@\romannumeral\@colN\endcsname}}{% +\ifthenelse{\equal{#2}{% +\csname @col@id@\romannumeral\@colN\endcsname}}{% \PackageError{flowfram}{Flow frame IDL '#2' already defined}{% You can't assign this label, as it is already defined for flow frame \number\@colN}}{}% @@ -335,6 +363,12 @@ boolean}{You can only specify the values 'true' or 'false'}}} \define@key{flowframe}{style}{\ifthenelse{\equal{#1}{}}{% \PackageError{flowfram}{Missing value for 'style' key}{}}{}% \ifthenelse{\equal{#1}{none}}{\def\ff@style{relax}}{\def\ff@style{#1}}} +\define@key{flowframe}{shape}{\def\ff@shape{#1}% +} +\define@key{flowframe}{valign}{\ifthenelse{\equal{#1}{c} \or +\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]{% \@colN=0\whiledo{\@colN<\c@maxflow}{\advance\@colN by 1\relax \@@setflowframe{\@colN}{#1}}} @@ -368,10 +402,11 @@ boolean}{You can only specify the values 'true' or 'false'}}} }}}}} \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@style{}% +\def\ff@x{}\def\ff@y{}\def\ff@frametype{}\def\ff@col{}% +\def\ff@valign{}\def\ff@style{}% \def\ff@txtcol{}\def\ff@clear{}\def\ff@offset{}\def\ff@pages{}% \def\ff@label{}\def\ff@backcol{}\def\ff@evenx{}\def\ff@eveny{}% -\def\ff@oddx{}\def\ff@oddy{}\def\ff@angle{}% +\def\ff@oddx{}\def\ff@oddy{}\def\ff@angle{}\def\ff@shape{\empty}% \setkeys{flowframe}{#2}% \ifthenelse{\equal{\ff@frame}{}}{}{% \setboolean{columnframe\romannumeral#1}{\ff@frame}}% @@ -432,6 +467,14 @@ boolean}{You can only specify the values 'true' or 'false'}}} \ifthenelse{\equal{\ff@style}{}}{}{% \PackageError{flowfram}% {Key 'style' not available for flow frames}{}}% +\if\ff@shape\empty +\else +\PackageError{flowfram}% +{Key 'shape' not available for flow frames}{}% +\fi +\ifthenelse{\equal{\ff@valign}{}}{}{% +\PackageError{flowfram}% +{Key 'valign' not available for flow frames}{}}% } \newcommand{\@@flowframeswapcoords}[1]{% \setlength{\@ff@tmp@x}% @@ -550,6 +593,8 @@ compute}% \expandafter \gdef\csname @sf@angle@\romannumeral\c@maxstatic\endcsname{0}% \expandafter +\gdef\csname @sf@shape@\romannumeral\c@maxstatic\endcsname{\relax}% +\expandafter \def\csname @sf@frametype@\romannumeral\c@maxstatic\endcsname{% fbox}% \newboolean{@sf@clear@\romannumeral\c@maxstatic}% @@ -628,9 +673,11 @@ id '#1'}{}\fi} \@ff@getstaticpos\csname @sf@dim@\romannumeral#1\endcsname \def\ff@frame{}\edef\ff@width{\the\@ff@tmp@x}\def\ff@angle{}% \edef\ff@height{\the\@ff@tmp@y}\def\ff@style{}\def\ff@frametype{}% -\def\ff@x{}\def\ff@y{}\def\ff@col{}\def\ff@txtcol{}\def\ff@backcol{}% +\def\ff@x{}\def\ff@y{}\def\ff@col{}\def\ff@txtcol{}% +\def\ff@backcol{}\def\ff@shape{0}% \def\ff@clear{}\def\ff@margin{}\def\ff@offset{}\def\ff@pages{}% -\def\ff@label{}\def\ff@evenx{}\def\ff@eveny{}\def\ff@oddx{}\def\ff@oddy{}% +\def\ff@label{}\def\ff@evenx{}\def\ff@eveny{}% +\def\ff@oddx{}\def\ff@oddy{}% \setkeys{flowframe}{#2}% \ifthenelse{\equal{\ff@frame}{}}{}{% \setboolean{staticframe\romannumeral#1}{\ff@frame}}% @@ -666,7 +713,7 @@ id '#1'}{}\fi} {\ff@oddy}}% \expandafter \xdef\csname @sf@dim@\romannumeral#1\endcsname{% -[c][\ff@height][c]{\ff@width}}% +[c][\ff@height][\ff@valign]{\ff@width}}% \ifthenelse{\equal{\ff@frametype}{}}{}{% \expandafter \xdef\csname @sf@frametype@\romannumeral#1\endcsname{% @@ -685,6 +732,11 @@ id '#1'}{}\fi} \ifthenelse{\equal{\ff@angle}{}}{}{% \expandafter \xdef\csname @sf@angle@\romannumeral#1\endcsname{\ff@angle}}% +\if0\ff@shape +\else +\expandafter\global\expandafter +\let\csname @sf@shape@\romannumeral#1\endcsname\ff@shape +\fi \ifthenelse{\equal{\ff@pages}{}}{}{% \expandafter \xdef\csname @sf@pages@\romannumeral#1\endcsname{\ff@pages}}% @@ -697,19 +749,127 @@ static frames}{Static frames don't have marginal notes}}% \PackageError{flowfram}{Key 'style' not available for static frames}{}}% } +\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} +\def\@ff@parshape{\parshape=0} + +\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 +#1}% +\xdef\next{\@ff@parshape +\prevgraf=\the\prevgraf}% +\endgroup +}% +\mbox{}\next\let\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 +#2}% +\xdef\next{\@ff@parshape +\prevgraf=\the\prevgraf}% +\endgroup}% +\mbox{}\next\let\next\undefined} +\newcommand*{\@ff@setsecthead}{% +\let\@ff@oldsection=\section +\let\@ff@oldsubsection=\subsection +\let\@ff@oldsubsubsection=\subsubsection +\let\@ff@oldparagraph=\paragraph +\let\@ff@oldsubparagraph=\subparagraph +\def\section{\@ff@sectionhead{section}}% +\def\subsection{\@ff@sectionhead{subsection}}% +\def\subsubsection{\@ff@sectionhead{subsubsection}}% +\def\paragraph{\@ff@sectionhead{paragraph}}% +\def\subparagraph{\@ff@sectionhead{subparagraph}}% +} +\def\@ff@getshape#1#2\relax{% +\ifx#1\parshape +\def\ff@shape{1}% +\else +\ifx#1\shapepar +\def\ff@shape{2}% +\else +\ifx#1\relax +\def\ff@shape{0}% +\else +\PackageError{flowfram}{Unknown shape \string#1}{}% +\def\ff@shape{2}% +\fi +\fi +\fi} +\newcommand*{\@ff@disablesec}{% +\def\section{\PackageError{flowfram}{You can't have +sectioning commands within a \string\shapepar}{}}% +\def\subsection{\PackageError{flowfram}{You can't have +sectioning commands within a \string\shapepar}{}}% +\def\subsubsection{\PackageError{flowfram}{You can't have +sectioning commands within a \string\shapepar}{}}% +\def\paragraph{\PackageError{flowfram}{You can't have +sectioning commands within a \string\shapepar}{}}% +\def\subparagraph{\PackageError{flowfram}{You can't have +sectioning commands within a \string\shapepar}{}}% +} \newbox\staticframe \newenvironment{staticcontents}[1]{% \@ifundefined{@staticframe@\romannumeral#1}{% \PackageError{flowfram}{Static frame '#1' not defined}{}}{}% +\expandafter\let\expandafter\@ff@parshape\csname @sf@shape@\romannumeral#1\endcsname +\expandafter\@ff@getshape\@ff@parshape\relax +\ifcase\ff@shape \edef\@sf@mpg{% \noexpand -\begin{minipage}\csname @sf@dim@\romannumeral#1\endcsname}% +\begin{minipage}\csname @sf@dim@\romannumeral#1\endcsname +\noexpand\begingroup +\noexpand\let\noexpand\orgpar=\noexpand\par +}% +\or +\edef\@sf@mpg{% +\noexpand +\begin{minipage}\csname @sf@dim@\romannumeral#1\endcsname +\@ff@parshape +\noexpand\begingroup +\noexpand\let\noexpand\orgpar=\noexpand\par +\noexpand\let\noexpand\par=\noexpand\ffpshpar +\noexpand\@ff@setsecthead +}% +\or +\edef\@sf@mpg{% +\noexpand +\begin{minipage}\csname @sf@dim@\romannumeral#1\endcsname +\noexpand\begingroup +\noexpand\@ff@disablesec +\noexpand\@ff@parshape +}% +\fi \edef\@sf@thisframe{\csname @staticframe@\romannumeral#1\endcsname}% \begin{lrbox}{\staticframe}% \edef\ff@txtcol{\csname @sf@txtcol@\romannumeral#1\endcsname}% -\@s@tfftextcol +\@s@tfftextcol\noindent \@sf@mpg -}{\end{minipage}\end{lrbox}% +\setlength\parindent\sdfparindent +}{\ifnum\ff@shape=2\par +\else\orgpar\fi\endgroup\end{minipage}\end{lrbox}% \expandafter\global\expandafter\sbox\@sf@thisframe{% \usebox\staticframe}\ignorespaces } @@ -822,6 +982,8 @@ fbox}% \gdef\csname @df@offset@\romannumeral\c@maxdynamic\endcsname{compute}% \expandafter \gdef\csname @df@angle@\romannumeral\c@maxdynamic\endcsname{0}% +\expandafter +\gdef\csname @df@shape@\romannumeral\c@maxdynamic\endcsname{\relax}% \newboolean{@df@clear@\romannumeral\c@maxdynamic}% \setboolean{@df@clear@\romannumeral\c@maxdynamic}{false}% \@ifnextchar[{\@s@tdynamicframeid{\c@maxdynamic}}% @@ -894,13 +1056,14 @@ id '#1'}{}\fi} \advance\@colN by 1\relax }}}}} \newcommand{\@@setdynamicframe}[2]{% -\expandafter\expandafter\expandafter\@ff@getstaticpos\csname @df@dim@\romannumeral#1\endcsname +\expandafter\expandafter\expandafter +\@ff@getstaticpos\csname @df@dim@\romannumeral#1\endcsname \def\ff@frame{}\edef\ff@width{\the\@ff@tmp@x}% \edef\ff@height{\the\@ff@tmp@y}\def\ff@style{}\def\ff@frametype{}% \def\ff@x{}\def\ff@y{}\def\ff@col{}\def\ff@txtcol{}\def\ff@backcol{}% \def\ff@clear{}\def\ff@margin{}\def\ff@offset{}\def\ff@pages{}% \def\ff@label{}\def\ff@evenx{}\def\ff@eveny{}% -\def\ff@oddx{}\def\ff@oddy{}\def\ff@angle{}% +\def\ff@oddx{}\def\ff@oddy{}\def\ff@angle{}\def\ff@shape{0}% \setkeys{flowframe}{#2}% \ifthenelse{\equal{\ff@frame}{}}{}{% \setboolean{dynamicframe\romannumeral#1}{\ff@frame}}% @@ -927,7 +1090,7 @@ id '#1'}{}\fi} \expandafter\global\expandafter\setlength \csname @df@\romannumeral#1@posy\endcsname{\ff@oddy}}% \expandafter\xdef\csname @df@dim@\romannumeral#1\endcsname{% -[c][\ff@height][t]{\ff@width}}% +[c][\ff@height][\ff@valign]{\ff@width}}% \ifthenelse{\equal{\ff@label}{}}{}{% \@s@tdynamicframeid{#1}[\ff@label]} \ifthenelse{\equal{\ff@frametype}{}}{}{% @@ -946,6 +1109,11 @@ id '#1'}{}\fi} \ifthenelse{\equal{\ff@angle}{}}{}{% \expandafter \xdef\csname @df@angle@\romannumeral#1\endcsname{\ff@angle}}% +\if0\ff@shape +\else +\expandafter\global\expandafter +\let\csname @df@shape@\romannumeral#1\endcsname\ff@shape +\fi \ifthenelse{\equal{\ff@pages}{}}{}{% \expandafter\xdef\csname @df@pages@\romannumeral#1\endcsname{% \ff@pages}}% @@ -964,14 +1132,14 @@ frames}{dynamic frames don't have marginal notes}}% } \newcommand{\@@dynamicframeswapcoords}[1]{% \setlength{\@ff@tmp@x}% -{\csname @df@\romannumeral#1@evenx\endcsname} +{\csname @df@\romannumeral#1@evenx\endcsname}% \expandafter\setlength \csname @df@\romannumeral#1@evenx\endcsname {\csname @df@\romannumeral#1@posx\endcsname}% \expandafter\setlength \csname @df@\romannumeral#1@posx\endcsname{\@ff@tmp@x}% \setlength{\@ff@tmp@y}% -{\csname @df@\romannumeral#1@eveny\endcsname} +{\csname @df@\romannumeral#1@eveny\endcsname}% \expandafter\setlength \csname @df@\romannumeral#1@eveny\endcsname {\csname @df@\romannumeral#1@posy\endcsname}% @@ -1016,7 +1184,7 @@ frames}{dynamic frames don't have marginal notes}}% \@dynamicframeid{#1}\@setdynamiccontents{\ff@id}{#2}} \newcommand{\@setdynamiccontents}[2]{% \ifnum#1>\c@maxdynamic -\PackageError{flowfram}{Dynamic frame \number#1 does not exist}{% +\PackageError{flowfram}{Dynamic frame \number#1\ does not exist}{% You have specified dynamic frame number \number#1, but there are only \number\c@maxdynamic\space dynamic frames currently defined}% \else @@ -1037,9 +1205,10 @@ but there are only \expandafter\@ff@addtolist \csname @dynamicframe@\romannumeral#1\endcsname\entry{#2}% \fi} -\toksdef\ta=0 \toksdef\tb=2 -\long\def\@ff@addtolist#1\entry#2{\ta={{#2}}\tb=\expandafter{#1}% -\xdef#1{\the\tb\the\ta}} +\toksdef\flf@ta=0 \toksdef\flf@tb=2 +\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% \global\usedframebreaktrue \global\setlength{\hsize}{% @@ -1057,7 +1226,7 @@ Attempting to find the first page with a flow frame}% \advance\c@curpg by -1\relax \whiledo{\c@curpg>0}{\advance\c@curpg by -1\relax \setbox\@outputbox\vbox{\hbox to \textwidth{\@ff@do@allframes}}% -\@outputpage} +\@outputpage}% \c@thisframe=\@nxtcol \fi \@setcol{\c@thisframe}\relax @@ -1070,13 +1239,13 @@ Attempting to find the first page with a flow frame}% \finishthispage \setallflowframes{pages=none}% \settoheight{\@ff@staticH}{#1}% -\settodepth{\@ff@tmp@y}{#1} +\settodepth{\@ff@tmp@y}{#1}% \addtolength{\@ff@staticH}{\@ff@tmp@y}% -\ifdim\@ff@staticH>0pt -\twocolumnStop[\c@page]{\@ff@staticH} +\ifdim\@ff@staticH>0pt\relax +\twocolumnStop[\c@page]{\@ff@staticH}% \c@thisframe=\c@maxflow \advance\c@thisframe by -1\relax -\@twocolumn[>\c@page] +\@twocolumn[>\c@page]% \setstaticcontents{\c@maxstatic}{#1}% \else \@twocolumn @@ -1089,13 +1258,13 @@ Attempting to find the first page with a flow frame}% \finishthispage \setallflowframes{pages=none}% \settoheight{\@ff@staticH}{#1}% -\settodepth{\@ff@tmp@y}{#1} +\settodepth{\@ff@tmp@y}{#1}% \addtolength{\@ff@staticH}{\@ff@tmp@y}% -\ifdim\@ff@staticH>0pt -\onecolumnStop[\c@page]{\@ff@staticH} +\ifdim\@ff@staticH>0pt\relax +\onecolumnStop[\c@page]{\@ff@staticH}% \c@thisframe=\c@maxflow \advance\c@thisframe by -1\relax -\@onecolumn[>\c@page] +\@onecolumn[>\c@page]% \setstaticcontents{\c@maxstatic}{#1}% \else \@twocolumn @@ -1117,9 +1286,8 @@ Frames must be defined in the preamble}#1}% Ignoring \string\twocolumn\space found in document environment. Frames must be defined in the preamble}#1}% } -\AtEndDocument{\finishthispage} \newcommand{\@setcol}[1]{% -\ifnum\c@maxflow<#1 +\ifnum\c@maxflow<#1\relax \PackageError{flowfram}{Can't set frame '\number#1', doesn't exist}{}% \else @@ -1246,11 +1414,15 @@ or text might not appear correctly}% \renewcommand{\@dothefoot}{}% \renewcommand{\@dodynamicthehead}{% \@dynamicframeid{header}% -\expandafter\def\csname @dynamicframe@\romannumeral\ff@id\endcsname{\vfill\@thehead\vfill} +\expandafter +\def\csname @dynamicframe@\romannumeral\ff@id\endcsname{% +\vfill\@thehead\vfill}% }% \renewcommand{\@dodynamicthefoot}{% \@dynamicframeid{footer}% -\expandafter\def\csname @dynamicframe@\romannumeral\ff@id\endcsname{\vfill\@thefoot\vfill} +\expandafter +\def\csname @dynamicframe@\romannumeral\ff@id\endcsname{% +\vfill\@thefoot\vfill}% }% } \@onlypreamble{\makedfheaderfooter} @@ -1294,25 +1466,41 @@ or text might not appear correctly}% \newif\if@ff@moreframes \newcommand{\@ff@checkifmoreframes}{% \@ff@moreframesfalse -\@colN=0\relax +\@colN=\c@thisframe \whiledo{\@colN<\c@maxflow}{% \advance\@colN by 1\relax \edef\ff@pages{\csname @ff@pages@\romannumeral\@colN\endcsname}% -\@ff@checkpages{\ff@pages}}} -\newcommand{\@ff@checkpages}[1]{% -\@for \@ff@pp:=#1\do{% -\@ff@checkthispage{\@ff@pp}}} -\newcommand{\@ff@checkthispage}[1]{% -\ifthenelse{\equal{#1}{all}\or\equal{#1}{even}\or\equal{#1}{odd}}{% +\@ff@checkpages{\ff@pages}% +}% +\if@ff@moreframes +\else +\@ff@tmpN=\c@page +\advance\@ff@tmpN by 1\relax +\@colN=0\relax +\whiledo{\@colN<\c@thisframe}{% +\advance\@colN by 1\relax +\edef\ff@pages{\csname @ff@pages@\romannumeral\@colN\endcsname}% +\@ff@checkpages[\@ff@tmpN]{\ff@pages}% +}% +\fi +} +\newcommand{\@ff@checkpages}[2][\c@page]{% +\@for\@ff@pp:=#2\do{% +\@ff@checkthispage{#1}{\@ff@pp}}} +\newcommand{\@ff@checkthispage}[2]{% +\ifthenelse{\equal{#2}{all}\or\equal{#2}{even}\or\equal{#2}{odd}}{% \@ff@moreframestrue}{% -\ifthenelse{\equal{#1}{none}}{}{% -\@ff@checknumrange{#1}}}} -\newcommand{\@ff@checknumrange}[1]{% +\ifthenelse{\equal{#2}{none}}{}{% +\@ff@checknumrange{#1}{#2}}}} +\newcommand{\@ff@checknumrange}[2]{% \def\@ff@numstart{0}\def\@ff@numend{10000}% -\@ff@getrange{#1}% -\ifnum\@ff@numend>\c@page +\@ff@getrange{#2}% +\ifnum\@ff@numend>#1\relax \@ff@moreframestrue \else +\ifnum\@ff@numend=#1\relax +\@ff@moreframestrue +\fi \fi } \newcount\c@ffrangenum @@ -1340,7 +1528,7 @@ or text might not appear correctly}% \edef\@ff@numstart{\number\c@ffrangenum}% \def\@ff@numend{10000}} \def\@@ff@getrange#1-#2\end{% -\ifx\relax#2 +\ifx\relax#2\relax \def\@ff@numstart{#1}\def\@ff@numend{#1}% \else \def\@ff@numstart{#1}% @@ -1366,9 +1554,12 @@ adding new one}% \@colN=#1\relax \c@curpg=\c@page \loop -\ifnum\@colN=\c@maxflow\@colN=1\@ff@nwpgtrue -\advance\c@curpg by 1\relax -\else\advance\@colN by 1\fi +\ifnum\@colN=\c@maxflow + \@colN=1\@ff@nwpgtrue + \advance\c@curpg by 1\relax +\else + \advance\@colN by 1\relax +\fi \@ff@chckifthispg{\c@curpg}{\@colN}% \if@notthiscol \repeat @@ -1415,7 +1606,7 @@ adding new one}% \edef\ff@txtcol{\csname @ff@txtcol@\romannumeral#1\endcsname}% \edef\ff@backcol{\csname @ff@backcol@\romannumeral#1\endcsname}% \@ff@setoffset{#1}% -\rotateframe{\csname @ff@angle@\romannumeral#1\endcsname}{ +\rotateframe{\csname @ff@angle@\romannumeral#1\endcsname}{% \ifthenelse{\boolean{columnframe\romannumeral#1}}{% \@ff@fbox{\csname colwidth\romannumeral#1\endcsname}% {\csname colheight\romannumeral#1\endcsname}{% @@ -1633,7 +1824,8 @@ adding new one}% }% } \def\@ff@getstaticpos[#1][#2][#3]#4{\@ff@tmp@x=#4\relax -\@ff@tmp@y=#2} +\@ff@tmp@y=#2\relax +\def\ff@valign{#3}} \newcommand{\@dostaticbox}[1]{% \edef\ff@frametype{% \csname @sf@frametype@\romannumeral#1\endcsname}% @@ -1718,6 +1910,36 @@ adding new one}% \ifthenelse{\boolean{@df@clear@\romannumeral\@colN}}{% \expandafter\global\expandafter \gdef\csname @dynamicframe@\romannumeral\@colN\endcsname{}}{}}} +\newcommand{\@dodfparbox}[1]{% +\expandafter\let\expandafter +\@ff@parshape\csname @df@shape@\romannumeral#1\endcsname +\expandafter\@ff@getshape\@ff@parshape\relax +\ifcase\ff@shape +\expandafter\expandafter\expandafter +\parbox\csname @df@dim@\romannumeral#1\endcsname +{% +\setlength\parindent\sdfparindent +\csname\ff@style\endcsname{\ff@contents}}% +\or +\expandafter\expandafter\expandafter +\parbox\csname @df@dim@\romannumeral#1\endcsname +{% +\setlength\parindent\sdfparindent +\csname\ff@style\endcsname{{% +\let\oldpar=\par +\let\par=\ffpshpar +\@ff@setsecthead +\@ff@parshape +\ff@contents\oldpar}}}% +\or +\expandafter\expandafter\expandafter +\parbox\csname @df@dim@\romannumeral#1\endcsname +{% +\setlength\parindent\sdfparindent +\csname\ff@style\endcsname{{\@ff@disablesec\@ff@parshape +\ff@contents\par}}}% +\fi +} \newcommand{\@dodynamicbox}[1]{% \edef\ff@frametype{% \csname @df@frametype@\romannumeral#1\endcsname}% @@ -1732,15 +1954,11 @@ adding new one}% \rotateframe{\csname @df@angle@\romannumeral#1\endcsname}{% \ifthenelse{\boolean{dynamicframe\romannumeral#1}}{% \@ff@fbox{\@ff@tmp@x}{\@ff@tmp@y}% -{\expandafter\expandafter\expandafter -\parbox\csname @df@dim@\romannumeral#1\endcsname -{\csname\ff@style\endcsname{\ff@contents}}}% +{\@dodfparbox{#1}}% {\csname\ff@frametype\endcsname}% }{% \@ff@box{\@ff@tmp@x}{\@ff@tmp@y}{% -\expandafter\expandafter\expandafter -\parbox\csname @df@dim@\romannumeral#1\endcsname -{\csname \ff@style\endcsname{\ff@contents}}}% +\@dodfparbox{#1}}% }}} \newcommand{\@dodynamicbbox}[1]{% \edef\ff@col{}% @@ -1850,14 +2068,18 @@ adding new one}% \vbox to \textheight{\hbox to \textwidth{}}}{}}} \newlength\ffevenoffset \newcommand{\@ff@do@allframes}{% +\ffevenoffset=0pt\relax \if@twoside \ifodd\c@page \else -\ffevenoffset=-\oddsidemargin -\advance\ffevenoffset by \evensidemargin -\kern\ffevenoffset +\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 +\makebox[\@ff@tmp@x][l]{% \@s@tfr@mes{% \@ff@doallstatics \@@doheader @@ -1875,7 +2097,7 @@ adding new one}% \ifshowmargins \@ff@drawmargins \fi -}} +}}} \newcount\@nxtcol \def\@outputdblcol{% \@nxtcol=\c@thisframe @@ -1886,7 +2108,7 @@ adding new one}% \@setcolbox\c@thisframe \if@specialpage \global\@specialpagefalse - \@nameuse{ps@\@specialstyle} + \@nameuse{ps@\@specialstyle}\relax \fi \if@twoside \ifodd\count\z@ @@ -1974,7 +2196,7 @@ adding new one}% \ifcase#2 \PackageError{flowfram}{% You have requested 0 flowframes!}{% -It does not make much sense to ask to create 0 flow frames} +It does not make much sense to ask to create 0 flow frames}% \or \onecolumninarea[#1]{#3}{#4}{#5}{#6}% \or @@ -2268,7 +2490,7 @@ which really doesn't make sense}% \if@twoside \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}% @@ -2473,7 +2695,9 @@ which really doesn't make sense}% \ifthenelse{\equal{#5}{}}{% \newstaticframe[#1]{#2}{\@ff@staticH}{\@ff@tmp@x}{\@ff@tmp@y}}% {\newstaticframe[#1]{#2}{\@ff@staticH}{\@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@y}{\@ff@staticH}% } @@ -2486,7 +2710,8 @@ which really doesn't make sense}% \advance\@thisstrip by -1\relax \next} -\newcommand{\@@nexthNband}[3]{\@nexthband{\ff@pages}{\@ff@staticW}{#1}{#2}{#3}\@nexthNband} +\newcommand{\@@nexthNband}[3]{% +\@nexthband{\ff@pages}{\@ff@staticW}{#1}{#2}{#3}\@nexthNband} \newcommand{\makebackgroundframe}[1][all]{% \ifnum\c@maxstatic>0\relax \PackageWarning{flowfram}{Background frame is not @@ -2985,7 +3210,7 @@ Unknown section type '#3'}{}}{% \@ff@tmpN=0\relax \whiledo{\@ff@tmpN<\c@maxthumbtabs}{% \advance\@ff@tmpN by 1\relax -\@greyscale=\@ff@tmpN +\@greyscale=\@ff@tmpN\relax \multiply\@greyscale by 60\relax \divide\@greyscale by \c@maxthumbtabs \advance\@greyscale by 25\relax @@ -3182,11 +3407,11 @@ ttb file may not be up-to-date}}{% }% \fi \@ifundefined{@toc@\romannumeral#2}{% -\ta=\expandafter{#1}% -\expandafter\xdef\csname @toc@\romannumeral#2\endcsname{\the\ta}}{% -\ta=\expandafter{#1}% -\tb=\expandafter\expandafter\expandafter{\csname @toc@\romannumeral#2\endcsname}% -\expandafter\xdef\csname @toc@\romannumeral#2\endcsname{\the\tb\the\ta}}% +\flf@ta=\expandafter{#1}% +\expandafter\xdef\csname @toc@\romannumeral#2\endcsname{\the\flf@ta}}{% +\flf@ta=\expandafter{#1}% +\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}{% @@ -3197,9 +3422,9 @@ ttb file may not be up-to-date}}{% \expandafter\gdef\csname @minitoc@\romannumeral\c@maxminitoc\endcsname{}\relax \else \ifnum\@ttb@level>\@ttb@minitoclevel - \ta=\expandafter{#1}\relax - \tb=\expandafter\expandafter\expandafter{\csname @minitoc@\romannumeral\c@maxminitoc\endcsname}\relax - \expandafter\xdef\csname @minitoc@\romannumeral\c@maxminitoc\endcsname{\the\tb\the\ta} + \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 -- cgit v1.2.3