blob: eeea03bb12ead1eb7aeb19abb22115bb5cb2db57 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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'.
|