feat(code): Add docx landscape shortcodes

This commit is contained in:
Marty Oehme 2024-02-14 16:01:52 +01:00
parent 092b8d29c8
commit b0f7f49ebc
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A
2 changed files with 26 additions and 0 deletions

View file

@ -0,0 +1,6 @@
title: docx-landscape
author: Marty Oehme
version: 0.1.0
contributes:
shortcodes:
- landscape.lua

View file

@ -0,0 +1,20 @@
return {
["landscape"] = function(args, kwargs, meta)
if quarto.doc.isFormat("docx") then
return pandoc.RawBlock(
"openxml",
'<w:p><w:pPr><w:sectPr> <w:pgSz w:w="16848" w:h="11905" w:orient="landscape" /> <w:pgMar w:top="720" w:right="720" w:bottom="720" w:left="720" w:header="720" w:footer="851" w:gutter="0"/></w:sectPr></w:pPr></w:p>'
)
end
return pandoc.Para({ pandoc.Str("\f") })
end,
["portrait"] = function(args, kwargs, meta)
if quarto.doc.isFormat("docx") then
return pandoc.RawBlock(
"openxml",
'<w:p><w:pPr><w:sectPr> <w:pgSz w:w="11905" w:h="16848" w:orient="portrait" /> </w:sectPr></w:pPr></w:p>'
)
end
return pandoc.Para({ pandoc.Str("\f") })
end,
}