-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c62172a
commit da7595d
Showing
5 changed files
with
22 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,4 +21,5 @@ | |
*.mtc1 | ||
*.out | ||
*.synctex.gz | ||
output/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,23 @@ | ||
#!/bin/bash | ||
|
||
if [ "$1" == "" ]; then | ||
echo "Please provide an path where your tab files are located." | ||
echo "Please provide a path where your tab files are located." | ||
exit 4 | ||
fi | ||
|
||
tabDir=${1%/} # remove last slash, if existing | ||
|
||
escapedDir="${tabDir//\//\/}" | ||
expression="%s/TABDIR/$escapedDir/g" | ||
|
||
# use a temp file, based on songbook.tex | ||
cp ./songbook.tex ./songbook.temp.tex | ||
cp ./songbook.tex ./output/songbook.temp.tex | ||
|
||
# replace TABDIR placeholder with actual value of the directory with tab files | ||
ex -sc $expression -cx ./songbook.temp.tex | ||
tabDir=${1%/} # remove last slash, if existing | ||
sed -i "s|TABDIR|$tabDir|g" ./output/songbook.temp.tex | ||
|
||
# run twice: first run for the table of contenst, second one for complete PDF | ||
xelatex -enable-write18 "./songbook.temp.tex" | ||
xelatex -enable-write18 "./songbook.temp.tex" | ||
xelatex -enable-write18 -output-directory=./output "./output/songbook.temp.tex" | ||
xelatex -enable-write18 -output-directory=./output "./output/songbook.temp.tex" | ||
|
||
# rename generated songbook pdf | ||
mv ./songbook.temp.pdf songbook.pdf | ||
mv ./output/songbook.temp.pdf ./output/songbook.pdf | ||
|
||
# clean up temp files | ||
rm ./*temp* | ||
rm ./output/*temp* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters