packets
This commit is contained in:
parent
f5e7720b77
commit
f648cda060
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,4 +1,4 @@
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
pdf
|
build/
|
||||||
*.pdf
|
*.pdf
|
||||||
|
|
||||||
|
59
bin/build.sh
59
bin/build.sh
@ -1,19 +1,50 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
mkdir -p ~/Library/texmf/tex/latex
|
TEXML_HOME=$HOME/Library/texmf/tex/latex
|
||||||
ln -s "`realpath tex`" ~/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=$(\
|
if [ ! -d $TEXML_HOME/tex ]; then
|
||||||
cat "$input_file" | \
|
ln -s "`realpath tex`" $TEXML_HOME
|
||||||
grep "\\\begin{song}" | \
|
fi
|
||||||
sed -E 's/.*title={([^}]*)}, band={([^}]*)}, year={([^}]*)}.*/\1 - \2 (\3)/' | \
|
}
|
||||||
tr -d '\n' \
|
|
||||||
)
|
|
||||||
|
|
||||||
pdflatex \
|
function make_pdf {
|
||||||
-interaction=nonstopmode \
|
infile="`realpath "$1"`"
|
||||||
-output-directory pdf \
|
indir=$(dirname "$1")
|
||||||
-jobname="$output_file" \
|
pdf_outdir="`realpath "build/pdf"`/${indir#songs/}"
|
||||||
"$input_file"
|
#aux_outdir="`realpath "aux"`/${indir#songs/}"
|
||||||
|
|
||||||
|
mkdir -p "$pdf_outdir"
|
||||||
|
#mkdir -p "$aux_outdir"
|
||||||
|
|
||||||
|
pdflatex \
|
||||||
|
-interaction=nonstopmode \
|
||||||
|
-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