support identical page numbering as option for print/online pdf
An interesting case not currently supported by PTX is to have a version of the "electronic pdf" (with lots of hyperlinks, no page numbers for hyperlinks, etc.) but with identical page numbering to a two-sided one suitable for printing (margins alternating, blank pages so chapters begin on the right-hand side, etc.).
The idea behind this is the classroom case where some students are using a tablet, where the one-sided pages really are necessary to avoid distraction, but some students will have a printed copy, where it's nice to have the slightly wider margin at the binding edge. Students find it (in my experience) much more natural to go to a page number than a specific theorem or even chapter number, so having the same page numbers is crucial.
My solution was to use the standard pdf compiling, but to add the following code from a very helpful Tex.SE post in the preamble and then (manually) switch the document class to twoside after compiling the oneside version.
\makeatletter
% Update \cleardoublepage to be similar in oneside and twoside
\if@twoside\else
\def\cleardoublepage{%
\clearpage
\ifodd\c@page\else
\hbox{}\newpage
\if@twocolumn
\hbox{}\newpage
\fi
\fi
}
\fi
\makeatother
Plopping this in just before \begin{document} worked well.
(@rbeezer suggested in drop-in hours today that this would be useful to have as an issue for possible eventual usage, so here it is.)
Review potential attribute value names at thread starting with:
https://groups.google.com/g/pretext-support/c/Yk129zjN_Hc/m/VfVpFOaLBQAJ
👍
See #1020 as well.
This has effectively happened at #2034. Thanks, @kcrisman for your work on this - @jjrsylvestre simply got in line ahead of you by working up a pull request, so I went with that. If any of that misbehaves, we can always revisit the solution here.
This has effectively happened at #2034 https://github.com/PreTeXtBook/pretext/pull/2034. Thanks, @kcrisman https://github.com/kcrisman for your work on this - @jjrsylvestre https://github.com/jjrsylvestre simply got in line ahead of you by working up a pull request, so I went with that. If any of that misbehaves, we can always revisit the solution here.
I had already forgotten I'd done this issue! I'm sure the other solution will be fine too, and a great addition.
Message ID: @.***>