-
Notifications
You must be signed in to change notification settings - Fork 0
Zettlr to InDesign (md to icml)
Zettlr does not provide direct export to InCopy .icml
(yet), but we want to export all references and the bibliography properly without using .docx
which cannot automatically update.
- Export
.md
from zettlr to.tex
- convert the
.tex
to.icml
using pandoc in the command line:$ pandoc -s -f latex -t icml -o master-text.icml master-text.tex
- place the InCopy file in a text frame in InDesign.
Correct spelling mistakes, line breaks, double spaces etc. in the master-text.md
. Then, repeat steps one and two and refresh the .icml
in the InDesign links pane to update.
input.md
→ output.icml
bibliography
(BibTeX-json file) and csl
(= citation style specification file) paths are set in the YAML header of your input.md
, like this:
---
bibliography: path/to/mybib.json
csl: path/to/chicago-autor-date.csl
---
# markdown h1
your file's content ...
Run this script in your working directory to automate the file conversions.
pandoc input.md -f markdown -t latex --citeproc -s --pdf-engine=xelatex --mathjax -o workingfile.tex
echo "md to latex done ..."
pandoc -s -f latex -t icml -o output.icml workingfile.tex
echo "... latex to icml done"
pause
Now the content can be updated in InDesign:
Open a text editor, paste the script and save it as md-icml-script.bat
- you can run it by opening the file or by navigating to the directory in the command line and typing & ".\md-icml-script.bat"
.