Commit babc08fb authored by Felix Hilsky's avatar Felix Hilsky
Browse files

include file name in md pdf output

parent 49286f4b
......@@ -2,4 +2,5 @@
\pagestyle{fancy}
\fancyhead{}
\fancyhead[L]{CURRENTCOMMIT}
\fancyfoot[L]{FILENAME}
\AtBeginDocument{\renewcommand{\setminus}{\mathbin{\backslash}}}
#! /usr/bin/env bash
set -e
infile="$1"
baseinfile=$(basename "${infile}")
outfile="${2:-$HOME/Desktop/pandoc.pdf}"
headertext="$(git log -1 --format=%aI\ %h)"
echo infile: $infile
......@@ -8,5 +10,6 @@ echo headertext: $headertext
mkdir -p .maindir/out
cp .maindir/scripts/md-preamble.tex .maindir/out/md-preamble-orig.tex
sed -i 's#CURRENTCOMMIT#'"${headertext}"'#' .maindir/scripts/md-preamble.tex
sed -i 's#FILENAME#'"${baseinfile}"'#' .maindir/scripts/md-preamble.tex
pandoc --pdf-engine lualatex --lua-filter .maindir/scripts/pandoc-gitlab-math.lua --include-in-header=.maindir/scripts/md-preamble.tex "${infile}" --output="${outfile}"
cp .maindir/out/md-preamble-orig.tex .maindir/scripts/md-preamble.tex
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment