Skip to content

Conversation

@TobiasWrigstad
Copy link
Collaborator

This PR adds a new command ALLOW_BREAK which is a placeholder for now -- it is simply an alias of SHORT_SPACE_AND_ALLOW_BREAK.

This command is used in a few places in the pagination.

Further, we add the attribute BREAK_AFTER to JAVASCRIPT tags inside a snippet, that should work thus:

In this case, the snippet is just a single snippet so this should be ignored.

<SNIPPET> <JAVASCRIPT BREAK_AFTER="yes"> ... </JAVASCRIPT> </SNIPPET> 

In this case, the first snippet should be compiled to LaTeX such that a \pagebreak is inserted between it and the output snippet.

<SNIPPET> <JAVASCRIPT BREAK_AFTER="yes"> ... </JAVASCRIPT> <JAVASCRIPT_OUTPUT> ... </JAVASCRIPT_OUTPUT> </SNIPPET> 
@TobiasWrigstad
Copy link
Collaborator Author

This is a prerequisite to pagination PRs so I'd appreciate a speedy merge of this -- so I can rebase those PR's on master and have these commands defined.

const jsLonelySnippet = node.getElementsByTagName("JAVASCRIPT_LONELY")[0];
const jsSnippet = node.getElementsByTagName("JAVASCRIPT")[0];
const jsOutputSnippet = node.getElementsByTagName("JAVASCRIPT_OUTPUT")[0];
const allowBreakAfter =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name of the constant "allowBreakAfter" is confusing. This should be "forceBreakAfter" isn't it?

@martin-henz martin-henz merged commit 95f08f1 into master Nov 4, 2021
@martin-henz
Copy link
Member

Merged.

I don't know your plans about page breaks. Before you get serious about pagination, you may consider choosing the right names. A command that forces page breaks should not be called ALLOW_BREAK. But maybe you want it to just "allow a break"?

Should we identify the MIT-Press-specific commands as such so that we can easily turn them off if we want to change the formatting?

How about MIT_PAGE_BREAK?

@RichDom2185 RichDom2185 deleted the snippet-macros branch July 7, 2024 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants