-
Notifications
You must be signed in to change notification settings - Fork 0
/
HOWTO
96 lines (70 loc) · 4.36 KB
/
HOWTO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/bash
# The `bash HOWTO` command given at the command line within the `mdgBookSVG4itKit-master` directory
# in your computer will automatically carry out the following steps leading to the creation of the
# collection book: `mdgBookSVG4itv1.pdf`.
#
# Create three sub-folders: `bin`, `images`, `res`, under the `mdgBookSVG4it-main` directory
# `bin` - folder for Bash files: mdg42midit+svg.sh, mdg42miditRndN-svg.sh, mdgEntriesSVGit2.sh
# `images` - folder for image files for book cover/title page: 1ed.png, FrontCover.pdf
# `res` - folder for ABC, SVG, PDF output files; initially contains:
# gf-TAB.pdf - crosstable for two-dice outcome vs. measure number of minuet
# haydnGF-easy-minuet-it.abc - table of measures for the minuets (for a trio)
# hyperref.cfg - file containing the \hypersetup{} keyvalues for the \hyperref pkg
# mdg4.bib - bibliography file for the book
# mdgBookSVG4itv1.tex - main LaTeX file for book
# mdgBookSVG4itv1-cover.tex - LaTeX file for cover page
mkdir bin images res
mv *.sh bin
mv 1ed.png images; mv FrontCover-it.pdf images
mv gf-TAB.pdf res; mv haydnGF-easy-minuet-it.abc res
mv hyperref.cfg res; mv mdg4.bib res
mv *.tex res
# Change directory res folder then, for each Bash file in `bin`, create a link
# from `bib` to `res`
cd res
ln -s ../bin/*.sh .
# Within `res` directory, generate nnn MDGs (nnn is number of MDG minuets in book to be created)
# For 250 minuets to be generated: nnn=250. Here we generate 50 minuets.
./mdg42miditRndN-svg.sh 50
## Generate the sample minuet for the Introduction
./mdg42midit+svg.sh 10 3 6 9 4 9 11 8 2 9 10 5 12 4 8 12
# Generate a list of SVGs created by the previous step:
ls --color=never gfmit-*.svg > svgList.txt
# Create a list of figure entries for LaTeX file; *.pdf_tex files are also created using inkscape
./mdgEntriesSVGit2.sh svgList.txt
# Change the font sizes of titles, subtitles, repeat signs in each gfmt-*.pdf_tex file
sed -i 's/\\textbf{gfmit/\\footnotesize \\tt {gfmit/g' gfmit-*.pdf_tex
sed -i 's/\\textbf{Perm\./\\footnotesize \\tt {Perm\.\\/' gfmit-*.pdf_tex
sed -i 's/\\textbf{= 90/\\footnotesize \\tt {= 90/' gfmit-*.pdf_tex
sed -i 's/\[t\]{c}\\textit{3}/\[t\]{c}\\textit{\\scriptsize 3}/g' gfmit-*.pdf_tex
sed -i 's/tabular}\[t\]{l}\\textbf{\\textit{tr/tabular}\[t\]{l}\\textbf{\\textit{\\scriptsize tr/g' gfmit-*.pdf_tex
# Move svgList.txt.output to svgList.tex
cp svgList.txt.output svgList.tex
# Remove trailing `001` from each svgList.tex entry
sed -i.OLD 's/001}/}/g' svgList.tex
sed -i.OLD 's/001.mid}/.mid}/g' svgList.tex
# Create SVGs for the haydnGF-easy-minuet.pdf (table of measures); also corresponding *pdf_tex files using inkscape
abcm2ps -v -O= haydnGF-easy-minuet-it.abc
inkscape --export-filename=haydnGF-easy-minuet-it001.pdf --export-area-drawing --export-latex haydnGF-easy-minuet-it001.svg
inkscape --export-filename=haydnGF-easy-minuet-it002.pdf --export-area-drawing --export-latex haydnGF-easy-minuet-it002.svg
inkscape --export-filename=haydnGF-easy-minuet-it003.pdf --export-area-drawing --export-latex haydnGF-easy-minuet-it003.svg
inkscape --export-filename=haydnGF-easy-minuet-it004.pdf --export-area-drawing --export-latex haydnGF-easy-minuet-it004.svg
## add escapes for "_"'s (12x); and \url{---}for URL; change to scriptsize
sed -i.OLD '/http/s/_/\\_/g' haydnGF-easy-minuet-it001.pdf_tex
sed -i.OLD '/put(0.31773628,1.28500584)/s/\\textit{3}/\\textit{${}$3}/' haydnGF-easy-minuet-it001.pdf_tex
sed -i.OLD 's/\[from http/\\scriptsize\[from \\url{http/g' haydnGF-easy-minuet-it001.pdf_tex
sed -i.OLD 's/Maximilian)\]/Maximilian)}\]/g' haydnGF-easy-minuet-it001.pdf_tex
## - add "\scriptsize" before every "tr" and "3-plet" (symbol for trill ornament)
## - change font for measure numbers from italics (it) to typewriter (tt)
sed -i 's/\\textbf{= 90/\\footnotesize \\tt {= 90/' haydnGF-*.pdf_tex
sed -i.OLD 's/\\textit{tr}/\\textit{\\scriptsize tr}/g' haydnGF-*.pdf_tex
sed -i.OLD 's/\[t\]{c}\\textit{3}/\[t\]{c}\\textit{\\scriptsize 3}/g' haydnGF-*.pdf_tex
sed -i.OLD 's/\[t\]{l}\\textit{/\[t\]{c}\\texttt{\\footnotesize /g' haydnGF-*.pdf_tex
# Generate the PDF
pdflatex -synctex=1 -interaction=nonstopmode -shell-escape mdgBookSVG4itv1.tex
bibtex mdgBookSVG4itv1.aux
pdflatex -synctex=1 -interaction=nonstopmode -shell-escape mdgBookSVG4itv1.tex
pdflatex -synctex=1 -interaction=nonstopmode -shell-escape mdgBookSVG4itv1.tex
###
##
#