summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Master/texmf-dist/doc/latex/ifoddpage/DEPENDS.txt1
-rw-r--r--Master/texmf-dist/doc/latex/ifoddpage/README.txt (renamed from Master/texmf-dist/doc/latex/ifoddpage/README)10
-rw-r--r--Master/texmf-dist/doc/latex/ifoddpage/ifoddpage.pdfbin133988 -> 144874 bytes
-rw-r--r--Master/texmf-dist/source/latex/ifoddpage/ifoddpage.dtx47
-rw-r--r--Master/texmf-dist/tex/latex/ifoddpage/ifoddpage.sty8
5 files changed, 50 insertions, 16 deletions
diff --git a/Master/texmf-dist/doc/latex/ifoddpage/DEPENDS.txt b/Master/texmf-dist/doc/latex/ifoddpage/DEPENDS.txt
new file mode 100644
index 00000000000..0fc4d1f756f
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/ifoddpage/DEPENDS.txt
@@ -0,0 +1 @@
+soft ydoc # for compiling the package documentation only
diff --git a/Master/texmf-dist/doc/latex/ifoddpage/README b/Master/texmf-dist/doc/latex/ifoddpage/README.txt
index b71473ec4d0..d276e3a5c23 100644
--- a/Master/texmf-dist/doc/latex/ifoddpage/README
+++ b/Master/texmf-dist/doc/latex/ifoddpage/README.txt
@@ -1,9 +1,9 @@
LaTeX package 'ifoddpage'
-~~~~~~~~~~~~~~~~~~~~~~~~
-Copyright (c) 2011 by Martin Scharrer <martin@scharrer-online.de>
-WWW: http://latex.scharrer-online.de/
-CTAN: http://www.ctan.org/pkg/ifoddpage
-Code repository: https://bitbucket.org/martin_scharrer/ifoddpage
+~~~~~~~~~~~~~~~~~~~~~~~~~
+Copyright (c) 2011-2022 by Martin Scharrer <martin.scharrer@web.de>
+License: LaTeX Project Public License, v1.3 or later: http://www.latex-project.org/lppl.txt
+Repository: https://github.com/MartinScharrer/ifoddpage
+Issues: https://github.com/MartinScharrer/ifoddpage/issues
This LaTeX package provides a \ifoddpage conditional to determine if the current page is odd or even.
The macro \checkoddpage must be used direct before to check the page number using a label.
diff --git a/Master/texmf-dist/doc/latex/ifoddpage/ifoddpage.pdf b/Master/texmf-dist/doc/latex/ifoddpage/ifoddpage.pdf
index 3c487f795e4..d5c6c142a3c 100644
--- a/Master/texmf-dist/doc/latex/ifoddpage/ifoddpage.pdf
+++ b/Master/texmf-dist/doc/latex/ifoddpage/ifoddpage.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/ifoddpage/ifoddpage.dtx b/Master/texmf-dist/source/latex/ifoddpage/ifoddpage.dtx
index fe0720777a2..699bf54d0a1 100644
--- a/Master/texmf-dist/source/latex/ifoddpage/ifoddpage.dtx
+++ b/Master/texmf-dist/source/latex/ifoddpage/ifoddpage.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%<=*COPYRIGHT>
-%% Copyright (C) 2011-2012 by Martin Scharrer <martin@scharrer-online.de>
-%% ----------------------------------------------------------------------
+%% Copyright (c) 2011-2022 by Martin Scharrer <martin.scharrer@web.de>
+%% -------------------------------------------------------------------
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
@@ -24,10 +24,10 @@
%<*driver>
\ProvidesFile{ifoddpage.dtx}[%
%<=*DATE>
- 2016/04/23
+ 2022/10/18
%<=/DATE>
%<=*VERSION>
- v1.1
+ v1.2
%<=/VERSION>
DTX file for ifoddpage package]
\documentclass{ydoc}
@@ -65,14 +65,15 @@
%
% \changes{v1.0}{2011/09/13}{First version.}
% \changes{v1.1}{2016/04/23}{Fixed misspelled macro name.}
+% \changes{v1.2}{2022/10/18}{Updated documentation.}
%
%
% \DoNotIndex{\newcommand,\newenvironment}
%
% \GetFileInfo{ifoddpage.dtx}
% \author{Martin Scharrer}
-% \email{martin@scharrer.me}
-% \repository{https://bitbucket.org/martin_scharrer/ifoddpage}
+% \email{martin.scharrer@web.de}
+% \repository{https://github.com/MartinScharrer/ifoddpage}
% \maketitle
%
% \section{Introduction}
@@ -178,20 +179,36 @@
Conditionals for odd/even page detection]
% \end{macrocode}
%
-%
+% \begin{macro}{\c@checkoddpage}
+% Counter |checkoddpage| is needed to give each use of \Macro\checkoddpage an unique ID for
% \begin{macrocode}
\newcount\c@checkoddpage
% \end{macrocode}
+% \end{macro}
%
% \begin{macro}{\thecheckoddpage}
+% Expands to the value of |checkoddpage|, i.e. ID of last used \Macro\checkoddpage.
% \begin{macrocode}
\def\thecheckoddpage{\number\c@checkoddpage}
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\ifoddpage}
+% Conditional: true if used on odd page after \Macro\checkoddpage.
% \begin{macrocode}
\newif\ifoddpage
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifoddpageoroneside}
+% Conditional: true if used on odd page after \Macro\checkoddpage.
+% Always true if used in a |oneside| document.
+% \begin{macrocode}
\newif\ifoddpageoroneside
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
\let\oddpage@checkpage\relax
% \end{macrocode}
%
@@ -203,6 +220,8 @@
%
%
% \begin{macro}{\oddpage@label}
+% Produces a LaTeX label using the |checkoddpage| counter.
+% An internal LaTeX macro is used for this.
% \begin{macrocode}
\def\oddpage@label{%
\@newl@bel{checkoddpage}%
@@ -213,6 +232,8 @@
%
%
% \begin{macro}{\oddpage@checkpage}
+% Writes the oddpage label with the current page number to the AUX file,
+% so it can be read back during the following \LaTeX{} runs.
% \begin{macrocode}
\def\oddpage@checkpage#1{%
\@bsphack
@@ -224,6 +245,9 @@
%
%
% \begin{macro}{\oddpage@page}
+% Returns the page number of the last \Macro\checkoddpage macro.
+% If there is no label for it defined in the AUX file, e.g.\ first compile run,
+% then the current page number is used instead as a fallback.
% \begin{macrocode}
\def\oddpage@page{%
\expandafter\ifx\csname checkoddpage@\thecheckoddpage\endcsname\relax
@@ -237,6 +261,13 @@
%
%
% \begin{macro}{\checkoddpage}
+% User macro to check if the current page has an odd page number.
+% Increases |checkoddpage| counter to produce an unique ID for this macro usage.
+% Calls \Macro\oddpage@checkpage to produce a reference entry in the AUX file.
+% Then checks if the \Macro\oddpage@page is odd and sets
+% \Macro{ifoddpage} and \Macro{ifoddpageoroneside} accordantly.
+% Finally checks if the |twoside| setting is active and set \Macro{ifoddpageoroneside}
+% to |true| if so.
% \begin{macrocode}
\DeclareRobustCommand\checkoddpage{%
\stepcounter{checkoddpage}%
@@ -257,6 +288,7 @@
%
%
% \begin{macro}{\@ifoddpage}
+% Wrapper around \Macro{ifoddpage}. Will expand to the next token if odd, to the second token if not.
% \begin{macrocode}
\def\@ifoddpage{%
\ifoddpage
@@ -270,6 +302,7 @@
%
%
% \begin{macro}{\@ifoddpageoroneside}
+% Wrapper around \Macro{ifoddpageoroneside}. Will expand to the next token if odd, to the second token if not.
% \begin{macrocode}
\def\@ifoddpageoroneside{%
\iftwosideoddside
diff --git a/Master/texmf-dist/tex/latex/ifoddpage/ifoddpage.sty b/Master/texmf-dist/tex/latex/ifoddpage/ifoddpage.sty
index 8b32fe20041..5f845aceea2 100644
--- a/Master/texmf-dist/tex/latex/ifoddpage/ifoddpage.sty
+++ b/Master/texmf-dist/tex/latex/ifoddpage/ifoddpage.sty
@@ -1,5 +1,5 @@
-%% Copyright (C) 2011-2012 by Martin Scharrer <martin@scharrer-online.de>
-%% ----------------------------------------------------------------------
+%% Copyright (c) 2011-2022 by Martin Scharrer <martin.scharrer@web.de>
+%% -------------------------------------------------------------------
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
@@ -17,8 +17,8 @@
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{ifoddpage}[%
- 2016/04/23
- v1.1
+ 2022/10/18
+ v1.2
Conditionals for odd/even page detection]
\newcount\c@checkoddpage
\def\thecheckoddpage{\number\c@checkoddpage}