I want to create a report with Quarto in a DOCX document. I have a problem with creating a page break which will stay one the same page.
yaml
---
format:
docx:
fig-width: 12
fig-height: 8
reference-doc: custom-reference-doc_landscape.docx
execute:
echo: false
eval: true
output: false
warning: false
message: false
editor: source
editor_options:
chunk_output_type: console
---
`r table1`
{{< pagebreak >}}
`r table2`
This works fine if there is at least one empty line after table 1. If the table fills the entire page, then the page break falls onto the next page with the addition of an empty page. Manually, I can solve my problem by changing the font size of the page break to really small one, but I am searching for some other solution.
Is it possible to change the font size of {{< pagebreak >}} with some code mybe?
system
Closed
February 12, 2024, 5:46pm
2
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed. If you have a query related to it or one of the replies, start a new topic and refer back with a link.
cderv
March 5, 2024, 4:00pm
3
No it is note. What this shortcodes do is inserting some raw openxml code into the document
local function stringify(x)
return type(x) == 'string' and x or stringify_orig(x)
end
--- configs – these are populated in the Meta filter.
local pagebreak = {
epub = '<p style="page-break-after: always;"> </p>',
html = '<div style="page-break-after: always;"></div>',
latex = '\\newpage{}',
ooxml = '<w:p><w:r><w:br w:type="page"/></w:r></w:p>',
odt = '<text:p text:style-name="Pagebreak"/>',
context = '\\page',
typst = '#pagebreak()'
}
local function pagebreaks_from_config (meta)
local html_class =
(meta.newpage_html_class and stringify(meta.newpage_html_class))
or os.getenv 'PANDOC_NEWPAGE_HTML_CLASS'
if html_class and html_class ~= '' then
so you can find some modified openxml syntax to do what you want and includes it using raw block maybe.
system
Closed
April 16, 2024, 4:01pm
5
This topic was automatically closed 42 days after the last reply. New replies are no longer allowed. If you have a query related to it or one of the replies, start a new topic and refer back with a link.