htdebeer / pandocomatic

Automate the use of pandoc

Home Page:https://heerdebeer.org/Software/markdown/pandocomatic/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

question: combine multiple docx while converting one from md

StefanLindow opened this issue · comments

Sorry, this is probably a bit dump, but as I cant find the time right now to understand the structure, I need to help:

I am using scrivomatic that uses pandocomatic and I am generating ouput from Scrivener to md to turn it into a docx while combining it with references. That works, but I would like to put a prepared docx in front and in the back, too. How and where do I refer to an external file?

docx: pandoc: toc: true from: markdown to: docx standalone: true lua-filter: - ./filters/pagebreak.lua # use \newpage{} also for HTML, DOCX, ODT & EPUB filter: #- filters/removeHR #remove horizontal rules - ./filters/prependAll.rb # prepends institute:, comments: and keywords: metadata into the text - ./filters/simplifyMetadata.rb #collapse down metadata "author: [name: affiliation:]" to author: reference-doc: templates/custom.docx #----------------------------------------------------------------------------- docx-refs: **extends: [docx,refs]**

I am not sure you can use pandocomatic to merge multiple (DOCX) files. You can set pandoc's --reference-doc property in your pandocomatic template, like you already do, but as far as I understand your question, that is not what you had in mind.

Your best bet would be to use a postprocessor to merge the output DOCX with the front and back DOCX files. You could run pandoc in that postprocessor. Maybe something like pandoc --from docx --to docx -o final.docx front.docx generated.docx back.docx would work?