Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add publication/latex/@openodd #2034

Closed
wants to merge 2 commits into from

Conversation

jjrsylvestre
Copy link
Contributor

  1. Borrowed from https://tex.stackexchange.com/questions/185821/openright-in-oneside-book
  2. Hopefully not too hacky.
  3. Wasn't sure where in the preamble you would want to put it.
  4. Wasn't sure if different document classes might need to be handled differently, so I just put in the common preamble.

@kcrisman
Copy link
Contributor

kcrisman commented Aug 3, 2023

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

@mitchkeller
Copy link
Contributor

mitchkeller commented Aug 3, 2023 via email

@kcrisman
Copy link
Contributor

kcrisman commented Aug 3, 2023

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.

@kcrisman
Copy link
Contributor

kcrisman commented Aug 3, 2023

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.

@jjrsylvestre
Copy link
Contributor Author

Wouldn't twoside have other effects? For example, page numbers flopping between top right and top left.

@rbeezer
Copy link
Collaborator

rbeezer commented Aug 3, 2023

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.

@kcrisman
Copy link
Contributor

kcrisman commented Aug 3, 2023

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.

@rbeezer
Copy link
Collaborator

rbeezer commented Aug 3, 2023

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.

  • 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.
  • Why 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?
  • I'll re-write "page fidelity" right now and have it ready to go, other than a pointer back to your work in the publisher file reference.

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. ;-)

@rbeezer
Copy link
Collaborator

rbeezer commented Aug 3, 2023

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.

@jjrsylvestre
Copy link
Contributor Author

  • 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')" 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?

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.

@rbeezer
Copy link
Collaborator

rbeezer commented Aug 3, 2023

Note to self: close #1423 when this is done.

@jjrsylvestre
Copy link
Contributor Author

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?

@rbeezer
Copy link
Collaborator

rbeezer commented Aug 3, 2023

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.

@rbeezer
Copy link
Collaborator

rbeezer commented Aug 3, 2023

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?)

@jjrsylvestre
Copy link
Contributor Author

jjrsylvestre commented Aug 5, 2023

Do we need value no ? Could be just add-blanks, skip-pages, and empty/anything-else is ignored?

@Alex-Jordan
Copy link
Contributor

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.

@Alex-Jordan
Copy link
Contributor

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.

@jjrsylvestre
Copy link
Contributor Author

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 use open-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.

rbeezer added a commit that referenced this pull request Aug 8, 2023
@rbeezer
Copy link
Collaborator

rbeezer commented Aug 8, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants