Skip to content

Instantly share code, notes, and snippets.

@Merovex
Last active April 2, 2023 16:22
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Merovex/05e3216f8f4f6e965cd9d564b1496719 to your computer and use it in GitHub Desktop.
Save Merovex/05e3216f8f4f6e965cd9d564b1496719 to your computer and use it in GitHub Desktop.
-- Converts "* * *" Horizontal Rule to a "#" separator in Word DOCX
local hashrule = [[<w:p>
<w:pPr>
<w:pStyle w:val="HorizontalRule"/>
<w:ind w:firstLine="0"/>
<w:jc w:val="center"/>
</w:pPr>
<w:r>
<w:t>#</w:t>
</w:r>
</w:p>]]
function HorizontalRule (elem)
if FORMAT == 'docx' then
return pandoc.RawBlock('openxml', hashrule)
end
end
@agusmba
Copy link

agusmba commented Mar 6, 2020

In the comment: LaTeX -> Docx?

@Merovex
Copy link
Author

Merovex commented Mar 6, 2020

I use this for markdown to docx, but should work for latex to docx. Give it a try

@agusmba
Copy link

agusmba commented Mar 6, 2020

I meant the comment in the first line ;-)

@Merovex
Copy link
Author

Merovex commented Mar 7, 2020

ah, should have cut that. It was part of a larger lua script. I am transpiling Markdown to LaTeX and DOCX. I refer to fancy page breaks because of Memoir class when I convert the Markdown to LaTeX in Pandoc. (I copied the Memoir code into the Pandoc template.)

@agusmba
Copy link

agusmba commented Mar 10, 2020

no worries. Thanks for posting it!

@Merovex
Copy link
Author

Merovex commented Jul 26, 2020

Corrected the comment to reflect what it's doing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment