GithubHelp home page GithubHelp logo

Comments (5)

SteelWagstaff avatar SteelWagstaff commented on September 25, 2024

Questions:

  1. is the behaviour the same for recto & verso pages? Yes
  2. what happens when chapter becomes too long to safely print on a single page in ANY case?
  3. can we find any similar issues in prince forum

from pressbooks-book.

tw77 avatar tw77 commented on September 25, 2024

When the chapter becomes too long to safely print on a single page in any case, we see similar behaviour:

on the opening page of a chapter, running feet = two lines, with the threshold for the first line appearing to be ~35 characters. The second line continues for another ~35 characters max. The cutoff always happens at the end of a word, not in the middle of a word. The total character count included in my (McLuhan) example here is 67:

Screen Shot 2022-03-04 at 10 12 44 AM

on subsequent pages in a chapter, running feet = two lines, with seemingly double the threshold for included characters (character count here is 135):

Screen Shot 2022-03-04 at 10 13 36 AM

Curiously, for too-long chapter titles, the page number disappears on recto pages but appears on verso pages. This is true regardless of whether the page is an opening page for a chapter or a subsequent page:

Screen Shot 2022-03-04 at 10 29 05 AM

Screen Shot 2022-03-04 at 10 29 28 AM

That being said, there are no observable differences between recto and verso pages with chapter titles that are not too long to print in full.

I haven't been able to find similar issues in prince forum.

from pressbooks-book.

tw77 avatar tw77 commented on September 25, 2024

This came up for a different user (https://pressbooks.zendesk.com/agent/tickets/13657 for internal reference) using Christie theme and trying McLuhan too. Running feet have a different wrap length on the first pages of chapters and Parts vs. in other pages in a PDF export.

In this case, a workaround is omitting running content from the first page of each chapter or Part. This can be done using a PDF editor to construct a final PDF from two export files (one with running content and one without) or possibly by using CSS.

If an author wants to include running content on every page, in a theme where running content appears in running feet, I don't know of a workaround that allows for exporting the running feet with the same wrap length throughout the book.

from pressbooks-book.

SteelWagstaff avatar SteelWagstaff commented on September 25, 2024

Talked with @greatislander about this. This is being caused by a mixin that sets content to blank for every page position on the first page of content. He'll add some notes.

from pressbooks-book.

greatislander avatar greatislander commented on September 25, 2024

Basically what appears to be happening is this:

A book theme might show running content at the top outside of a page except on the first page of a chapter. This would be achieved with the following CSS:

@page chapter:left {
	@top-left {
		content: "My Running Content";
	}
}

@page chapter:right {
	@top-right {
		content: "My Running Content";
	}
}

So far so good. However, the first page a chapter will have this running content in the top left or right (depending on recto-verso rules) so we need override it like this:

@page:chapter:first {
	@top-right {
		content: '';
	}

	@top-left {
		content: '';
	}
}

Then we can explicitly add rules after the blank reset to show whatever content we want on the first page (which will usually be different and usually is only in the footer, but varies from theme to theme.

Here's the code in Buckram that does this: https://github.com/pressbooks/buckram/blob/27504fc3322278b33ea751772f282bfeda34a5ff/assets/styles/components/structure/_blank.scss#L11-L86

But, there's a problem. Because are setting all these areas to have a blank string as content, it appears that we're preventing any overflow into other areas.

So for this issue, the content is set to appear in @bottom-right but unlike other pages in the chapter, it is constrained to @bottom-right because @bottom-center already has content (a blank string).

I think the fix for this is quite straightforward, though. Rather then setting content to '' I think the blank mixins can be updated to use content: unset (the unset keyword basically tells the rendering engine to remove any styles that have been applied to this property). So instead of the @bottom-center having a blank string it would have nothing and the layout would work as expected. I'm opening a Buckram PR for thisβ€” you can test it in McLuhan by copying the _blank.scss file from my Buckram PR into packages/buckram/assets/styles/components/structure/.

from pressbooks-book.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.