-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHOWTO
82 lines (60 loc) · 3.28 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
#!/bin/bash
# The `bash HOWTO` command given at the command line within the `mdgBookSVG2Kit-main` directory
# in your computer will automatically carry out the following steps leading to the creation of the
# collection book: `mdgBookSVG2v1.pdf`.
#
# Create three sub-folders: `bin`, `images`, `res`, under the `mdgBookSVG-main` directory
# `bin` - folder for Bash files: mdg22mid+svg.sh, mdg22midRndN+svg.sh, mdgEntriesSVGcp2.sh
# `images` - folder for image files for book cover/title page: 1ed.png, FrontCover.pdf
# `res` - folder for ABC, SVG, PDF output files; should initially contain:
# cpeBach-gclef.abc - table of measures g-clef
# cpeBach-fclef.abc - table of measures f-clef
# hyperref.cfg - file containing the \hypersetup{} keyvalues for the \hyperref pkg
# mdg4.bib - bibliography file for the book
# mdgBookSVG2v1.tex - main LaTeX file for book
# mdgBookSVG2v1-cover.tex - LaTeX file for cover page
mkdir bin images res
mv *.sh bin
mv 1ed.png images; mv FrontCover.pdf images
mv cpeBach-*clef.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 DCSMs in book to be created)
# For 250 DCSMs to be generated: nnn=250. Here we create 150.
./mdg22midRndN+svg.sh 150
# Generate a list of SVGs created by the previous step:
ls --color=never cpeb*.svg > svgList.txt
# Create a list of figure entries for LaTeX file; *.pdf_tex files are also created using inkscape
./mdgEntriesSVGcp2.sh svgList.txt
# Change the font sizes of titles, subtitles. etc. in each cpeb*.pdf_tex file
sed -i 's/\\textbf{cpeb/\\textbf{\\footnotesize \\tt cpeb/g' *.pdf_tex
sed -i 's/\\textbf{Perm\./\\textbf{\\footnotesize \\tt Perm\.\\/g' *.pdf_tex
sed -i 's/\\textbf{= 90/\\textbf{\\footnotesize = 90/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 cpeBach-*clef.pdf (table of measures) SVGs; aslo *pdf_tex files using inkscape
abcm2ps -v -O= cpeBach-gclef.abc
abcm2ps -v -O= cpeBach-fclef.abc
inkscape --export-filename=cpeBach-gclef001.pdf --export-area-drawing --export-latex --export-latex cpeBach-gclef001.svg
inkscape --export-filename=cpeBach-fclef001.pdf --export-area-drawing --export-latex --export-latex cpeBach-fclef001.svg
## - line 57: add escapes ("\") before "_" (2x); and \url{---} for URL
sed -i.OLD '/http/s/_/\\_/g' cpeBach-*clef001.pdf_tex
sed -i.OLD 's/from http/from \\url{http/g' cpeBach-*clef001.pdf_tex
sed -i.OLD 's/measures\/; http/measures\/; \\url{http/g' cpeBach-*clef001.pdf_tex
sed -i.OLD 's/measures\/;/measures\/};/g' cpeBach-*clef001.pdf_tex
sed -i.OLD 's/843301\]/843301\]}/g' cpeBach-*clef001.pdf_tex
sed -i 's/\\textbf{= 90/\\textbf{\\footnotesize = 90/g' cpeBach-*clef001.pdf_tex
# Generate the PDF
pdflatex -synctex=1 -interaction=nonstopmode -shell-escape mdgBookSVG2v1.tex
bibtex mdgBookSVG2v1.aux
pdflatex -synctex=1 -interaction=nonstopmode -shell-escape mdgBookSVG2v1.tex
pdflatex -synctex=1 -interaction=nonstopmode -shell-escape mdgBookSVG2v1.tex
###
##
#