-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcharismanie.4ht
205 lines (171 loc) · 4.83 KB
/
charismanie.4ht
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
\usepackage[utf8]{inputenc}
% All paragraphs are indented
\Css{h3 + p.noindent{
text-indent:1em;
}}
% Preface
\NewConfigure{preface}{2}
\renewenvironment{preface}{\a:preface}{\b:preface}
\Configure{preface}{\Tg<div class="preface">}{\Tg</div>}
\Css{div.preface{
font-style:italic;
}}
\Css{div.preface em{
font-style:normal;
}}
% Emphasis
\NewConfigure{emph}{2}
\renewcommand{\emph}[1]{%
\a:emph#1\b:emph
}
\Configure{emph}{\Tg<em>}{\Tg</em>}
% Reoverride what impnattypo does
\let\frenchchapter\Roman
\renewcommand{\thechapter}{%
\ifnum\value{chapter}=1
premier%
\else
\frenchchapter{chapter}%
\fi
}
% And reconfigure chapter
\ConfigureMark{chapter}
{\HCode{<span class="titlemark">}\chaptertitlename
\ \thechapter\HCode{</span><span class="chaptitlesep"> — </span><br />}}
\Css{h2{
text-align: right;
font-size: xx-large;
font-style:normal;
font-weight: normal;
font-family: "Open Sans Condensed Light",Sans-Serif;
}}
\Css{h2 > span.titlemark{
font-style: normal;
font-weight: normal;
font-size: large;
font-family: "Nothing You Could Do",Serif;
}}
% This is only for the ToC
\Css{h2 > span.chaptitlesep{
display:none;
}}
\Css{h3.sectionHead{
font-style:normal;
font-family:"Open Sans Condensed Light",Sans-Serif;
font-weight:normal;
}}
\Css{h3.sectionHead span.titlemark{
display:none;
}}
\ConfigureMark{section}{}
% page breaks
\renewcommand\pagebreak{%
\HCode{<br class="pagebreak" />}
}
% Guillemets
\renewcommand{\Og}{\HCode{« }}
\renewcommand{\Fg}{\HCode{ »}}
% French colon
\renewcommand{\frcolon}{\HCode{ :}}
% HRule
\renewcommand{\HRule}{%
\ifvmode\IgnorePar\fi\EndP\HCode{<hr class="hrule" />}\IgnoreIndent
}
\Css{hr.hrule{
background-color:black;
height:1px;
border:0;
}}
% YHWH
\renewcommand{\YHWH}{YHWH}
% Fake pdfpages
\newcommand\includepdf[1]{}
% Make links in Bible index
\newcommand{\getversesec}[1]{%
\csname versesec#1\endcsname
}
\newcommand{\linkonepage}[1]{%
\ifthenelse{\secondparam=1}{, }{}%
\hyperlink{verse.#1}{\textrm{section~\getversesec{#1}}}%
\def\secondparam{1}}
\newcommand{\linkpages}[1]{%
\def\secondparam{0}%
\forcsvlist\linkonepage{#1}}
\renewcommand*{\bvidxpgformat}{linkpages}
% Make anchors in text
\newcounter{bibleverse}
\NewConfigure{ibibleverse}{2}
\renewcommand*{\ibibleverse}[1][\bvidxpgformat]{%
\stepcounter{bibleverse}%
\a:ibibleverse\b:ibibleverse%
\expandafter\xdef\csname versesec\thebibleverse\endcsname{\thesection}%
\def\@bv@idxpgformat{#1}%
\@bv@idxtrue\def\@bv@idxentry{}\bibleverse}
\Configure{ibibleverse}{\Tg<a id="verse.\thebibleverse">}{\Tg</a>}
% Patch imakeidx to map verse num instead of page
\patchcmd{\@index}{\@wrindex}{\@Wrindex}{}{}
\let\@Wrindex\@wrindex
\patchcmd{\@Wrindex}{\thepage}{\thebibleverse}{}{}
\let\protected@iwrite\protected@write
\patchcmd{\protected@iwrite}{\write}{\immediate\write}{}{}
\patchcmd{\@Wrindex}{\protected@write}{\protected@iwrite}{}{}
% Dedication
\NewConfigure{dedicationtext}{2}
\renewcommand\dedicationtext[1]{%
\a:dedicationtext#1\b:dedicationtext
}
\Configure{dedicationtext}{\Tg<hr class="dedicationrule" />\Tg<div class="dedication">}{\Tg</div>\Tg<hr class="dedicationrule" />}
\Css{div.dedication{
text-align:center;
text-style:italic;
}}
\Css{hr.dedicationrule{
background-color:black;
height:1px;
border:0;
}}
% Index
\Css{span.index-item{
font-family:"Open Sans Condensed Light",Sans-Serif;
font-size:large;
margin-top:1em;
}}
% Global footnotes in ebooks
%\usepackage{chngcntr}
%\counterwithin{footnote}{paragraph}
\everypar{\setcounter{footnote}{0}}
\long\def\thefootnote{\fnsymbol{footnote}}
\frenchbsetup{
FrenchFootnotes=false,
AutoSpaceFootnotes=false
}
% Footnotes after paragraph
\newbox\footnotebox
\Configure{footnotemark}{%
\bgroup%
\NoFonts%
\Configure{textsuperscript}{}{}%
\HCode{<sup><a epub:type=epub:type="noteref" href="\#fn\FNnum x\minipageNum" id="fn\FNnum x\minipageNum-bk">}}%
{\HCode{</a></sup>}%
\egroup}
\Configure{footnotetext}{\global\setbox\footnotebox=\vtop\bgroup\NoFonts%
\ifvoid\footnotebox\else\unvbox\footnotebox\fi
\IgnorePar
\HCode{<div epub:type="footnote" class="footnote" id="fn\FNnum x\minipageNum"><p><a href="\#fn\FNnum x\minipageNum-bk">}}{\Tg</a>}{\HCode{</p></div>\Hnewline}\egroup}
\def\printfn{%
\ifvoid\footnotebox\else%
\HCode{<div epub:type="footnotes" class="footnotes">\Hnewline}\box\footnotebox\HCode{</div>\Hnewline}%
\fi%
}
% Add \c@footnote0\relax after <p> to number footnotes by paragraph
\Configure{HtmlPar}
{\EndP\HCode{<!--l. \the\inputlineno-->%
<p \csname a:!P\endcsname
class="no\ifHCond par\else indent\fi" \a:LRdir>}}
{\EndP\HCode{<!--l. \the\inputlineno-->%
<p \csname a:!P\endcsname
class="\ifdim \parindent=\z@ no\fi indent" \a:LRdir>}}
{\:xhtml{\Tg</p>}\printfn}
{\:xhtml{\Tg</p>}\printfn}%
\Css{.footnote{font-size:x-small;}}
\Css{.footnotes {margin:0 10\%;border-top:1px black solid;border-bottom:1px black solid;}}