From f35abc59bb07cde59b1415dd86b945b450105e90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gijs=20Vermari=C3=ABn?= Date: Fri, 26 Apr 2019 19:12:55 +0200 Subject: [PATCH] Created the marktex script --- compile.sh | 16 ++++++++++++++++ readme.md | 3 +++ 2 files changed, 19 insertions(+) create mode 100644 compile.sh create mode 100644 readme.md diff --git a/compile.sh b/compile.sh new file mode 100644 index 0000000..c68e03b --- /dev/null +++ b/compile.sh @@ -0,0 +1,16 @@ +# /bin/bash +notforconversion="readme.md" +echo $notforconversion is excluded from the conversion +markdownfiles=$(find ./ -iname "*.md" -and ! -name $notforconversion) +echo Trying to convert: $markdownfiles +for markdownfile in $markdownfiles; do + latextarget="$(echo $markdownfile | sed -e 's/.md/.tex/')" + if [ $latextarget -ot $markdownfile ]; then + latextarget="$(echo $markdownfile | sed -e 's/.md/.tex/')" + pandoc -f markdown -t latex $markdownfile >>$latextarget + echo "converted" $markdownfile "to" $latextarget + else + echo $markdownfile did not need converting as $latextarget is newer + fi +done +echo "done" diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..e5cce4a --- /dev/null +++ b/readme.md @@ -0,0 +1,3 @@ +# marktex +This is a small tool that writes converts all the markdown files in this folder to +a LaTeX .tex files with the corresponding name. It will not convert the readme.md file