Additions to quadwriter page model: verso/recto, header, footer, margin #9

Open
opened 6 years ago by otherjoel · 4 comments
otherjoel commented 6 years ago (Migrated from github.com)

Some thoughts around layout in quadwriter

  • At various points in a quadwriter doc you could specify q-expressions to be used as the content of header/footer from that page onwards, since these most often have repeating content.

  • For marginal notes, a q-expression that would go into "the margin" (side of which would vary on even/odd pages), horizontally aligned with its neighboring content. Maybe with a "push" attribute to nudge it up or down.

  • Verso- and recto-aware sizing of page header, footer, margins, that could change within a document. For reference, from the memoir class manual:

page layout parameters for a verso page
page layout parameters for a recto page

Some thoughts around layout in quadwriter * At various points in a quadwriter doc you could specify q-expressions to be used as the content of header/footer from that page onwards, since these most often have repeating content. * For marginal notes, a q-expression that would go into "the margin" (side of which would vary on even/odd pages), horizontally aligned with its neighboring content. Maybe with a "push" attribute to nudge it up or down. * Verso- and recto-aware sizing of page header, footer, margins, that could change within a document. For reference, from the [memoir class](https://ctan.org/pkg/memoir?lang=en) manual: ![page layout parameters for a verso page](https://user-images.githubusercontent.com/1553115/59052387-a1852a00-8854-11e9-8dac-c26a17174469.png) ![page layout parameters for a recto page](https://user-images.githubusercontent.com/1553115/59054038-6edd3080-8858-11e9-97cd-4d3b6ebf7032.png)
mbutterick commented 6 years ago (Migrated from github.com)

At various points in a quadwriter doc you could specify q-expressions to be used as the content of header/footer from that page onwards, since these most often have repeating content.

I agree, though I’m guessing it should be tied to a notion of a logical separation (in word-processor parlance a “section”) So in addition to headers and footers, each section could have its own page size, etc.

For marginal notes, a q-expression that would go into "the margin" (side of which would vary on even/odd pages), horizontally aligned with its neighboring content. Maybe with a "push" attribute to nudge it up or down.

What kind of guarantees does LaTeX make about margin notes? For instance, if the note is too long to fit on the page, what happens?

Verso- and recto-aware sizing of page header, footer, margins, that could change within a document.

I agree. Also makes me think that inner and outer should be line-alignment options (as opposed to just left and right)

> At various points in a quadwriter doc you could specify q-expressions to be used as the content of header/footer from that page onwards, since these most often have repeating content. I agree, though I’m guessing it should be tied to a notion of a logical separation (in word-processor parlance a “section”) So in addition to headers and footers, each section could have its own page size, etc. > For marginal notes, a q-expression that would go into "the margin" (side of which would vary on even/odd pages), horizontally aligned with its neighboring content. Maybe with a "push" attribute to nudge it up or down. What kind of guarantees does LaTeX make about margin notes? For instance, if the note is too long to fit on the page, what happens? > Verso- and recto-aware sizing of page header, footer, margins, that could change within a document. I agree. Also makes me think that `inner` and `outer` should be line-alignment options (as opposed to just `left` and `right`)
otherjoel commented 6 years ago (Migrated from github.com)

What kind of guarantees does LaTeX make about margin notes?

This is a tricky question to answer. Most generally, LaTeX considers marginal paragraphs, figures, tables and footnotes (maybe other things too) to fall under a "Floats" rubric. You can suggest where a Float should go but the ultimate position is left to the typesetting engine. Section 10.4 of the memoir class manual (PDF) talks about (some of) the details.

For side/marginal notes and paragraphs, LaTeX offers different commands that make different guarantees, such as allowing them to run to more than one page, or having LaTeX keep track of the height of the notes to prevent them from overlapping. Section 12 of the manual linked above describes this and contains some hints as to how LaTeX tries to handle things internally:

(From 12.2) Sometimes LaTeX gets confused near a page break and a note just after a break may get put into the wrong margin (the wrong margin for the current page but the right one if the note fell on the previous page). If this occurs then inserting the \strictpagecheckdeclaration before any \marginpar command is used will prevent this, at the cost of at least one additional LaTeX run.

(From 12.3) The \sideparmacro is similar to \marginpar except that it produces side notes that do not float — they may overlap.

…When LaTeX is deciding where to place the side notes it checks whether it is on an odd or even page and sometimes TeX doesn’t realise that it has just moved onto the next page. Effectively TeX typesets paragraph by paragraph (including any side notes) and at the end of each paragraph sees if there should have been a page break in the middle of the paragraph. If there was it outputs the first part of the paragraph, inserts the page break,and retains the second part of the paragraph, without retypesetting it, for eventual output at the top of the new page. This means that side notes for any given paragraph are in the same margin, either left or right. A side note at the end of a paragraph may then end up in the wrong margin. The macro \parnopar forces a new paragraph but without appearing to (the first line in the following paragraph follows immediately after the last element in the prior paragraph with no line break). You can use \parnopar to make TeX to do its page break calculation when you want it to, by splitting what appears to be one paragraph into two paragraphs.

(From 12.4) The \sidebarcommand is like \marginpar in that it sets the 〈text〉in the margin. However, unlike \marginpar the 〈text〉will start near the top of the page, and may continue onto later pages if it is too long to go on a single page. If multiple \sidebar commands are used on a page, the several 〈text〉s are set one after the other.

> What kind of guarantees does LaTeX make about margin notes? This is a tricky question to answer. Most generally, LaTeX considers marginal paragraphs, figures, tables and footnotes (maybe other things too) to fall under a "Floats" rubric. You can suggest where a Float should go but the ultimate position is left to the typesetting engine. Section 10.4 of [the `memoir` class manual](http://mirrors.concertpass.com/tex-archive/macros/latex/contrib/memoir/memman.pdf) (PDF) talks about (some of) the details. For side/marginal notes and paragraphs, LaTeX offers different commands that make different guarantees, such as allowing them to run to more than one page, or having LaTeX keep track of the height of the notes to prevent them from overlapping. Section 12 of the manual linked above describes this and contains some hints as to how LaTeX tries to handle things internally: > (From 12.2) Sometimes LaTeX gets confused near a page break and a note just after a break may get put into the wrong margin (the wrong margin for the current page but the right one if the note fell on the previous page). If this occurs then inserting the `\strictpagecheckdeclaration` before any `\marginpar` command is used will prevent this, at the cost of at least one additional LaTeX run. > (From 12.3) The `\sideparmacro` is similar to `\marginpar` except that it produces side notes that do not float — they may overlap. > …When LaTeX is deciding where to place the side notes it checks whether it is on an odd or even page and sometimes TeX doesn’t realise that it has just moved onto the next page. Effectively TeX typesets paragraph by paragraph (including any side notes) and at the end of each paragraph sees if there should have been a page break in the middle of the paragraph. If there was it outputs the first part of the paragraph, inserts the page break,and retains the second part of the paragraph, without retypesetting it, for eventual output at the top of the new page. This means that side notes for any given paragraph are in the same margin, either left or right. A side note at the end of a paragraph may then end up in the wrong margin. The macro `\parnopar` forces a new paragraph but without appearing to (the first line in the following paragraph follows immediately after the last element in the prior paragraph with no line break). You can use `\parnopar` to make TeX to do its page break calculation when you want it to, by splitting what appears to be one paragraph into two paragraphs. > (From 12.4) The `\sidebarcommand` is like `\marginpar` in that it sets the 〈text〉in the margin. However, unlike `\marginpar` the 〈text〉will start near the top of the page, and may continue onto later pages if it is too long to go on a single page. If multiple `\sidebar` commands are used on a page, the several 〈text〉s are set one after the other.
mbutterick commented 6 years ago (Migrated from github.com)

Ugh, I’m getting dizzy. \parnopar? Who can remember all this?

IMO the right way to do footnotes and margin notes and other types of “parallel flows” is to hand them off to a constraint solver. Yes, I wrote one already for Quad. But I’m probably some distance away from plugging it in, because consistent with Gall’s Law, I want to make the simpler stuff work first.

The other things in the layout — header, verso, recto — are easier.

Ugh, I’m getting dizzy. `\parnopar`? Who can remember all this? IMO the right way to do footnotes and margin notes and other types of “parallel flows” is to hand them off to a constraint solver. Yes, I [wrote one already](https://github.com/mbutterick/csp) for Quad. But I’m probably some distance away from plugging it in, because consistent with Gall’s Law, I want to make the simpler stuff work first. The other things in the layout — header, verso, recto — are easier.
otherjoel commented 6 years ago (Migrated from github.com)

Yes, I’m definitely not a fan of the whole scheme. I just thought I could better answer your question of what LaTeX “guarantees” by pointing out some of these ugly edge-(?) cases.

As to margin notes, it may be worth beginning with an expression that places a marginal box, always at the same vertical offset as its surrounding content, which may overlap with other such boxes and will not break across pages if overfull (avoids constraint solving?).

Footnotes are another animal altogether since they may advance up into the body text area, there’s no hard-and-fast “reserved area” for them.

Yes, I’m definitely not a fan of the whole scheme. I just thought I could better answer your question of what LaTeX “guarantees” by pointing out some of these ugly edge-(?) cases. As to margin notes, it may be worth beginning with an expression that places a marginal box, always at the same vertical offset as its surrounding content, which may overlap with other such boxes and will not break across pages if overfull (avoids constraint solving?). Footnotes are another animal altogether since they may advance up into the body text area, there’s no hard-and-fast “reserved area” for them.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mbutterick/typesetting#9
Loading…
There is no content yet.