songs/bin/build.sh

20 lines
416 B
Bash
Raw Normal View History

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