Closed jjrsylvestre closed 9 months ago
This is a great idea as an option. Two comments:
sed -i '' 's/documentclass\[oneside/documentclass\[twoside/' foo.tex
Any time I see sed
, my hackles get raised. GNU sed
(Linux and I presume WSL) and BSD sed
(macOS) have some fundamentally different behaviors that makes using sed
in an open-source project where folks might be building on different platforms just an absolute nightmare. (We navigated this early on with EPUB.)
sed
works when itโs basically just the author doing things, but as soon as others get involved, itโs best to find a better method.
On Aug 3, 2023, at 8:29 AM, kcrisman @.***> wrote:
This is a great idea as an option. Two comments:
Obviously this will have to be in the guide somewhere, preferably multiple places. I expect people will use it, so that pdf and print match page numbers. Would just changing the document class option be easier/more correct, or worse? It's what I use, in a custom build script I certainly don't mean to imply is "correct PTX" ๐ but which I did for precisely this reason. sed -i '' 's/documentclass[oneside/documentclass[twoside/' foo.tex
โ Reply to this email directly, view it on GitHub https://github.com/PreTeXtBook/pretext/pull/2034#issuecomment-1663986979, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACBOYNZMPKY2BF5QICHCYXTXTORSBANCNFSM6AAAAAA3CFXAKA. You are receiving this because you are subscribed to this thread.
-- Mitch Keller @.***
Haha, I didn't mean that PTX should use sed
! I can't tell you how many times I've run into exactly the issues you are mentioning ... what I meant for PTX was the possibility of just changing the document class rather than the suggestion implemented in this pull request. The script line was just to show that this works for at least one person in achieving the desired result.
But something like <pi:pub-attribute name="openodd" default="no" options="yes"/>
is just the kind of option that might be helpful for people who want this feature.
Wouldn't twoside
have other effects? For example, page numbers flopping between top right and top left.
Hopefully not too hacky.
Well, my very first reaction to your orginal post was going to be "So long as it doesn't include \makeatletter`" ;-)
I'll run this through some testing soon. It'll eventually need a very terse entry in the publication file reference chapter, whicvh can point to the "Page Fidelity" section, which I will re-write as part of this.
Yes! I was confused on which of my changes I was thinking about. My apologies! I was just excited that someone was thinking to implement this.
What I use is this solution. But if your option is more robust, it would be great to have it as an official option.
OK, looking good. Extensive testing with the sample book - no parts, decorative parts, structural parts. Side-by-side comparisons of PDFs indicates complete syncing on page numbers.
open-odd
. (Yes, I'm a bit conflicted about hyphens.)select="not($latex-openodd = 'no')"
versus select="$latex-openodd = 'yes'"
? There is a lot of this about (historically), but I think Alex's new scheme guarantees a yes
or no
for $latex-openodd
in accordance with the default being no
?Force-push or add a pile-on commit, I can handle either, but please do documentation as a separate commit. Don't merge in master.
Thanks very much for doing this - the whole oneside/twoside, left/right, even/odd, recto/verso drill gives me a headache. ;-)
An idea that came to me while writing documentation (see, there is some value to that act!).
What about another option that basically makes \cleardoublepage
do the same as \clearpage
and an extra increment of the page number, but not the blank page? Basically, blank verso pages just go missing and page numbers skip a beat?
The electronic PDF is faithful, but if printed no trees are wasted. A sustainable PDF.
- Let's call the attribute
open-odd
. (Yes, I'm a bit conflicted about hyphens.)- Document as mentioned earlier.
- Please cite the SE post as an XSL comment (not a LaTeX file comment), see examples all over the place.
Will do all of the above.
- Why
select="not($latex-openodd = 'no')"
versusselect="$latex-openodd = 'yes'"
? There is a lot of this about (historically), but I think Alex's new scheme guarantees ayes
orno
for$latex-openodd
in accordance with the default beingno
?
I actually tried that first, and during my testing xslt gave me an "Unknown error" in the case that the publication file omits the attribute. Didn't want to delve too deep into the pi:pub-attribute
scheme to figure out why, but I assumed for some reason the test needs to be on the default value rather than an optional value.
Note to self: close #1423 when this is done.
An idea that came to me while writing documentation (see, there is some value to that act!).
What about another option that basically makes
\cleardoublepage
do the same as\clearpage
and an extra increment of the page number, but not the blank page? Basically, blank verso pages just go missing and page numbers skip a beat?The electronic PDF is faithful, but if printed no trees are wasted. A sustainable PDF.
That could possibly be done without \makeatletter
;)
When you say "another option" do you mean literally as two different implementations of page-matching (so maybe @open-odd
could have three potential settings), or as a replacement implementation for the already committed code?
my testing xslt gave me an "Unknown error" in the case that the publication file omits the attribute
OK, thanks for the explanation. Pinging @Alex-Jordan in case there should be some work to do - it'd be nice to have a more direct formation of that variable.
When you say "another option"
Definitely do not want to derail this PR in any way. I was thinking another attribute, but that would be silly. So yes, perhaps a three-way option. no
, yes
, drop-pages
, or something with a better name. If you think it is a good idea, let's finish this with that in mind, and we won't advertise until we have it all. (We could make yes
into keep-pages
or something?)
Do we need value no
? Could be just add-blanks
, skip-pages
, and empty/anything-else is ignored?
I can't completely tell what in the thread is stale. Is "Unknown error"
still a thing? Can you make that change and see if it still happens? I notice some places in this thread use openodd
and others use open-odd
, and would first want to rule out if the explanation was a typo.
To the most recent question, you want a non-empty default value whenever there is a finite list of option values. No publisher file would need to declare no
as the value, so it adds no work for publishers. But it makes the XSLT more uniform and easier to maintain.
you want a non-empty default value whenever there is a finite list of option values.
And then I look and see several such things with no default declared. I think those are about being faithful to the previous scheme, not an intentional choice. I would recommend just always declaring something non-empty for a default, even if it is never explicitly referenced in the XSLT.
I can't completely tell what in the thread is stale. Is
"Unknown error"
still a thing? Can you make that change and see if it still happens?
I can't seem to recreate the situation that caused the error message. Must have been some error on my part. But the code that was at issue is not necessary in the new three-option version anyway.
I notice some places in this thread use
openodd
and others useopen-odd
, and would first want to rule out if the explanation was a typo.
No, changed wholesale from openodd
to open-odd
. Double-checked with a grep
, there are no more instances of openodd
anywhere.
To the most recent question, you want a non-empty default value whenever there is a finite list of option values. No publisher file would need to declare
no
as the value, so it adds no work for publishers. But it makes the XSLT more uniform and easier to maintain.
Sounds good, thanks.
Thanks very much - I like this a lot. Despite an increase in the use of \makeatletter
.
Some mild repackaging of commits, but no changes in the code. Thanks for a very careful job.
I'll button this up and then add some more documentation, as promised. Then rebuild website, etc.