wspr / herries-press

A collection of LaTeX packages by Peter Wilson
http://wspr.github.com/herries-press/
30 stars 5 forks source link

changepage: more robust even/odd test against page number changes #8

Open wspr opened 14 years ago

wspr commented 14 years ago

From Martin Münch:

if a two-sided document starts with a right side/page, and a left/even - right/odd check should be performed, one would need the absolute page number, for example \theCurrentPage from pagesLTS package:
"\theCurrentPage gives the current \theCurrentPage total/absolute page, in contrast to \thepage, which gives only the page name in the current page numbering scheme. For example, when there are Roman VII pages in the frontmatter and afterwards in the mainmatter you are at arabic page 9, then \theCurrentPage is 16, whereas \thepage is 9. When the page \number" (name) is manipulated by \addtocounter{page}{...} or \setcounter{page}{...}, \theCurrentPage ignores this. Because CurrentPage is a normal counter, you can also say e. g. \Roman{CurrentPage} to get the value in Roman page numbering scheme (e. g. VIII for 8)." (p. 8 of the pagesLTS documentation).
[snip]
\RequirePackage{everyshi}[2001/05/15]%v 3.00
\newcounter{cp@CurrentPage}
\setcounter{cp@CurrentPage}{1}
\EveryShipout{\addtocounter{cp@CurrentPage}{1}}
and using \arabic{cp@CurrentPage} instead of \thepage might help.

So, maybe you could add a "right/left" page check (assuming first page = right) to your package additional to the existing "even/odd" page number check?

wspr commented 14 years ago

Thanks for the feature suggestion.

I would have to think whether making this change for \ifoddpage would be possible for backwards compatibility, but I definitely agree that a more robust test would be a good idea. I will probably implement something like \ifrecto/\ifverso, but I have some other projects that need attention first.

I am more than happy to accept contributions if you are willing to provide the necessary code and documentation patches :)