songs/bin/build.sh
Steve Krulewitz f5e7720b77 many changes
2019-09-14 17:25:52 -07:00

20 lines
416 B
Bash
Executable File

#!/bin/bash
mkdir -p ~/Library/texmf/tex/latex
ln -s "`realpath tex`" ~/Library/texmf/tex/latex/
input_file="`realpath "$1"`"
output_file=$(\
cat "$input_file" | \
grep "\\\begin{song}" | \
sed -E 's/.*title={([^}]*)}, band={([^}]*)}, year={([^}]*)}.*/\1 - \2 (\3)/' | \
tr -d '\n' \
)
pdflatex \
-interaction=nonstopmode \
-output-directory pdf \
-jobname="$output_file" \
"$input_file"