summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/turnthepage/turnpageetex.sty
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/turnthepage/turnpageetex.sty
Initial commit
Diffstat (limited to 'macros/latex/contrib/turnthepage/turnpageetex.sty')
-rw-r--r--macros/latex/contrib/turnthepage/turnpageetex.sty59
1 files changed, 59 insertions, 0 deletions
diff --git a/macros/latex/contrib/turnthepage/turnpageetex.sty b/macros/latex/contrib/turnthepage/turnpageetex.sty
new file mode 100644
index 0000000000..16c225574e
--- /dev/null
+++ b/macros/latex/contrib/turnthepage/turnpageetex.sty
@@ -0,0 +1,59 @@
+% This is file `turnpageetex.sty' v1.3a by Merciadri Luca.
+% Thanks to Marc van Dongen and Martin Muench for their help.
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{turnpageetex}[2011/03/24 1.3a
+ Indicating to turn the page (LM)]
+
+\PackageInfo{turnpageetex}{This is turnthepage with using e-TeX.}
+
+\RequirePackage{atbegshi}
+\RequirePackage{picture}
+\RequirePackage{zref-abspage}
+\RequirePackage{zref-lastpage}
+
+\ifx\turnthepage\undefined
+ \DeclareOption{short}{\providecommand{\turnthepage}{/\ldots}}
+ \DeclareOption{english}{\providecommand{\turnthepage}{\textit{Turn the page.}}}
+ \DeclareOption{francais}{\providecommand{\turnthepage}{\textit{Tournez la page.}}}
+ \DeclareOption{nederlands}{\providecommand{\turnthepage}{\textit{Sla de pagina om.}}}
+ \DeclareOption{deutsch}{\providecommand{\turnthepage}{\textit{Bitte wenden.}}}
+\else
+ \newcommand{\turnp@agewarn}{%
+ \PackageWarning{turnpageetex}{Command turnthepage was already defined.\MessageBreak%
+ Now redefining it.}}
+ \DeclareOption{short}{\turnp@agewarn \renewcommand{\turnthepage}{/\ldots}}
+ \DeclareOption{english}{\turnp@agewarn \renewcommand{\turnthepage}{\textit{Turn the page.}}}
+ \DeclareOption{francais}{\turnp@agewarn \renewcommand{\turnthepage}{\textit{Tournez la page.}}}
+ \DeclareOption{nederlands}{\turnp@agewarn \renewcommand{\turnthepage}{\textit{Sla de pagina om.}}}
+ \DeclareOption{deutsch}{\turnp@agewarn \renewcommand{\turnthepage}{\textit{Bitte wenden.}}}
+\fi
+
+\ProcessOptions
+
+\ifx\turnthepage\undefined
+ \providecommand{\turnthepage}{ }
+ \PackageWarning{turnpageetex}{No option for package turnthepage\MessageBreak%
+ (or turnpageetex) choosen!\MessageBreak%
+ There will be no information regarding\MessageBreak%
+ the need to turn the page!\MessageBreak%
+ }
+\fi
+
+\AtBeginShipout{%
+\AtBeginShipoutUpperLeft{%
+ \ifodd\c@page
+ \ifnum\zref@extract{LastPage}{abspage}>\c@abspage
+ \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
+ \advance\dimen3 by \footskip
+ \put(\dimen1,-\dimen3){\llap{\turnthepage}}%
+ \fi%
+ \fi%
+}}