File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 11{ callPackage
2+ , coreutils
23, pandoc
34, texliveToUse
45} :
@@ -18,8 +19,16 @@ common.writeShellScriptBinWithAttrs {
1819} "export" ''
1920 echo_and_run() { echo "$*" ; "$@" ; }
2021 echo_and_run export PATH="'' ${PATH:+'' ${PATH}:}${ pandoc } /bin:${ texliveToUse } /bin"
21- echo_and_run ${ pandoc } /bin/pandoc -f markdown+tex_math_dollars+tex_math_single_backslash+raw_html+smart \
22- -t pdf \
23- "$1" \
24- "-o" "$2"
22+
23+ filename=$(${ coreutils } /bin/basename -- "$2")
24+ EXTENSION="'' ${filename##*.}"
25+ FILENAME="'' ${filename%.*}"
26+
27+ echo "Got extension: $EXTENSION"
28+ EXTRA_ARGS=""
29+ if [[ "$EXTENSION" == "md" ]]
30+ EXTRA_ARGS="-f markdown+tex_math_dollars+tex_math_single_backslash+raw_html+smart"
31+ fi
32+
33+ echo_and_run ${ pandoc } /bin/pandoc $EXTRA_ARGS -t pdf "$1" -o "$2"
2534''
You can’t perform that action at this time.
0 commit comments