-
Notifications
You must be signed in to change notification settings - Fork 0
/
HOWTO
95 lines (69 loc) · 3.99 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
#!/bin/bash
# The `bash HOWTO` command given at the command line within the `mdgBookSVGKit-master` directory
# in your computer will automatically carry out the following steps leading to the creation of the
# collection book: `mdgBookSVGv1.pdf`.
#
# Create three sub-folders: `bin`, `images`, `res`, under the `mdgBookSVG-master` directory
# `bin` - folder for Bash files: mdg2mid-svg.sh, mdg2minRndN-svg.sh, entriesSVG.sh
# `images` - folder for image files for book cover/title page: 1.png, FrontCover.pdf
# `res` - folder for ABC, SVG, PDF output files; initially contains:
# 12TAB.pdf - crosstable for two-dice outcome vs. measure number of minuet
# abcmdg-k516f.abc - table of measures
# hyperref.cfg - file containing the \hypersetup{} keyvalues for the \hyperref pkg
# mdg1.bib - bibliography file for the book
# mdgBookSVGv1.tex - main LaTeX file for book
# mdgBookSVGv1-cover.tex - LaTeX file for cover page
mkdir bin images res
mv *.sh bin
mv 1.png images; mv FrontCover.pdf images
mv 12TAB.pdf res; mv abcmdg-k516f.abc res; mv hyperref.cfg res; mv mdg1.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.
./mdg2midRndN-svg.sh 250
# Generate a list of SVGs created by the previous step:
ls --color=never K516f*.svg > svgList.txt
# Create a list of figure entries for LaTeX file; *.pdf_tex files are also created using inkscape
./mdgEntriesSVG2.sh svgList.txt
# Change the font sizes of titles, subtitles, repeat signs in each K516f*.pdf_tex file
sed -i 's/\\textbf{K\.516/\\footnotesize \\tt {K\.516/g' *.pdf_tex
sed -i 's/\\textbf{Perm\./\\footnotesize \\tt {Perm\.\\/g' *.pdf_tex
sed -i 's/tabular}\[t\]{l}1/tabular}\[t\]{l}{\\footnotesize 1}/g' *.pdf_tex
sed -i 's/tabular}\[t\]{l}2/tabular}\[t\]{l}{\\footnotesize 2}/g' *.pdf_tex
sed -i 's/\\textbf{\\textit{tr}}/\\footnotesize\\textit{tr}/g' *.pdf_tex
sed -i 's/\\textbf{= 111}/\\footnotesize \\tt{= 111}/g' *.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 the abcmdg-k516f.pdf (table of measures) SVGs; aslo *pdf_tex files using inkscape
abcm2ps -v -O= abcmdg-k516f.abc
inkscape --export-filename=abcmdg-k516f001.pdf --export-area-drawing --export-latex abcmdg-k516f001.svg
inkscape --export-filename=abcmdg-k516f002.pdf --export-area-drawing --export-latex abcmdg-k516f002.svg
inkscape --export-filename=abcmdg-k516f003.pdf --export-area-drawing --export-latex abcmdg-k516f003.svg
inkscape --export-filename=abcmdg-k516f004.pdf --export-area-drawing --export-latex abcmdg-k516f004.svg
# Edit lines 53, 54 of abcmdg-k516f001.pdf_tex:
## - line 53: change ü (umlaut u) to \"{u} in Würferspiel
sed -i.OLD 's/ü/\\"{u}/g' abcmdg-k516f001.pdf_tex
## - line 54: add escapes ("\") before "%" (2x) and "_" (5x); and \url{---}for URL
sed -i.OLD '/http/s/_/\\_/g' abcmdg-k516f001.pdf_tex
sed -i.OLD 's/Source: http/Source: \\url{http/g' abcmdg-k516f001.pdf_tex
sed -i.OLD 's/Amadeus)\]/Amadeus)}\]/g' abcmdg-k516f001.pdf_tex
## - add "\scriptsize" before every "tr" and "1./2." (symbol for trill ornament)
sed -i.OLD 's/\\textit{tr}/\\textit{\\footnotesize tr}/g' abcmdg-*.pdf_tex
sed -i.OLD 's/tabular}\[t\]{l}1\./tabular}\[t\]{l}\\footnotesize 1\./g' abcmdg-*.pdf_tex
sed -i.OLD 's/tabular}\[t\]{l}2\./tabular}\[t\]{l}\\footnotesize 2\./g' abcmdg-*.pdf_tex
sed -i.OLD 's/\[t\]{l}\\textit{/\[t\]{c}\\texttt{\\footnotesize /g' abcmdg-*.pdf_tex
# Generate the PDF
pdflatex -synctex=1 -interaction=nonstopmode -shell-escape mdgBookSVGv1.tex
bibtex mdgBookSVGv1.aux
pdflatex -synctex=1 -interaction=nonstopmode -shell-escape mdgBookSVGv1.tex
pdflatex -synctex=1 -interaction=nonstopmode -shell-escape mdgBookSVGv1.tex
###
##
#