summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/continue
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-12-18 23:32:36 +0000
committerKarl Berry <karl@freefriends.org>2018-12-18 23:32:36 +0000
commit39e028ec9200b17474c8bc3c38aee237705bc2d7 (patch)
tree84ec8e618c61d4267958b8406f6e545e9ed0a202 /Master/texmf-dist/tex/latex/continue
parentb9821664aee754f6c422cd69d4323ba3f6e825c9 (diff)
continue (18dec18)
git-svn-id: svn://tug.org/texlive/trunk@49449 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/continue')
-rw-r--r--Master/texmf-dist/tex/latex/continue/continue.sty125
1 files changed, 79 insertions, 46 deletions
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