diff options
author | Karl Berry <karl@freefriends.org> | 2011-09-16 18:23:59 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-09-16 18:23:59 +0000 |
commit | eb6d3c1ea4bd719ae29509ed3ce4e0745343e8a7 (patch) | |
tree | 799377b8079e69366009202030883c0b3ae2d2e4 /Master/texmf-dist/tex/latex | |
parent | 0d911214e0ace39eb10344ef714cfbcbdd92cced (diff) |
new latex package ifoddpage
git-svn-id: svn://tug.org/texlive/trunk@23979 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/ifoddpage/ifoddpage.sty | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/ifoddpage/ifoddpage.sty b/Master/texmf-dist/tex/latex/ifoddpage/ifoddpage.sty new file mode 100644 index 00000000000..eeea03bb12e --- /dev/null +++ b/Master/texmf-dist/tex/latex/ifoddpage/ifoddpage.sty @@ -0,0 +1,55 @@ +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{ifoddpage}[2011/09/13 v1.0 Conditionals for odd/even page detection] +\newcount\c@checkoddpage +\def\thecheckoddpage{\number\c@checkoddpage} +\newif\ifoddpage +\newif\ifoddpageoroneside +\let\oddpage@checkpage\relax +\def\oddpage@page{1} +\def\oddpage@label{% + \@newl@bel{checkoddpage}% +}% +\write\@auxout{\noexpand\providecommand\noexpand\oddpage@label[2]{}}% +\def\oddpage@checkpage#1{% + \@bsphack + \write\@auxout{\string\oddpage@label{#1}{\the\c@page}}% + \@esphack +}% +\def\oddpage@page{% + \expandafter\ifx\csname checkoddpage@\thecheckoddpage\endcsname\relax + \the\c@page + \else + \csname checkoddpage@\thecheckoddpage\endcsname + \fi +}% +\DeclareRobustCommand\checkoddpage{% + \stepcounter{checkoddpage}% + \expandafter\oddpage@checkpage\expandafter{\number\c@checkoddpage}% + \ifodd\oddpage@page\relax + \oddpagetrue + \oddpageoronesidetrue + \else + \oddpagefalse + \oddpageoronesidefalse + \fi + \if@twoside\else + \oddpageoronesidetrue + \fi +}% +\def\@ifoddpage{% + \ifoddside + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi +} +\def\@ifoddpageoroneside{% + \iftwosideoddside + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi +} +\endinput +%% +%% End of file `ifoddpage.sty'. |