-
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.
Added parameter support for tab file directory
- Loading branch information
1 parent
e898438
commit cb1b33b
Showing
4 changed files
with
57 additions
and
11 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
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,15 +1,21 @@ | ||
#!/bin/bash | ||
|
||
# Change path to your the directory where you store your tabs. | ||
for f in /users/remco/dropbox/tabs/*.txt | ||
if [ "$1" == "" ]; then | ||
echo "Please provide an path where your tab files are located." | ||
exit 4 | ||
fi | ||
|
||
files="$1/*.txt" | ||
|
||
for f in $files | ||
do | ||
filename=$(basename "$f") | ||
extension="${filename##*.}" | ||
filename="${filename%.*}" | ||
|
||
echo "\clearpage" | ||
echo "\section*{$filename}" | ||
echo "\markboth{$filename}{$filename}" | ||
echo "\addcontentsline{toc}{section}{$filename}" | ||
echo "\VerbatimInput{\"$f\"}" | ||
done | ||
done |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
if [ "$1" == "" ]; then | ||
echo "Please provide an 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 | ||
|
||
# replace TABDIR placeholder with actual value of the directory with tab files | ||
ex -sc $expression -cx ./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" | ||
|
||
# rename generated songbook pdf | ||
mv ./songbook.temp.pdf songbook.pdf | ||
|
||
# clean up temp files | ||
rm ./*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