20 lines
481 B
Lua
20 lines
481 B
Lua
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
|