Skip to content

Instantly share code, notes, and snippets.

@berezovskyi
Created June 17, 2013 13:28
Show Gist options
  • Save berezovskyi/5796858 to your computer and use it in GitHub Desktop.
Save berezovskyi/5796858 to your computer and use it in GitHub Desktop.
Pandoc pdf export script for Windows which merges all markdown scripts in a subdirectory
@ECHO off
setlocal EnableDelayedExpansion
rem © 2013 Andrew Berezovskiy
rem Pandoc pdf export script
rem Merges all markdown scripts in a subdirectory
rem Requires PT Serif font family. See http://www.paratype.com/public/
for /f "delims=" %%a IN ('dir /A:-D /B %1') do (
SET FILE_LIST=!FILE_LIST!"%1/%%~a"
SET "FILE_LIST=!FILE_LIST! "
)
pandoc %FILE_LIST%-o %2^
--latex-engine=xelatex^
-V mainfont="PT Serif"^
-V geometry="top=1.5cm, bottom=1.5cm, right=1.5cm, left=2.5cm, footskip=0.7cm"^
-V fontsize="12pt"
@berezovskyi
Copy link
Author

Usage:

pdfall md-dir merge.pdf

where md-dir is the subdirectory with all MD files of current working directory. merge.pdf will be placed in CWD.

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