packets
This commit is contained in:
parent
f5e7720b77
commit
f648cda060
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,4 +1,4 @@
|
||||
.DS_Store
|
||||
pdf
|
||||
build/
|
||||
*.pdf
|
||||
|
||||
|
55
bin/build.sh
55
bin/build.sh
@ -1,19 +1,50 @@
|
||||
#!/bin/bash
|
||||
|
||||
mkdir -p ~/Library/texmf/tex/latex
|
||||
ln -s "`realpath tex`" ~/Library/texmf/tex/latex/
|
||||
TEXML_HOME=$HOME/Library/texmf/tex/latex
|
||||
PDF_JOINER="/System/Library/Automator/Combine PDF Pages.action/Contents/Resources/join.py"
|
||||
|
||||
input_file="`realpath "$1"`"
|
||||
function setup_pdflatex {
|
||||
if [ ! -d $TEXML_HOME ]; then
|
||||
mkdir -p $TEXML_HOME
|
||||
fi
|
||||
|
||||
output_file=$(\
|
||||
cat "$input_file" | \
|
||||
grep "\\\begin{song}" | \
|
||||
sed -E 's/.*title={([^}]*)}, band={([^}]*)}, year={([^}]*)}.*/\1 - \2 (\3)/' | \
|
||||
tr -d '\n' \
|
||||
)
|
||||
if [ ! -d $TEXML_HOME/tex ]; then
|
||||
ln -s "`realpath tex`" $TEXML_HOME
|
||||
fi
|
||||
}
|
||||
|
||||
function make_pdf {
|
||||
infile="`realpath "$1"`"
|
||||
indir=$(dirname "$1")
|
||||
pdf_outdir="`realpath "build/pdf"`/${indir#songs/}"
|
||||
#aux_outdir="`realpath "aux"`/${indir#songs/}"
|
||||
|
||||
mkdir -p "$pdf_outdir"
|
||||
#mkdir -p "$aux_outdir"
|
||||
|
||||
pdflatex \
|
||||
-interaction=nonstopmode \
|
||||
-output-directory pdf \
|
||||
-jobname="$output_file" \
|
||||
"$input_file"
|
||||
-output-directory="$pdf_outdir" \
|
||||
"$infile"
|
||||
}
|
||||
|
||||
function make_packet {
|
||||
pdfs=""
|
||||
while read p; do
|
||||
make_pdf "songs/$p.tex"
|
||||
pdfs="$pdfs \"build/pdf/$p.pdf\""
|
||||
done < $1
|
||||
|
||||
mkdir -p "build/packets"
|
||||
#echo "$PDF_JOINER" --output "build/$1.pdf" $pdfs
|
||||
|
||||
pdflatex \
|
||||
-interaction=nonstopmode \
|
||||
-output-directory="build/packets" \
|
||||
"$1"
|
||||
}
|
||||
|
||||
setup_pdflatex
|
||||
#make_pdf "$1"
|
||||
|
||||
make_packet "packets/aircoustic201910.tex"
|
||||
|
11
packets/aircoustic201910.tex
Normal file
11
packets/aircoustic201910.tex
Normal file
@ -0,0 +1,11 @@
|
||||
\documentclass{article}
|
||||
\usepackage{grffile}
|
||||
\usepackage{pdfpages}
|
||||
\begin{document}
|
||||
\includepdf[pages=-]{build/pdf/Pat Benatar/We Belong.pdf}
|
||||
\includepdf[pages=-]{build/pdf/Daniel Johnston/Life In Vain.pdf}
|
||||
\includepdf[pages=-]{build/pdf/R.E.M./Fall on Me.pdf}
|
||||
\includepdf[pages=-]{build/pdf/Guns 'N Roses/Patience.pdf}
|
||||
\includepdf[pages=-]{build/pdf/Tears for Fears/Everybody Wants to Rule the World.pdf}
|
||||
\includepdf[pages=-]{build/pdf/George Michael/Faith.pdf}
|
||||
\end{document}
|
Loading…
Reference in New Issue
Block a user