This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Extension ofTarleb's answer on Stackoverflow (https://stackoverflow.com/a/52131435/3888000) to include docx section ends with portrait/landscape orientation changes. | |
| -- Also uses officer package syntax to create sections breaks | |
| local function newpage(format) | |
| if format == 'docx' then | |
| local pagebreak = '<w:p><w:r><w:br w:type="page"/></w:r></w:p>' | |
| return pandoc.RawBlock('openxml', pagebreak) | |
| else | |
| return pandoc.Para{pandoc.Str '\f'} |