From 7b6cdf4c23e6ed232601dabc70f5553a8dee9c9b Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Wed, 19 Oct 2022 03:01:25 +0000 Subject: CTAN sync 202210190301 --- macros/latex/contrib/ifoddpage/DEPENDS.txt | 1 + macros/latex/contrib/ifoddpage/README | 18 ---------- macros/latex/contrib/ifoddpage/README.txt | 18 ++++++++++ macros/latex/contrib/ifoddpage/ifoddpage.dtx | 47 +++++++++++++++++++++++---- macros/latex/contrib/ifoddpage/ifoddpage.pdf | Bin 133988 -> 144874 bytes 5 files changed, 59 insertions(+), 25 deletions(-) create mode 100644 macros/latex/contrib/ifoddpage/DEPENDS.txt delete mode 100644 macros/latex/contrib/ifoddpage/README create mode 100644 macros/latex/contrib/ifoddpage/README.txt (limited to 'macros/latex/contrib/ifoddpage') diff --git a/macros/latex/contrib/ifoddpage/DEPENDS.txt b/macros/latex/contrib/ifoddpage/DEPENDS.txt new file mode 100644 index 0000000000..0fc4d1f756 --- /dev/null +++ b/macros/latex/contrib/ifoddpage/DEPENDS.txt @@ -0,0 +1 @@ +soft ydoc # for compiling the package documentation only diff --git a/macros/latex/contrib/ifoddpage/README b/macros/latex/contrib/ifoddpage/README deleted file mode 100644 index b71473ec4d..0000000000 --- a/macros/latex/contrib/ifoddpage/README +++ /dev/null @@ -1,18 +0,0 @@ -LaTeX package 'ifoddpage' -~~~~~~~~~~~~~~~~~~~~~~~~ -Copyright (c) 2011 by Martin Scharrer -WWW: http://latex.scharrer-online.de/ -CTAN: http://www.ctan.org/pkg/ifoddpage -Code repository: https://bitbucket.org/martin_scharrer/ifoddpage - -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. -Two compiler runs are therefore required to achieve correct results. -In addition the conditional \ifoddpageoronside is provided which is also true in oneside mode where -all pages use the odd page layout. - -This package got inspired from the 'changepage' package which provides (and uses) the same macros (\checkoddpage and -\ifoddpage) for its main function of changing the page design mid-way in the document. Both packages can be used -together, but the 'ifoddpage' should be loaded last in this case, otherwise the \ifoddpageoroneside conditional will -stop working. - diff --git a/macros/latex/contrib/ifoddpage/README.txt b/macros/latex/contrib/ifoddpage/README.txt new file mode 100644 index 0000000000..d276e3a5c2 --- /dev/null +++ b/macros/latex/contrib/ifoddpage/README.txt @@ -0,0 +1,18 @@ +LaTeX package 'ifoddpage' +~~~~~~~~~~~~~~~~~~~~~~~~~ +Copyright (c) 2011-2022 by Martin Scharrer +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. +Two compiler runs are therefore required to achieve correct results. +In addition the conditional \ifoddpageoronside is provided which is also true in oneside mode where +all pages use the odd page layout. + +This package got inspired from the 'changepage' package which provides (and uses) the same macros (\checkoddpage and +\ifoddpage) for its main function of changing the page design mid-way in the document. Both packages can be used +together, but the 'ifoddpage' should be loaded last in this case, otherwise the \ifoddpageoroneside conditional will +stop working. + diff --git a/macros/latex/contrib/ifoddpage/ifoddpage.dtx b/macros/latex/contrib/ifoddpage/ifoddpage.dtx index fe0720777a..699bf54d0a 100644 --- a/macros/latex/contrib/ifoddpage/ifoddpage.dtx +++ b/macros/latex/contrib/ifoddpage/ifoddpage.dtx @@ -1,7 +1,7 @@ % \iffalse meta-comment %<=*COPYRIGHT> -%% Copyright (C) 2011-2012 by Martin Scharrer -%% ---------------------------------------------------------------------- +%% Copyright (c) 2011-2022 by Martin Scharrer +%% ------------------------------------------------------------------- %% 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/macros/latex/contrib/ifoddpage/ifoddpage.pdf b/macros/latex/contrib/ifoddpage/ifoddpage.pdf index 3c487f795e..d5c6c142a3 100644 Binary files a/macros/latex/contrib/ifoddpage/ifoddpage.pdf and b/macros/latex/contrib/ifoddpage/ifoddpage.pdf differ -- cgit v1.2.3