Support header and footer distances on [SECTION] - #86
Merged
Conversation
`[SECTION]` could set the four page edges but not the two distances Word measures from the page edge to the header and the footer, so a template could only bring a margin in as far as the header already reached: below that Word overrides the margin and pushes the text back down to clear the header, and the section gains nothing. `header=` and `footer=` are what make shortening the run of a page possible. They are their own attributes rather than a fifth and sixth margin because they measure something else, and because a template moving only the text should not have to restate them. `ResolveMargins` becomes `ResolvePageMargin` and reads each attribute independently, so a value that does not parse costs that one setting rather than the section break or the settings beside it, and `Derive` now copies only what the marker named - anything it left out keeps the style source's, the gutter included. The two distances parse unsigned, where a page edge does not: a negative margin is a document Word will open, a header outside the page is not. Five tests over the distances alone, beside margins, and unparseable or negative; readme documents the three attributes as a table. Bumped to 7.4.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[SECTION]could set the four page edges but not the two distances Word measures from the page edge to the header and the footer, so a template could only bring a margin in as far as the header already reached: below that Word overrides the margin and pushes the text back down to clear the header, and the section gains nothing.header=andfooter=are what make shortening the run of a page possible.They are their own attributes rather than a fifth and sixth margin because they measure something else, and because a template moving only the text should not have to restate them.
ResolveMarginsbecomesResolvePageMarginand reads each attribute independently, so a value that does not parse costs that one setting rather than the section break or the settings beside it, andDerivenow copies only what the marker named - anything it left out keeps the style source's, the gutter included. The two distances parse unsigned, where a page edge does not: a negative margin is a document Word will open, a header outside the page is not.Five tests over the distances alone, beside margins, and unparseable or negative; readme documents the three attributes as a table. Bumped to 7.4.0.