prophecy 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +19 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/Overview.md +44 -0
- data/README.md +35 -0
- data/Rakefile +1 -0
- data/bin/kindlegen +18 -0
- data/bin/kindlegen.exe +0 -0
- data/bin/kindlegen_linux +0 -0
- data/bin/kindlegen_mac +0 -0
- data/bin/prophecy +4 -0
- data/docs/licenses/kindlegen/.empty_directory +0 -0
- data/docs/licenses/kindlegen/EULA.txt +61 -0
- data/docs/licenses/kindlegen/KindleGen Legal Notices 2009-11-10 Linux.txt +21 -0
- data/docs/licenses/kindlegen/KindleGen Legal Notices 2009-11-10 Mac.txt +21 -0
- data/docs/licenses/kindlegen/KindleGen OSS Notices 2009-07-29-Windows.txt +19 -0
- data/features/assets.feature +14 -0
- data/features/book.feature +10 -0
- data/features/generator.feature +15 -0
- data/features/support/hooks.rb +5 -0
- data/features/support/setup.rb +3 -0
- data/lib/prophecy/assets/.gitignore +2 -0
- data/lib/prophecy/assets/config.rb +20 -0
- data/lib/prophecy/assets/epub_template/META-INF/com.apple.ibooks.display-options.xml +6 -0
- data/lib/prophecy/assets/epub_template/META-INF/container.xml +6 -0
- data/lib/prophecy/assets/epub_template/OEBPS/.gitkeep +0 -0
- data/lib/prophecy/assets/epub_template/OEBPS/chapters/.gitkeep +0 -0
- data/lib/prophecy/assets/epub_template/OEBPS/content.opf.erb +114 -0
- data/lib/prophecy/assets/epub_template/OEBPS/toc.ncx.erb +18 -0
- data/lib/prophecy/assets/epub_template/mimetype +1 -0
- data/lib/prophecy/assets/fonts/Crimson-Bold.otf +0 -0
- data/lib/prophecy/assets/fonts/Crimson-BoldItalic.otf +0 -0
- data/lib/prophecy/assets/fonts/Crimson-Italic.otf +0 -0
- data/lib/prophecy/assets/fonts/Crimson-Roman.otf +0 -0
- data/lib/prophecy/assets/fonts/Crimson-Semibold.otf +0 -0
- data/lib/prophecy/assets/fonts/Crimson-SemiboldItalic.otf +0 -0
- data/lib/prophecy/assets/fonts/GenBasB.ttf +0 -0
- data/lib/prophecy/assets/fonts/GenBasBI.ttf +0 -0
- data/lib/prophecy/assets/fonts/GenBasI.ttf +0 -0
- data/lib/prophecy/assets/fonts/GenBasR.ttf +0 -0
- data/lib/prophecy/assets/fonts/GenBkBasB.ttf +0 -0
- data/lib/prophecy/assets/fonts/GenBkBasBI.ttf +0 -0
- data/lib/prophecy/assets/fonts/GenBkBasI.ttf +0 -0
- data/lib/prophecy/assets/fonts/GenBkBasR.ttf +0 -0
- data/lib/prophecy/assets/fonts/GentiumPlus-I.ttf +0 -0
- data/lib/prophecy/assets/fonts/GentiumPlus-R.ttf +0 -0
- data/lib/prophecy/assets/helpers/check_typos.sh +27 -0
- data/lib/prophecy/assets/helpers/helpers.rb +0 -0
- data/lib/prophecy/assets/helpers/pali_typos +2 -0
- data/lib/prophecy/assets/helpers/sed_chars +5 -0
- data/lib/prophecy/assets/helpers/sed_dumb_ebook +18 -0
- data/lib/prophecy/assets/helpers/sed_tex2uni +62 -0
- data/lib/prophecy/assets/helpers/tex2html.sh +112 -0
- data/lib/prophecy/assets/helpers/tex2md.sh +10 -0
- data/lib/prophecy/assets/helpers/tidy_quotes +1 -0
- data/lib/prophecy/assets/helpers/tidy_quotes.sh +8 -0
- data/lib/prophecy/assets/helpers/to-html.sh +9 -0
- data/lib/prophecy/assets/latex_template/Makefile +37 -0
- data/lib/prophecy/assets/latex_template/anecdote.cls +163 -0
- data/lib/prophecy/assets/latex_template/book-core-first.sty +673 -0
- data/lib/prophecy/assets/latex_template/book-core-last.sty +40 -0
- data/lib/prophecy/assets/latex_template/book_main.tex.erb +31 -0
- data/lib/prophecy/assets/latex_template/booklet_main.tex +15 -0
- data/lib/prophecy/assets/latex_template/chapters/.gitkeep +0 -0
- data/lib/prophecy/assets/latex_template/cover_main.tex +48 -0
- data/lib/prophecy/assets/latex_template/mylayout.sty +2 -0
- data/lib/prophecy/assets/layouts/page.xhtml.erb +20 -0
- data/lib/prophecy/assets/sass/_booktheme.sass +3 -0
- data/lib/prophecy/assets/sass/_byronic.sass +263 -0
- data/lib/prophecy/assets/sass/_colors.sass +7 -0
- data/lib/prophecy/assets/sass/_epub-css-starter-kit.sass +734 -0
- data/lib/prophecy/assets/sass/_font-existence.scss +12 -0
- data/lib/prophecy/assets/sass/_font-source-sans-pro.scss +75 -0
- data/lib/prophecy/assets/sass/_fontfaces.scss +11 -0
- data/lib/prophecy/assets/sass/_mixins.sass +4 -0
- data/lib/prophecy/assets/sass/print.sass +6 -0
- data/lib/prophecy/assets/sass/style-epub.sass +7 -0
- data/lib/prophecy/assets/sass/style-mobi-kf8.sass +7 -0
- data/lib/prophecy/assets/sass/style-mobi.sass +9 -0
- data/lib/prophecy/assets/stylesheets/print.css +3 -0
- data/lib/prophecy/assets/stylesheets/style-epub.css +401 -0
- data/lib/prophecy/assets/stylesheets/style-mobi-kf8.css +401 -0
- data/lib/prophecy/assets/stylesheets/style-mobi.css +317 -0
- data/lib/prophecy/assets/webfonts/existence-light.ttf +0 -0
- data/lib/prophecy/assets/webfonts/sourcesanspro-bold.ttf +0 -0
- data/lib/prophecy/assets/webfonts/sourcesanspro-extralight.ttf +0 -0
- data/lib/prophecy/assets/webfonts/sourcesanspro-italic.ttf +0 -0
- data/lib/prophecy/assets/webfonts/sourcesanspro-light.ttf +0 -0
- data/lib/prophecy/assets/webfonts/sourcesanspro-lightitalic.ttf +0 -0
- data/lib/prophecy/assets/webfonts/sourcesanspro-regular.ttf +0 -0
- data/lib/prophecy/assets/webfonts-extra/sourcesanspro-bolditalic.ttf +0 -0
- data/lib/prophecy/assets/webfonts-extra/sourcesanspro-extralightitalic.ttf +0 -0
- data/lib/prophecy/assets/webfonts-extra/sourcesanspro-semibold.ttf +0 -0
- data/lib/prophecy/assets/webfonts-extra/sourcesanspro-semibolditalic.ttf +0 -0
- data/lib/prophecy/book.rb +281 -0
- data/lib/prophecy/chapter.rb +359 -0
- data/lib/prophecy/cli.rb +144 -0
- data/lib/prophecy/generators/assets.rb +29 -0
- data/lib/prophecy/generators/book/.gitignore +7 -0
- data/lib/prophecy/generators/book/LICENSE.txt +5 -0
- data/lib/prophecy/generators/book/README.md.tt +4 -0
- data/lib/prophecy/generators/book/book.yml.tt +55 -0
- data/lib/prophecy/generators/book/build/epub/.empty_directory +0 -0
- data/lib/prophecy/generators/book/build/latex/.empty_directory +0 -0
- data/lib/prophecy/generators/book/build/mobi/.empty_directory +0 -0
- data/lib/prophecy/generators/book/epub_mobi.yml +26 -0
- data/lib/prophecy/generators/book/example-book.yml +78 -0
- data/lib/prophecy/generators/book/images/cover.jpg +0 -0
- data/lib/prophecy/generators/book/images/cover.xcf +0 -0
- data/lib/prophecy/generators/book/images/publisher-logo.jpg +0 -0
- data/lib/prophecy/generators/book/manuscript/glossary.md +7 -0
- data/lib/prophecy/generators/book/manuscript/nameless-labyrinth.markdown +34 -0
- data/lib/prophecy/generators/book/manuscript/preface.md +5 -0
- data/lib/prophecy/generators/book/manuscript/the-sway-of-reason.markdown +22 -0
- data/lib/prophecy/generators/book/manuscript/unhuman-massiveness.markdown +27 -0
- data/lib/prophecy/generators/book/manuscript/xhtml/.gitkeep +0 -0
- data/lib/prophecy/generators/book/manuscript/xhtml/cover.xhtml.erb +21 -0
- data/lib/prophecy/generators/book/manuscript/xhtml/titlepage.xhtml.erb +31 -0
- data/lib/prophecy/generators/book/manuscript/xhtml/toc.xhtml.erb +16 -0
- data/lib/prophecy/generators/new.rb +22 -0
- data/lib/prophecy/manifest.rb +72 -0
- data/lib/prophecy/version.rb +3 -0
- data/lib/prophecy.rb +18 -0
- data/prophecy.gemspec +36 -0
- data/spec/book_spec.rb +9 -0
- data/spec/chapter_spec.rb +0 -0
- data/spec/manifest_spec.rb +0 -0
- metadata +366 -0
@@ -0,0 +1,62 @@
|
|
1
|
+
s/\\=[{]\\i[}]/ī/g
|
2
|
+
s/\\= *\\i/ī/g
|
3
|
+
|
4
|
+
s/\\=[{]u[}]/ū/g
|
5
|
+
s/\\= *u/ū/g
|
6
|
+
|
7
|
+
s/\\=[{]U[}]/Ū/g
|
8
|
+
s/\\= *U/Ū/g
|
9
|
+
|
10
|
+
s/\\=[{]a[}]/ā/g
|
11
|
+
s/\\= *a/ā/g
|
12
|
+
|
13
|
+
s/\\=[{]A[}]/Ā/g
|
14
|
+
s/\\= *A/Ā/g
|
15
|
+
|
16
|
+
s/\\d[{]n[}]/ṇ/g
|
17
|
+
s/\\d *n/ṇ/g
|
18
|
+
|
19
|
+
s/\\d[{]N[}]/Ṇ/g
|
20
|
+
s/\\d *N/Ṇ/g
|
21
|
+
|
22
|
+
s/\\d[{]t[}]/ṭ/g
|
23
|
+
s/\\d *t/ṭ/g
|
24
|
+
|
25
|
+
s/\\d[{]T[}]/Ṭ/g
|
26
|
+
s/\\d *T/Ṭ/g
|
27
|
+
|
28
|
+
s/\\d[{]d[}]/ḍ/g
|
29
|
+
s/\\d *d/ḍ/g
|
30
|
+
|
31
|
+
s/\\d[{]D[}]/Ḍ/g
|
32
|
+
s/\\d *D/Ḍ/g
|
33
|
+
|
34
|
+
s/\\d[{]l[}]/ḷ/g
|
35
|
+
s/\\d *l/ḷ/g
|
36
|
+
|
37
|
+
s/\\d[{]L[}]/Ḷ/g
|
38
|
+
s/\\d *L/Ḷ/g
|
39
|
+
|
40
|
+
s/\\d[{]m[}]/ṃ/g
|
41
|
+
s/\\d *m/ṃ/g
|
42
|
+
|
43
|
+
s/\\d[{]M[}]/Ṃ/g
|
44
|
+
s/\\d *M/Ṃ/g
|
45
|
+
|
46
|
+
s/\\\.[{]n[}]/ṅ/g
|
47
|
+
s/\\\. *n/ṅ/g
|
48
|
+
|
49
|
+
s/\\\.[{]N[}]/Ṅ/g
|
50
|
+
s/\\\. *N/Ṅ/g
|
51
|
+
|
52
|
+
s/\\\.[{]m[}]/ṁ/g
|
53
|
+
s/\\\. *m/ṁ/g
|
54
|
+
|
55
|
+
s/\\\.[{]M[}]/Ṁ/g
|
56
|
+
s/\\\. *M/Ṁ/g
|
57
|
+
|
58
|
+
s/\\~[{]n[}]/ñ/g
|
59
|
+
s/\\~ *n/ñ/g
|
60
|
+
|
61
|
+
s/\\~[{]N[}]/Ñ/g
|
62
|
+
s/\\~ *N/Ñ/g
|
@@ -0,0 +1,112 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
for i in ./tex/*.tex
|
4
|
+
do
|
5
|
+
sed -f sed_tex2uni $i |\
|
6
|
+
sed -f sed_chars |\
|
7
|
+
# for dumb E-book readers, problematic characters with latin
|
8
|
+
sed -f sed_dumb_ebook > tmp/`basename $i`
|
9
|
+
done
|
10
|
+
|
11
|
+
for i in ./tmp/*.tex
|
12
|
+
do
|
13
|
+
echo "## File: $i"
|
14
|
+
echo ""
|
15
|
+
|
16
|
+
sed -i -e 's/^ *//; s/ *$//; /^%/d' $i
|
17
|
+
cat $i | sed -e '/^\\looseness=-*[0-9] *$/d; /^\\index[[][^]]\+[]][{].\+[}] *$/d;' |\
|
18
|
+
sed -e 's/\(\w\)\\-\(\w\)/\1\2/g; s/\([[:alnum:]]\)~\+\([[:alnum:]]\)/\1 \2/g; s/\\noindent//g; s/\\clearpage//g; s/\\\\/<br \/>/g; s/\\linebreak\\//g; s/\\linebreak[{][}]\\//g; s/\\linebreak//g; s/\\thinspace//g;' |\
|
19
|
+
sed 's/\\textsuperscript[{]\([^}]\+\)[}]/<span class="superscript">\1<\/span>/g' |\
|
20
|
+
# sed -e 's/\\ldots\\/\…/g; s/\\ldots[{][}]/\…/g;' |\
|
21
|
+
sed -e 's/\\ldots\\/.../g; s/\\ldots[{][}]/.../g;' |\
|
22
|
+
sed 's/\\section[*]*[{]\([^}]\+\)[}]/<h3 class="section">\1<\/h3>/g' |\
|
23
|
+
sed 's/\\subsection[*]*[{]\([^}]\+\)[}]/<h3 class="subsection">\1<\/h3>/g' |\
|
24
|
+
sed '/^\\vspace[*][{][^}]\+[}] *$/d' |\
|
25
|
+
sed -e '1{/./{s/^/<p>\n/}}; 1{/^$/{s/^/<p>/}};' |\
|
26
|
+
sed -e '${/./{s/$/\n<\/p>/}}; ${/^$/{s/$/<\/p>/}};' |\
|
27
|
+
sed 's/\\mbox[{]\([^}]\+\)[}]/\1/g' |\
|
28
|
+
# sed 's/\\glsdisp[{]\([^}]\+\)[}][{]\([^}]\+\)[}]/<a class="glslink" href="glossary.html#\1">\2<\/a>/g' |\
|
29
|
+
sed 's/\\glsdisp[{]\([^}]\+\)[}][{]\([^}]\+\)[}]/\2/g' |\
|
30
|
+
# sed 's/\\glslink[{]\([^}]\+\)[}][{]\([^}]\+\)[}]/<a class="glslink" href="glossary.html#\1">\2<\/a>/g' |\
|
31
|
+
sed 's/\\glslink[{]\([^}]\+\)[}][{]\([^}]\+\)[}]/\2/g' |\
|
32
|
+
sed 's/\\qaitem[{]\([^}]\+\)[}]/<i>\1<\/i>/g' |\
|
33
|
+
sed -e 's/\\dropcaps[{]\([^}]\+\)[}][{]\([^}]\+\)[}]/\1\2/; s/\\pali[{]\([^}]\+\)[}]/<i>\1<\/i>/g; s/\\textit[{]\([^}]\+\)[}]/<i>\1<\/i>/g;' |\
|
34
|
+
# sed 's/\\footnote[{]\([^}]\+\)[}]/<span class="footnote">\1<\/span>/g' |\
|
35
|
+
sed -e 's/\\begin[{]verse[}]/<blockquote>/g; s/\\end[{]verse[}]/<\/blockquote>/g;' |\
|
36
|
+
sed 's/^$/<\/p><p>/' > "$i.tmp"
|
37
|
+
|
38
|
+
# process footnotes
|
39
|
+
|
40
|
+
FN=1
|
41
|
+
remains=-1
|
42
|
+
prev_rem=-2
|
43
|
+
|
44
|
+
echo -n "" > "$i.tmp.footnotes"
|
45
|
+
|
46
|
+
while [ ! $remains -eq 0 ]
|
47
|
+
do
|
48
|
+
|
49
|
+
if [ $remains -eq $prev_rem ]; then
|
50
|
+
echo -e "\n* WARNING! Remainin footnotes? $remains lines\n"
|
51
|
+
grep -nE '\\footnote[{][^}]+[}]' "$i.tmp" | sed -e 's/^/ /; s/$/\n/'
|
52
|
+
echo ""
|
53
|
+
break
|
54
|
+
fi
|
55
|
+
|
56
|
+
# for now, dealing with one-liner footnotes only
|
57
|
+
|
58
|
+
converted_lines=""
|
59
|
+
line=$(grep -noE '\\footnote[{][^}]+[}]' "$i.tmp" | sed -e '1!d; s/^\([0-9]\+\):.*/\1/')
|
60
|
+
|
61
|
+
while [ "$line" != "" ]
|
62
|
+
do
|
63
|
+
converted_lines="$converted_lines $line"
|
64
|
+
cat "$i.tmp" | sed -e ''$line'!d; s/^.*\\footnote[{]\([^}]\+\)[}].*$/<p><a href="#ref'$FN'" id="fn'$FN'"><span class="superscript">'$FN'<\/span>:<\/a> \1<\/p>/; ' >> "$i.tmp.footnotes"
|
65
|
+
|
66
|
+
sed -i -e "$line"'{ s/\\footnote[{]\([^}]\+\)[}]/<a href="#fn'$FN'" id="ref'$FN'"><span class="superscript">'$FN'<\/span><\/a>/ }' "$i.tmp"
|
67
|
+
|
68
|
+
((FN++))
|
69
|
+
line=$(grep -noE '\\footnote[{][^}]+[}]' "$i.tmp" | sed -e '1!d; s/^\([0-9]\+\):.*/\1/')
|
70
|
+
done
|
71
|
+
|
72
|
+
prev_rem="$remains"
|
73
|
+
remains=$(grep -cE '\\footnote[{][^}]+[}]' "$i.tmp")
|
74
|
+
done
|
75
|
+
|
76
|
+
if [ "$converted_lines" != "" ]; then
|
77
|
+
echo "Converted footnotes on lines: $converted_lines"
|
78
|
+
fi
|
79
|
+
|
80
|
+
echo ""
|
81
|
+
|
82
|
+
echo -e -n "\n\n" >> "$i.tmp"
|
83
|
+
cat "$i.tmp.footnotes" >> "$i.tmp"
|
84
|
+
rm "$i.tmp.footnotes"
|
85
|
+
|
86
|
+
# check for remaining commands, braces, and other chars
|
87
|
+
|
88
|
+
c=$(grep -cE '\\[a-zA-Z]' "$i.tmp")
|
89
|
+
if [ ! $c -eq 0 ]; then
|
90
|
+
echo -e "* WARNING! Remaining commands? $c lines\n"
|
91
|
+
grep -nE '\\[a-zA-Z]' "$i.tmp" | sed -e 's/^/ /; s/$/\n/'
|
92
|
+
echo ""
|
93
|
+
fi
|
94
|
+
|
95
|
+
c=$(grep -cE '[{}]' "$i.tmp")
|
96
|
+
if [ ! $c -eq 0 ]; then
|
97
|
+
echo -e "* WARNING! Remaining braces? $c lines\n"
|
98
|
+
grep -nE '[{}]' "$i.tmp" | sed -e 's/^/ /; s/$/\n/'
|
99
|
+
echo ""
|
100
|
+
fi
|
101
|
+
|
102
|
+
chars="~%"
|
103
|
+
c=$(grep -cE '['$chars']' "$i.tmp")
|
104
|
+
if [ ! $c -eq 0 ]; then
|
105
|
+
echo -e "* WARNING! Remaining $chars ? $c lines\n"
|
106
|
+
grep -nE '['$chars']' "$i.tmp" | sed -e 's/^/ /; s/$/\n/'
|
107
|
+
echo ""
|
108
|
+
fi
|
109
|
+
|
110
|
+
mv "$i.tmp" "$i.html"
|
111
|
+
|
112
|
+
done
|
@@ -0,0 +1 @@
|
|
1
|
+
s/\('\+\)\([[:punct:]]\)/\2\1/g
|
@@ -0,0 +1,37 @@
|
|
1
|
+
FILE=book_main
|
2
|
+
|
3
|
+
LATEX=lualatex
|
4
|
+
BIBTEX=bibtex
|
5
|
+
|
6
|
+
LATEX_OPTS=-interaction=nonstopmode -halt-on-error
|
7
|
+
|
8
|
+
all: document
|
9
|
+
|
10
|
+
document:
|
11
|
+
$(LATEX) $(LATEX_OPTS) $(FILE).tex;
|
12
|
+
|
13
|
+
view:
|
14
|
+
evince $(FILE).pdf &
|
15
|
+
|
16
|
+
cover-front:
|
17
|
+
$(LATEX) $(LATEX_OPTS) cover_front.tex
|
18
|
+
|
19
|
+
cover-back:
|
20
|
+
$(LATEX) $(LATEX_OPTS) cover_back.tex
|
21
|
+
|
22
|
+
cover-spine:
|
23
|
+
$(LATEX) $(LATEX_OPTS) cover_spine.tex
|
24
|
+
+pdftk cover_spine.pdf cat 1-endR output cover_spine_R.pdf
|
25
|
+
|
26
|
+
cover:
|
27
|
+
$(LATEX) $(LATEX_OPTS) cover.tex
|
28
|
+
|
29
|
+
cover-all:
|
30
|
+
make cover-front
|
31
|
+
make cover-back
|
32
|
+
make cover-spine
|
33
|
+
make cover
|
34
|
+
|
35
|
+
clean:
|
36
|
+
+rm -fv $(FILE).{dvi,ps,pdf,aux,log,bbl,blg}
|
37
|
+
|
@@ -0,0 +1,163 @@
|
|
1
|
+
% Anecdote Class
|
2
|
+
%
|
3
|
+
% Maintained by:
|
4
|
+
% Gambhiro Bhikkhu <gambhiro@ratanagiri.org.uk>
|
5
|
+
%
|
6
|
+
% LPPL LaTeX Pubic Project Licence
|
7
|
+
%
|
8
|
+
|
9
|
+
% ==============
|
10
|
+
% Identification
|
11
|
+
% ==============
|
12
|
+
|
13
|
+
\NeedsTeXFormat{LaTeX2e}
|
14
|
+
\ProvidesClass{anecdote}[2013/08/19 v0.5 A document class with a contemporary style.]
|
15
|
+
|
16
|
+
% ========================
|
17
|
+
% Preliminary Declarations
|
18
|
+
% ========================
|
19
|
+
|
20
|
+
% =======
|
21
|
+
% Options
|
22
|
+
% =======
|
23
|
+
|
24
|
+
\RequirePackage{pgfopts}
|
25
|
+
\RequirePackage{calc}
|
26
|
+
|
27
|
+
\pgfkeys{
|
28
|
+
/ARU/.cd,
|
29
|
+
pagePreset/.default=largepage,% "largepage": 6x9in, "smallpage": 5.25x8in
|
30
|
+
pagePreset/.store in=\ARU@pagePreset,
|
31
|
+
babelLanguage/.default=british,
|
32
|
+
babelLanguage/.store in=\ARU@babelLanguage,
|
33
|
+
}
|
34
|
+
|
35
|
+
% Pass all unknown options to memoir
|
36
|
+
\DeclareOption*{%
|
37
|
+
\PassOptionsToClass{\CurrentOption}{memoir}
|
38
|
+
}
|
39
|
+
|
40
|
+
\ProcessPgfOptions{/ARU}
|
41
|
+
\ProcessOptions\relax
|
42
|
+
|
43
|
+
% ======================
|
44
|
+
% All Other Declarations
|
45
|
+
% ======================
|
46
|
+
|
47
|
+
\LoadClass[11pt,twoside]{memoir}
|
48
|
+
|
49
|
+
\RequirePackage{book-core-first}
|
50
|
+
|
51
|
+
% === Page geometry and layout ===
|
52
|
+
|
53
|
+
% Symbols used:
|
54
|
+
% P = page proportion (h/w)
|
55
|
+
% T = textblock proportion (d/m)
|
56
|
+
% w = paper width
|
57
|
+
% h = paper height
|
58
|
+
% m = text width
|
59
|
+
% d = text height
|
60
|
+
|
61
|
+
\ifthenelse{\equal{\ARU@pagePreset}{largepage}}{
|
62
|
+
|
63
|
+
% Large page size
|
64
|
+
%
|
65
|
+
% 6in x 9in page
|
66
|
+
% P = 1.5 (fifth)
|
67
|
+
% T = 1.732 (sqrt(3)), Hexagon
|
68
|
+
|
69
|
+
% For 11pt / 16pt font size, Gentium font, 5pt parskip, no parindent.
|
70
|
+
% TODO: elaborate on reasonale
|
71
|
+
|
72
|
+
% === normalsize ===
|
73
|
+
|
74
|
+
\renewcommand{\normalsize}{%
|
75
|
+
\@setfontsize\normalsize{11}{16}
|
76
|
+
\abovedisplayskip 11\p@ \@plus3\p@ \@minus6\p@
|
77
|
+
\abovedisplayshortskip \z@ \@plus3\p@
|
78
|
+
\belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@
|
79
|
+
\belowdisplayskip \abovedisplayskip
|
80
|
+
\color{textbody}
|
81
|
+
\let\@listi\@listI}
|
82
|
+
\normalsize
|
83
|
+
|
84
|
+
% === indentations ===
|
85
|
+
|
86
|
+
\setlength{\vgap}{1.5em}
|
87
|
+
\setlength{\vindent}{\vgap}
|
88
|
+
\setlength{\vleftmargin}{2em}
|
89
|
+
|
90
|
+
\setlength{\parskip}{5pt}
|
91
|
+
\setlength{\parindent}{0pt}
|
92
|
+
|
93
|
+
% === setup page layout ===
|
94
|
+
|
95
|
+
\setstocksize{9in}{6in}
|
96
|
+
\settrimmedsize{\stockheight}{\stockwidth}{*}
|
97
|
+
\settrims{0pt}{0pt}
|
98
|
+
% It won't be exactly 33 lines because of the parskip,
|
99
|
+
% but close enough for our purpose.
|
100
|
+
\settypeblocksize{32\baselineskip + \topskip}{*}{0.577}% 1/1.732 (sqrt(3)), Hexagon
|
101
|
+
\setlrmargins{*}{*}{1.125}% 1/0.889 major 2nd, 25.6mm | 22.77mm
|
102
|
+
\setulmargins{*}{*}{1.701}% Tall Pentagon, 17.9mm | 30.52mm
|
103
|
+
\setlength{\footskip}{3\baselineskip}
|
104
|
+
\checkandfixthelayout
|
105
|
+
|
106
|
+
}{
|
107
|
+
\ifthenelse{\equal{\ANEC@pagePreset}{smallpage}}{
|
108
|
+
|
109
|
+
% Small page size
|
110
|
+
%
|
111
|
+
% 5.25in x 8in page
|
112
|
+
% P = 1.523 (~Pentagon (1.539), b/w fifth (1.5) and minor 6th (1.6))
|
113
|
+
% T = 1.618 (Golden Section, ~minor 6th (1.6))
|
114
|
+
|
115
|
+
% For 11pt / 16pt font size, 27 lines, Gentium font, no parskip, 17pt parindent.
|
116
|
+
% Small book binding swallows more space in the center, hence the 0.889 L-R margin ratio, instead of the 1.125 of the larger page size.
|
117
|
+
|
118
|
+
% === normalsize ===
|
119
|
+
|
120
|
+
\renewcommand{\normalsize}{%
|
121
|
+
\@setfontsize\normalsize{11}{16}
|
122
|
+
\abovedisplayskip 11\p@ \@plus3\p@ \@minus6\p@
|
123
|
+
\abovedisplayshortskip \z@ \@plus3\p@
|
124
|
+
\belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@
|
125
|
+
\belowdisplayskip \abovedisplayskip
|
126
|
+
\color{textbody}
|
127
|
+
\let\@listi\@listI}
|
128
|
+
\normalsize
|
129
|
+
|
130
|
+
% === indentations ===
|
131
|
+
|
132
|
+
\setlength{\vgap}{1.5em}
|
133
|
+
\setlength{\vindent}{\vgap}
|
134
|
+
\setlength{\vleftmargin}{2em}
|
135
|
+
|
136
|
+
% === setup page layout ===
|
137
|
+
|
138
|
+
\setlength{\parskip}{0pt}
|
139
|
+
\setlength{\parindent}{17pt}
|
140
|
+
|
141
|
+
\setstocksize{8in}{5.25in}
|
142
|
+
\settrimmedsize{\stockheight}{\stockwidth}{*}
|
143
|
+
\settrims{0pt}{0pt}
|
144
|
+
\settypeblocksize{27\baselineskip + \topskip}{*}{0.618}% 1/1.618 Golden section
|
145
|
+
%\setlrmargins{*}{*}{0.889}% major 2nd 15:16, gives: 19.24mm | 17.1mm
|
146
|
+
% FIXED: inner margin too close to the spine. Increased it a bit.
|
147
|
+
\setlrmargins{*}{*}{0.63}% gives: 22.30mm | 14.04mm
|
148
|
+
\setulmargins{*}{*}{1.701}% Tall Pentagon
|
149
|
+
\setlength{\footskip}{3\baselineskip}
|
150
|
+
\checkandfixthelayout
|
151
|
+
|
152
|
+
}{
|
153
|
+
|
154
|
+
% other page sizes?
|
155
|
+
|
156
|
+
}}
|
157
|
+
|
158
|
+
% alias the pagestyles into semantic names, "where it is used"
|
159
|
+
|
160
|
+
\aliaspagestyle{normalpage}{bottomcorner}
|
161
|
+
|
162
|
+
\RequirePackage{book-core-last}
|
163
|
+
|