1
0
Files
bagu-thesis/pandoc/latex_docx_pagebreak.lua

20 lines
481 B
Lua
Raw Normal View History

2026-06-14 09:57:53 +08:00
local function is_pagebreak(text)
return text:find('\\newpage') or text:find('\\clearpage')
end
function RawBlock(el)
if el.format:match('tex$') then
if is_pagebreak(el.text) then
return pandoc.RawBlock('openxml', '<w:p><w:r><w:br w:type="page"/></w:r></w:p>')
end
end
end
function RawInline(el)
if el.format:match('tex$') then
if is_pagebreak(el.text) then
return pandoc.RawInline('openxml', '<w:r><w:br w:type="page"/></w:r>')
end
end
end