Skip to content

Instantly share code, notes, and snippets.

@vbajpai
Created July 11, 2012 09:22
Show Gist options
  • Save vbajpai/3089257 to your computer and use it in GitHub Desktop.
Save vbajpai/3089257 to your computer and use it in GitHub Desktop.
Convert a Directory Listing of Markdown Files to LaTeX using Pandoc.
>> export MDEXT='.md'
>> python -c "import os; \
filelist = os.listdir(os.getcwd()); \
print [os.system('echo executing: %s;pandoc --listings %s -o %s.tex'%(f, f,os.path.splitext(f)[0])) \
for f in filelist if os.path.splitext(f)[1] == os.environ['MDEXT']]"
@makokal
Copy link

makokal commented Jul 12, 2012

perhaps you should also add the other markdown file extensions (.markdown ...)

@vbajpai
Copy link
Author

vbajpai commented Jul 17, 2012

It was meant to be a quick hack.
To honor the comment, the command now expect the extension from a SHELL variable.

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