From 39e028ec9200b17474c8bc3c38aee237705bc2d7 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 18 Dec 2018 23:32:36 +0000 Subject: continue (18dec18) git-svn-id: svn://tug.org/texlive/trunk@49449 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/continue/README | 15 +- Master/texmf-dist/doc/latex/continue/continue.pdf | Bin 286603 -> 313820 bytes .../texmf-dist/doc/latex/continue/trycontinue.pdf | Bin 52306 -> 51700 bytes .../texmf-dist/doc/latex/continue/trycontinue.tex | 31 +-- .../texmf-dist/source/latex/continue/continue.dtx | 216 +++++++++++++-------- .../texmf-dist/source/latex/continue/continue.ins | 6 +- Master/texmf-dist/tex/latex/continue/continue.sty | 125 +++++++----- 7 files changed, 248 insertions(+), 145 deletions(-) diff --git a/Master/texmf-dist/doc/latex/continue/README b/Master/texmf-dist/doc/latex/continue/README index 7f468417be5..32e0df05563 100644 --- a/Master/texmf-dist/doc/latex/continue/README +++ b/Master/texmf-dist/doc/latex/continue/README @@ -1,15 +1,20 @@ The continue package provides for a variety of continuation indicators -on recto (odd numbered) pages in a twosided document when the text -continues on the following (verso) page. +by default on recto (odd numbered) pages in a twosided document when the text +continues on the following (verso) page. All pages may be marked and the marking +stopped and started. Changes in version 0.1 (2015/12/09) o First public release +Changes in version 0.2 (2018/12/09) +o Second public release +o All pages may be marked +o Marking can be stopped and started ------------------------------------------------------------------ Author: Peter Wilson (Herries Press) herries dot press at earthlink dot net with Donald Arseneau and Luca Merciadri - Copyright 2015 Peter R. Wilson, Donald Arseneau, Luca Merciadri + Copyright 2015, 2018 Peter R. Wilson, Donald Arseneau, Luca Merciadri This work may be distributed and/or modified under the conditions of the Latex Project Public License, either @@ -20,7 +25,7 @@ o First public release and version 1.3 or later is part of all distributions of LaTeX version 2003/06/01 or later. - This work has the LPPL maintenance status "author-maintained". + This work has the LPPL maintenance status "unmaintained". This work consists of the files: README (this file) @@ -57,7 +62,7 @@ o (for an index run: makeindex -s gind.ist *.idx) o run: (pdf)latex *.dtx o Print *.(pdf|dvi) for a hardcopy of the package manual -2015/12/09 +2018/12/09 Peter Wilson herries dot press at earthlink dot net diff --git a/Master/texmf-dist/doc/latex/continue/continue.pdf b/Master/texmf-dist/doc/latex/continue/continue.pdf index 2b5b6ba9d46..1ed6529ecce 100644 Binary files a/Master/texmf-dist/doc/latex/continue/continue.pdf and b/Master/texmf-dist/doc/latex/continue/continue.pdf differ diff --git a/Master/texmf-dist/doc/latex/continue/trycontinue.pdf b/Master/texmf-dist/doc/latex/continue/trycontinue.pdf index cdd34e8a636..09ff3ddbec6 100644 Binary files a/Master/texmf-dist/doc/latex/continue/trycontinue.pdf and b/Master/texmf-dist/doc/latex/continue/trycontinue.pdf differ diff --git a/Master/texmf-dist/doc/latex/continue/trycontinue.tex b/Master/texmf-dist/doc/latex/continue/trycontinue.tex index fbead98005c..97596f85b9e 100644 --- a/Master/texmf-dist/doc/latex/continue/trycontinue.tex +++ b/Master/texmf-dist/doc/latex/continue/trycontinue.tex @@ -7,7 +7,7 @@ %% continue.dtx (with options: `try') %% ------------------------------------------------------------------ %% Author: Peter Wilson (Herries Press) herries dot press at earthlink dot net -%% Copyright 2015 Peter R. Wilson, Donald Arseneau, Luca Merciadri +%% Copyright 2015, 2018 Peter R. Wilson, Donald Arseneau, Luca Merciadri %% %% This work may be distributed and/or modified under the %% conditions of the Latex Project Public License, either @@ -18,24 +18,23 @@ %% and version 1.3 or later is part of all distributions of %% LaTeX version 2003/06/01 or later. %% -%% This work has the LPPL maintenance status "author-maintained". +%% This work has the LPPL maintenance status "unmaintained". %% %% This work consists of the files listed in the README file. %% ------------------------------------------------------------------ -%% trycontinue.tex An example usage of the continue package +%% trycontinue.tex An example usage of the continue package (2018/12/09) %% -%% The document is set in two columns with footnotes on A6 paper (I wanted +%% The document is set with footnotes on A6 paper (I wanted %% to get many pages from little text). It is not pretty but does shows %% some of the continue package's capabilities. Try modifying it by changing %% options, etc., and see what happens. %% -%% Please contact me, Peter Wilson at herries.press@earthlink.net, if there +%% You can try and contact me, Peter Wilson at herries.press@earthlink.net, if there %% are problems other than the aesthetics. %% \documentclass[% twoside, - twocolumn, a6paper ]% {memoir} @@ -43,7 +42,8 @@ \usepackage% %% [margin]% %% [word]% - [margin,word]% +%% [margin,word]% + [margin,word,allpages]% {continue} \usepackage{lipsum} %% try this without the word option @@ -53,20 +53,21 @@ \begin{document} -\newcommand{\Footnote}[1]{} -\let\Footnote\footnote +First\footnote{Foot 1} \lipsum[1] -First\Footnote{Foot 1} \lipsum[1] +Second\footnote{Foot 2} \lipsum[2] -Second\Footnote{Foot 2} \lipsum[2] +Third\footnote{Foot 3} \lipsum[3] -Third\Footnote{Foot 3} \lipsum[3] +\contstop % stop marking -Fourth\Footnote{Foot 4} \lipsum[4] +Fourth\footnote{Foot 4} \lipsum[4] -Fifth\Footnote{Foot 5} \lipsum[5] +Fifth\footnote{Foot 5} \lipsum[5] -Sixth\Footnote{Foot 6} \lipsum[6] +\contgo % start marking + +Sixth\footnote{Foot 6} \lipsum[6] \end{document} diff --git a/Master/texmf-dist/source/latex/continue/continue.dtx b/Master/texmf-dist/source/latex/continue/continue.dtx index 6b44d0255db..8cc5863465c 100644 --- a/Master/texmf-dist/source/latex/continue/continue.dtx +++ b/Master/texmf-dist/source/latex/continue/continue.dtx @@ -3,7 +3,7 @@ % continue.dtx % % Author: Peter Wilson (Herries Press) herries dot press at earthlink dot net -% Copyright 2015 Peter R. Wilson, Donald Arseneau and Merciadri Luca +% Copyright 2015, 2018 Peter R. Wilson, Donald Arseneau and Merciadri Luca % % This work may be distributed and/or modified under the % conditions of the Latex Project Public License, either @@ -14,7 +14,7 @@ % and version 1.3 or later is part of all distributions of % LaTeX version 2003/06/01 or later. % -% This work has the LPPL maintenance status "author-maintained". +% This work has the LPPL maintenance status "unmaintained". % % This work consists of the files listed in the README file. % @@ -84,6 +84,8 @@ % \def\dtxfile{continue.dtx} % \changes{v0.1}{2015/12/09}{First trial release} % \def\fileversion{v0.1} \def\filedate{2015/12/09} +% \changes{v0.2}{2018/12/09}{Second trial release, markers can be on all pages and stopped and started at will} +% \def\fileversion{v0.2} \def\filedate{2018/12/09} % ^^A Flag an option % \makeatletter @@ -136,7 +138,7 @@ % \newcommand{\BC}{\textsc{bc}} % \newcommand{\AD}{\textsc{ad}} % -% \title{\Lpack{Continue}: Continuation marks on recto (odd) pages\thanks{This +% \title{\Lpack{Continue}: Continuation marks on (by default odd) pages\thanks{This % file (\texttt{\dtxfile}) has version number \fileversion, last revised % \filedate.}} % @@ -149,8 +151,9 @@ % \maketitle % \begin{abstract} % The \Lpack{continue} package provides for a variety of continuation indicators on -% recto (odd numbered) pages in a twosided document when the text continues on the following -% (verso) page. +% pages in a twosided document when the text continues on the following +% page. The default is to only mark odd pages but all pages can be marked or marking +% can be stopped or started at any point. % \end{abstract} % \tableofcontents % @@ -200,7 +203,7 @@ % % \subsection{Options} % -% There are two options that can be used when calling the package denoting the +% There are three options that can be used when calling the package denoting the % kind and position of the continuation marker. % % \DescribeOption{margin} @@ -213,6 +216,11 @@ % verso page as the continuation marker. If the option is not used then a user % specified marker is employed. % +% \DescribeOption{allpages} +% With this option the package tries to provide a marker on each page, whether +% odd or even. +% The default is to only provide markers on odd pages. +% % The relevant portions of the introduction to the \Lpack{fwlw} package are: \\ % \begin{quotation} % The \Lpack{fwlw} package provides a mechanism to determine ... @@ -237,7 +245,9 @@ % \end{quotation} % % In essence, the `word' might not be what you might expect, but for most documents -% the results are good. +% the results are good. However, page~3 of the example file |trycontinue.tex| prints +% a blank word as the continuation marker because the first line on the following +% page is the start of a paragraph which starts with a space. % % % @@ -262,8 +272,8 @@ % % \DescribeMacro{\flagword} % This command specifies how the continuation word is formated. Its definition is: \\ -% |\newcommand*{\flagword}{\preflagword\usebox\NextWordBoxC\postflagword}| \\ -% where |\NextWordBoxC| holds the first word on the next recto page (empty if there +% |\newcommand*{\flagword}{\preflagword\usebox\NextWordBox\postflagword}| \\ +% where |\NextWordBox| holds the first word on the next recto page (empty if there % is no next recto page). % % \DescribeMacro{\preflagword} @@ -294,19 +304,18 @@ % % \begin{macrocode} %<*try> -%% trycontinue.tex An example usage of the continue package +%% trycontinue.tex An example usage of the continue package (2018/12/09) %% -%% The document is set in two columns with footnotes on A6 paper (I wanted +%% The document is set with footnotes on A6 paper (I wanted %% to get many pages from little text). It is not pretty but does shows %% some of the continue package's capabilities. Try modifying it by changing %% options, etc., and see what happens. %% -%% Please contact me, Peter Wilson at herries.press@earthlink.net, if there +%% You can try and contact me, Peter Wilson at herries.press@earthlink.net, if there %% are problems other than the aesthetics. %% \documentclass[% twoside, - twocolumn, a6paper ]% {memoir} @@ -314,7 +323,8 @@ \usepackage% %% [margin]% %% [word]% - [margin,word]% +%% [margin,word]% + [margin,word,allpages]% {continue} \usepackage{lipsum} %% try this without the word option @@ -324,20 +334,21 @@ \begin{document} -\newcommand{\Footnote}[1]{} -\let\Footnote\footnote +First\footnote{Foot 1} \lipsum[1] + +Second\footnote{Foot 2} \lipsum[2] -First\Footnote{Foot 1} \lipsum[1] +Third\footnote{Foot 3} \lipsum[3] -Second\Footnote{Foot 2} \lipsum[2] +\contstop % stop marking -Third\Footnote{Foot 3} \lipsum[3] +Fourth\footnote{Foot 4} \lipsum[4] -Fourth\Footnote{Foot 4} \lipsum[4] +Fifth\footnote{Foot 5} \lipsum[5] -Fifth\Footnote{Foot 5} \lipsum[5] +\contgo % start marking -Sixth\Footnote{Foot 6} \lipsum[6] +Sixth\footnote{Foot 6} \lipsum[6] \end{document} @@ -348,11 +359,12 @@ Sixth\Footnote{Foot 6} \lipsum[6] % % Announce the name and version of the package, which requires % \LaTeXe{} and the \Lpack{atbegshi}, \Lpack{picture}, \Lpack{zref-abspage} and -% \Lpack{zref-lastpage} packages and has options \Lopt{margin} and \Lopt{word}. +% \Lpack{zref-lastpage} packages and has options \Lopt{margin}, \Lopt{word} and \Lopt{allpages} +% (added \Lopt{allpages} 2018/11/30). % \begin{macrocode} %<*usc> \NeedsTeXFormat{LaTeX2e} - \ProvidesPackage{continue}[2015/12/04 v0.1 Continues on the following page] + \ProvidesPackage{continue}[2018/12/09 v0.2 Continues on the following page] \PackageInfo{continue}{This is continue using e-TeX.} % \end{macrocode} @@ -362,14 +374,31 @@ Sixth\Footnote{Foot 6} \lipsum[6] % \begin{macrocode} \newif{\ifcontmargin} \contmarginfalse \newif{\ifcontword} \contwordfalse + \newif{\ifcontallpages} \contallpagesfalse \DeclareOption{margin}{\contmargintrue} \DeclareOption{word}{\contwordtrue} + \DeclareOption{allpages}{\contallpagestrue} \ProcessOptions % \end{macrocode} % \end{macro} % \end{macro} % +% \begin{macro}{\ifc@go} +% \begin{macro}{\contgo} +% \begin{macro}{\contstop} +% Continuation marks will stop after |\contstop| but will continue after |\contgo| +% (the default) +% \begin{macrocode} +\newif{\ifc@go} \c@gotrue +\newcommand{\contgo}{\c@gotrue} +\newcommand{\contstop}{\c@gofalse} + +% \end{macrocode}% +% \end{macro} +% \end{macro} +% \end{macro} +% % And the required packages needed by the original \Lpack{turnpageetex} package. % % \begin{macrocode} @@ -386,7 +415,6 @@ Sixth\Footnote{Foot 6} \lipsum[6] % % \begin{macrocode} % -------------------------------------------------------------------------- - \ifcontword % % \end{macrocode} % @@ -397,16 +425,16 @@ Sixth\Footnote{Foot 6} \lipsum[6] % \end{macrocode} % \end{macro} % -% \begin{macro}{\FirstWordBoxC} -% \begin{macro}{\NextWordBoxC} -% \begin{macro}{\LastWordBoxC} +% \begin{macro}{\FirstWordBox} +% \begin{macro}{\NextWordBox} +% \begin{macro}{\LastWordBox} % \begin{macro}{\LWC@box} % \begin{macro}{\LWC@saved} % Allocate box registers % \begin{macrocode} - \newbox\FirstWordBoxC \global\setbox\FirstWordBoxC\hbox{} - \newbox\NextWordBoxC \global\setbox\NextWordBoxC\hbox{} - \newbox\LastWordBoxC \global\setbox\LastWordBoxC\hbox{} + \newbox\FirstWordBox \global\setbox\FirstWordBox\hbox{} + \newbox\NextWordBox \global\setbox\NextWordBox\hbox{} + \newbox\LastWordBox \global\setbox\LastWordBox\hbox{} \newbox\LWC@box \global\setbox\LWC@box\hbox{} \newbox\LWC@saved % \end{macrocode} @@ -441,7 +469,7 @@ Sixth\Footnote{Foot 6} \lipsum[6] \setbox\@tempboxa\vbox{\unvbox\@cclv \unskip\unkern\unpenalty% \unskip\unkern\unpenalty \unskip\unkern\unpenalty \setbox\@tempboxa\lastbox - \LWC@getlast@word\@tempboxa\LastWordBoxC + \LWC@getlast@word\@tempboxa\LastWordBox } %\end{comment} \ifnum\outputpenalty>-\@MM % not \supereject @@ -451,22 +479,22 @@ Sixth\Footnote{Foot 6} \lipsum[6] \else % \supereject, just output, don't look for word on next page % \message{caused by super-eject.} \global\setbox\@cclv\box\LWC@saved - \global\setbox\NextWordBoxC\hbox{}% + \global\setbox\NextWordBox\hbox{}% \FWLWCnorm@L@output - \global\setbox\FirstWordBoxC\box\NextWordBoxC + \global\setbox\FirstWordBox\box\NextWordBox \fi \else % saved page => just did tiny page to get next word % \message{Just got next line:}{\tracingall\showboxdepth2 \showbox\@cclv}% \setbox\@tempboxa\vbox{\penalty\LWC@pen\unvcopy\@cclv \LWC@getall@boxes \ifvbox\LWC@box \penalty\LWC@pen\unvbox\LWC@box \LWC@getall@boxes\fi - \ifvbox\LWC@box \global\setbox\NextWordBoxC\hbox{}\else - \LWC@getfirst@word\LWC@box\NextWordBoxC + \ifvbox\LWC@box \global\setbox\NextWordBox\hbox{}\else + \LWC@getfirst@word\LWC@box\NextWordBox \fi}% Return tiny page to page list: \unvbox\@cclv \ifnum\outputpenalty<\@M \penalty\outputpenalty\fi \LWC@vsize\relax \global\setbox\@cclv\box\LWC@saved \FWLWCnorm@L@output - \global\setbox\FirstWordBoxC\box\NextWordBoxC + \global\setbox\FirstWordBox\box\NextWordBox \fi\fi} % \end{macrocode} @@ -526,10 +554,6 @@ Sixth\Footnote{Foot 6} \lipsum[6] \else\ifvbox\LWC@box\box\LWC@box\fi\fi}} % \end{macrocode} % \end{macro} -% Now finish with the fwlw code when it is not needed. -% \begin{macrocode} - \fi -% \end{macrocode} % % The next chunk of code is a revised version of the original \Lpack{turnpageetex} package. % \begin{macrocode} @@ -552,7 +576,7 @@ Sixth\Footnote{Foot 6} \lipsum[6] \newcommand*{\postflagword}{} \newcommand*{\flagcont}{Continued} \newcommand*{\flagend}{End} - \newcommand*{\flagword}{\preflagword\usebox\NextWordBoxC\postflagword} + \newcommand*{\flagword}{\preflagword\usebox\NextWordBox\postflagword} \newlength{\contsep}\setlength{\contsep}{\marginparsep} \newlength{\contdrop}\setlength{\contdrop}{0.5\footskip} % \end{macrocode} @@ -571,47 +595,87 @@ Sixth\Footnote{Foot 6} \lipsum[6] % \end{macro} % \end{macro} % -% +% \begin{macro}{\c@ntoddpagepos} +% |\c@ntoddpagepos| calculates the position of the marker on odd pages. +% \begin{macrocode} + \newcommand{\c@ntoddpagepos}{% + \dimen1=1in + \advance\dimen1 by \textwidth + \advance\dimen1 by \oddsidemargin + \dimen3=1in + \advance\dimen3 by \topmargin + \advance\dimen3 by \headheight + \advance\dimen3 by \headsep + \advance\dimen3 by \textheight + \ifcontmargin + \advance\dimen1 by \contsep + \else + \advance\dimen3 by \contdrop + \fi + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\c@ntevenpagepos} +% |\c@ntevenpagepos| calculates the position of the marker on even pages. % \begin{macrocode} - \AtBeginShipout{% - \AtBeginShipoutUpperLeft{% + \newcommand{\c@ntevenpagepos}{% + \dimen1=1in + \advance\dimen1 by \textwidth + \advance\dimen1 by \evensidemargin + \dimen3=1in + \advance\dimen3 by \topmargin + \advance\dimen3 by \headheight + \advance\dimen3 by \headsep + \advance\dimen3 by \textheight + \ifcontmargin + \advance\dimen1 by \contsep + \else + \advance\dimen3 by \contdrop + \fi + } % \end{macrocode} +% \end{macro} % -% Specify the location of the continuation marks. % +% \begin{macro}{\c@outcontpage} +% Output continued marked page. % \begin{macrocode} - \ifodd\c@page - \dimen1=1in - \advance\dimen1 by \textwidth - \advance\dimen1 by \oddsidemargin - \dimen3=1in - \advance\dimen3 by \topmargin - \advance\dimen3 by \headheight - \advance\dimen3 by \headsep - \advance\dimen3 by \textheight - \ifcontmargin - \advance\dimen1 by \contsep - \else - \advance\dimen3 by \contdrop - \fi +\newcommand{\c@outcontpage}{% + \ifnum\zref@extract{LastPage}{abspage}>\c@abspage + \ifcontmargin + \put(\dimen1,-\dimen3){{\flagcont}}% + \else + \put(\dimen1,-\dimen3){\llap{\flagcont}}% + \fi + \else + \ifcontmargin + \put(\dimen1,-\dimen3){{\flagend}}% + \else + \put(\dimen1,-\dimen3){\llap{\flagend}}% + \fi + \fi +}% end of \c@outcontpage % \end{macrocode} -% Otput the page and marks. +% \end{macro} +% +% Output the page and marks. % \begin{macrocode} - \ifnum\zref@extract{LastPage}{abspage}>\c@abspage - \ifcontmargin - \put(\dimen1,-\dimen3){{\flagcont}}% - \else - \put(\dimen1,-\dimen3){\llap{\flagcont}}% - \fi - \else - \ifcontmargin - \put(\dimen1,-\dimen3){{\flagend}}% - \else - \put(\dimen1,-\dimen3){\llap{\flagend}}% - \fi - \fi% - \fi% -}} +\AtBeginShipout{% +\AtBeginShipoutUpperLeft{% + \ifc@go + \ifodd\c@page + \c@ntoddpagepos + \c@outcontpage + \else + \ifcontallpages + \c@ntevenpagepos + \c@outcontpage + \fi + \fi + \fi +} % end AtBeginShipoutUpperLeft +} % end AtBeginShipout % % % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/continue/continue.ins b/Master/texmf-dist/source/latex/continue/continue.ins index 1cfc3f2435d..513849aa3b7 100644 --- a/Master/texmf-dist/source/latex/continue/continue.ins +++ b/Master/texmf-dist/source/latex/continue/continue.ins @@ -11,7 +11,7 @@ %% and version 1.3 or later is part of all distributions of %% LaTeX version 2003/06/01 or later. %% -%% This work has the LPPL maintenance status "author-maintained". +%% This work has the LPPL maintenance status "unmaintained". %% %% This work consists of the files listed in the README file. %% @@ -25,7 +25,7 @@ \preamble ------------------------------------------------------------------ Author: Peter Wilson (Herries Press) herries dot press at earthlink dot net - Copyright 2015 Peter R. Wilson, Donald Arseneau, Luca Merciadri + Copyright 2015, 2018 Peter R. Wilson, Donald Arseneau, Luca Merciadri This work may be distributed and/or modified under the conditions of the Latex Project Public License, either @@ -36,7 +36,7 @@ and version 1.3 or later is part of all distributions of LaTeX version 2003/06/01 or later. - This work has the LPPL maintenance status "author-maintained". + This work has the LPPL maintenance status "unmaintained". This work consists of the files listed in the README file. ------------------------------------------------------------------ diff --git a/Master/texmf-dist/tex/latex/continue/continue.sty b/Master/texmf-dist/tex/latex/continue/continue.sty index c5bed136d4d..859de04ba0a 100644 --- a/Master/texmf-dist/tex/latex/continue/continue.sty +++ b/Master/texmf-dist/tex/latex/continue/continue.sty @@ -7,7 +7,7 @@ %% continue.dtx (with options: `usc') %% ------------------------------------------------------------------ %% Author: Peter Wilson (Herries Press) herries dot press at earthlink dot net -%% Copyright 2015 Peter R. Wilson, Donald Arseneau, Luca Merciadri +%% Copyright 2015, 2018 Peter R. Wilson, Donald Arseneau, Luca Merciadri %% %% This work may be distributed and/or modified under the %% conditions of the Latex Project Public License, either @@ -18,31 +18,36 @@ %% and version 1.3 or later is part of all distributions of %% LaTeX version 2003/06/01 or later. %% -%% This work has the LPPL maintenance status "author-maintained". +%% This work has the LPPL maintenance status "unmaintained". %% %% This work consists of the files listed in the README file. %% ------------------------------------------------------------------ \NeedsTeXFormat{LaTeX2e} - \ProvidesPackage{continue}[2015/12/04 v0.1 Continues on the following page] + \ProvidesPackage{continue}[2018/12/09 v0.2 Continues on the following page] \PackageInfo{continue}{This is continue using e-TeX.} \newif{\ifcontmargin} \contmarginfalse \newif{\ifcontword} \contwordfalse + \newif{\ifcontallpages} \contallpagesfalse \DeclareOption{margin}{\contmargintrue} \DeclareOption{word}{\contwordtrue} + \DeclareOption{allpages}{\contallpagestrue} \ProcessOptions +\newif{\ifc@go} \c@gotrue +\newcommand{\contgo}{\c@gotrue} +\newcommand{\contstop}{\c@gofalse} + \RequirePackage{atbegshi} \RequirePackage{picture} \RequirePackage{zref-abspage} \RequirePackage{zref-lastpage} - \ifcontword \mathchardef\LWC@pen 13452 - \newbox\FirstWordBoxC \global\setbox\FirstWordBoxC\hbox{} - \newbox\NextWordBoxC \global\setbox\NextWordBoxC\hbox{} - \newbox\LastWordBoxC \global\setbox\LastWordBoxC\hbox{} + \newbox\FirstWordBox \global\setbox\FirstWordBox\hbox{} + \newbox\NextWordBox \global\setbox\NextWordBox\hbox{} + \newbox\LastWordBox \global\setbox\LastWordBox\hbox{} \newbox\LWC@box \global\setbox\LWC@box\hbox{} \newbox\LWC@saved \edef\FWLWCnorm@L@output{\the\output} @@ -57,7 +62,7 @@ \setbox\@tempboxa\vbox{\unvbox\@cclv \unskip\unkern\unpenalty% \unskip\unkern\unpenalty \unskip\unkern\unpenalty \setbox\@tempboxa\lastbox - \LWC@getlast@word\@tempboxa\LastWordBoxC + \LWC@getlast@word\@tempboxa\LastWordBox } \ifnum\outputpenalty>-\@MM % not \supereject \xdef\LWC@vsize{\global\vsize\the\vsize @@ -65,21 +70,21 @@ \global\vsize\z@ \global\holdinginserts\@ne \else % \supereject, just output, don't look for word on next page \global\setbox\@cclv\box\LWC@saved - \global\setbox\NextWordBoxC\hbox{}% + \global\setbox\NextWordBox\hbox{}% \FWLWCnorm@L@output - \global\setbox\FirstWordBoxC\box\NextWordBoxC + \global\setbox\FirstWordBox\box\NextWordBox \fi \else % saved page => just did tiny page to get next word \setbox\@tempboxa\vbox{\penalty\LWC@pen\unvcopy\@cclv \LWC@getall@boxes \ifvbox\LWC@box \penalty\LWC@pen\unvbox\LWC@box \LWC@getall@boxes\fi - \ifvbox\LWC@box \global\setbox\NextWordBoxC\hbox{}\else - \LWC@getfirst@word\LWC@box\NextWordBoxC + \ifvbox\LWC@box \global\setbox\NextWordBox\hbox{}\else + \LWC@getfirst@word\LWC@box\NextWordBox \fi}% Return tiny page to page list: \unvbox\@cclv \ifnum\outputpenalty<\@M \penalty\outputpenalty\fi \LWC@vsize\relax \global\setbox\@cclv\box\LWC@saved \FWLWCnorm@L@output - \global\setbox\FirstWordBoxC\box\NextWordBoxC + \global\setbox\FirstWordBox\box\NextWordBox \fi\fi} \def\LWC@getlast@word#1#2{\setbox\@tempboxa\vbox{\hsize\maxdimen \@parboxrestore @@ -110,49 +115,77 @@ \def\LWC@repack#1{\global\setbox#1\hbox{\ifhbox\LWC@box \unhbox\LWC@box\unskip\unskip\unpenalty\unskip \else\ifvbox\LWC@box\box\LWC@box\fi\fi}} - \fi \newcommand*{\preflagword}{} \newcommand*{\postflagword}{} \newcommand*{\flagcont}{Continued} \newcommand*{\flagend}{End} - \newcommand*{\flagword}{\preflagword\usebox\NextWordBoxC\postflagword} + \newcommand*{\flagword}{\preflagword\usebox\NextWordBox\postflagword} \newlength{\contsep}\setlength{\contsep}{\marginparsep} \newlength{\contdrop}\setlength{\contdrop}{0.5\footskip} \ifcontword \let\flagcont\flagword \fi - \AtBeginShipout{% - \AtBeginShipoutUpperLeft{% - \ifodd\c@page - \dimen1=1in - \advance\dimen1 by \textwidth - \advance\dimen1 by \oddsidemargin - \dimen3=1in - \advance\dimen3 by \topmargin - \advance\dimen3 by \headheight - \advance\dimen3 by \headsep - \advance\dimen3 by \textheight - \ifcontmargin - \advance\dimen1 by \contsep - \else - \advance\dimen3 by \contdrop - \fi - \ifnum\zref@extract{LastPage}{abspage}>\c@abspage - \ifcontmargin - \put(\dimen1,-\dimen3){{\flagcont}}% - \else - \put(\dimen1,-\dimen3){\llap{\flagcont}}% - \fi - \else - \ifcontmargin - \put(\dimen1,-\dimen3){{\flagend}}% - \else - \put(\dimen1,-\dimen3){\llap{\flagend}}% - \fi - \fi% - \fi% -}} + \newcommand{\c@ntoddpagepos}{% + \dimen1=1in + \advance\dimen1 by \textwidth + \advance\dimen1 by \oddsidemargin + \dimen3=1in + \advance\dimen3 by \topmargin + \advance\dimen3 by \headheight + \advance\dimen3 by \headsep + \advance\dimen3 by \textheight + \ifcontmargin + \advance\dimen1 by \contsep + \else + \advance\dimen3 by \contdrop + \fi + } + \newcommand{\c@ntevenpagepos}{% + \dimen1=1in + \advance\dimen1 by \textwidth + \advance\dimen1 by \evensidemargin + \dimen3=1in + \advance\dimen3 by \topmargin + \advance\dimen3 by \headheight + \advance\dimen3 by \headsep + \advance\dimen3 by \textheight + \ifcontmargin + \advance\dimen1 by \contsep + \else + \advance\dimen3 by \contdrop + \fi + } +\newcommand{\c@outcontpage}{% + \ifnum\zref@extract{LastPage}{abspage}>\c@abspage + \ifcontmargin + \put(\dimen1,-\dimen3){{\flagcont}}% + \else + \put(\dimen1,-\dimen3){\llap{\flagcont}}% + \fi + \else + \ifcontmargin + \put(\dimen1,-\dimen3){{\flagend}}% + \else + \put(\dimen1,-\dimen3){\llap{\flagend}}% + \fi + \fi +}% end of \c@outcontpage +\AtBeginShipout{% +\AtBeginShipoutUpperLeft{% + \ifc@go + \ifodd\c@page + \c@ntoddpagepos + \c@outcontpage + \else + \ifcontallpages + \c@ntevenpagepos + \c@outcontpage + \fi + \fi + \fi +} % end AtBeginShipoutUpperLeft +} % end AtBeginShipout %% \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 -- cgit v1.2.3