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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃搫 Support new-page/page-break tags in tex/typst/docx #1138

Merged
merged 4 commits into from Apr 19, 2024
Merged

Conversation

fwkoch
Copy link
Member

@fwkoch fwkoch commented Apr 19, 2024

You can now add page-break or new-page to block metadata to create a new page in tex, typst, and docx:

+++ { "new-page": true }

# Conclusion

My conclusion is on a new page.

For typst/docx both page-break and new-page add a page break. For tex, page-break and new-page insert \pagebreak and \newpage, respectively.

See #714


export function getMetadataTags(node: GenericNode) {
if (!node.data) return [];
const tags: string[] = node.data.tags ?? [];
Copy link
Member Author

Choose a reason for hiding this comment

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

These fields can also be defined as tags, e.g.

+++ { "tags": ["page-break"] }

Copy link
Member

@rowanc1 rowanc1 left a comment

Choose a reason for hiding this comment

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

Looks good, I can add some docs as well!

@@ -149,7 +150,12 @@ const handlers: Record<string, Handler> = {
return;
}
if (node.visibility === 'remove') return;
if (node.data?.tags?.includes('no-tex')) return;
if (metadataTags.includes('no-tex')) return;
Copy link
Member

Choose a reason for hiding this comment

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

Can we expand this to no-pdf and implement typst (no-typst) while we are here?

@fwkoch
Copy link
Member Author

fwkoch commented Apr 19, 2024

Addresses #714

@rowanc1 rowanc1 merged commit e0cd47e into main Apr 19, 2024
5 checks passed
@rowanc1 rowanc1 deleted the feat/new-page branch April 19, 2024 18:31
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

2 participants