-
-
Notifications
You must be signed in to change notification settings - Fork 978
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create pagebreak from inline command too #1753
base: main
Are you sure you want to change the base?
Conversation
for docx only until further test
Thanks a lot for the quick replies and PR! And excuse my slow action... I upvote to activate RawInline insertion for limited formats because it sounds safer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to test all formats. I'm okay if it also works for HTML, LaTeX, and ODT. I can also merge the PR as is if you don't want or don't have time to test these formats. Thank you!
BTW, when you are done, please add a NEWS item.
The PR was still draft as I was waiting for it to be tested by @atusy. |
Merge branch 'master' into newpage-lua-docx # Conflicts: # NEWS.md
I decided to leave it only for DOCX and ODT. The commands are tex anyway so it is ok for pdf. @atusy You can can know retest that everything is ok with this PR now it is done. Thanks ! |
@atusy did you have a chance to look at it yet ? |
@cderv Oops, I'm sorry I have totally missed your mention. |
@cderv |
Yes I got the same you're right. I think come from the blank line in the Rmd file just after ---
output:
word_document:
md_extensions: "+hard_line_breaks"
---
Newpage juste after this line.\newpage
This is on a new page with a blank line before But if you don't put it, the docx file is corrupted 🤔 ---
output:
word_document:
md_extensions: "+hard_line_breaks"
---
Newpage just after this line.\newpage
This is on a new page This need to be improved ... if it can. I am not sure of the openxml raw code to add here. I'll look into it. Thank you for your test ! |
9ce8b28
to
2e8b846
Compare
This is a try to making some evolution to pandoc pagebreak lua filter in the aim of supporting inline command. Supporting this would fix #1752.
Initially the pagebreak lua filter was added from pandoc lua filters repo and support
\newpage
or\pagebreak
command as its own paragraph. It would detect this paragraph and replace it with a RawBlock with the correct pagebreak syntax.This PR is to see if we can detect one of the command in the paragraph itself and replace it by RawInline.
It seems to works well for docx output. This need to be thoroughly tested for other format.
This is a draft PR to share this and test it.