for dir in */; do cd $dir; mkdir tex; find md/ -name \*.md -type f -exec pandoc -f markdown -t latex -o {}.tex {} \; mv md/*.tex tex/; cd ..; done