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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
|
%%
%% This is file `yb-book.cls',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% yb-book.dtx (with options: `class')
%% (The MIT License)
%%
%% Copyright (c) 2021-2023 Yegor Bugayenko
%%
%% Permission is hereby granted, free of charge, to any person obtaining a copy
%% of this software and associated documentation files (the 'Software'), to deal
%% in the Software without restriction, including without limitation the rights
%% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
%% copies of the Software, and to permit persons to whom the Software is
%% furnished to do so, subject to the following conditions:
%%
%% The above copyright notice and this permission notice shall be included in all
%% copies or substantial portions of the Software.
%%
%% THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
%% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
%% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
%% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
%% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
%% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
%% SOFTWARE.
%%% \CheckSum{0}
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{yb-book}
[22.05.20230 0.3.0 YB Branded Book Style]
\RequirePackage{pgfopts}
\pgfkeys{
/yb/.cd,
draft/.store in=\yb@draft,
compact/.store in=\yb@compact,
manuscript/.store in=\yb@manuscript,
}
\ProcessPgfPackageOptions{/yb}
\makeatletter\ifdefined\yb@draft
\PassOptionsToClass{11pt}{book}
\PassOptionsToClass{oneside}{book}
\else
\ifdefined\yb@manuscript
\PassOptionsToClass{12pt}{book}
\PassOptionsToClass{oneside}{book}
\else
\PassOptionsToClass{11pt}{book}
\PassOptionsToClass{twoside}{book}
\fi
\fi\makeatother
\LoadClass{book}
\RequirePackage{geometry}
\geometry{paperwidth=6in, paperheight=9in, bindingoffset=0.25in,
left=0.75in, right=0.75in, top=0.75in, bottom=1.25in}
\makeatletter\ifdefined\yb@draft
\geometry{a4paper, margin=1in, left=1.5in}
\else
\ifdefined\yb@manuscript
\geometry{a4paper, margin=1.2in}
\fi
\fi\makeatother
\RequirePackage[T1]{fontenc}
\RequirePackage[utf8]{inputenc}
\RequirePackage{lmodern}
\RequirePackage{anyfontsize}
\RequirePackage{tikz}
\usetikzlibrary{positioning}
\usetikzlibrary{shapes}
\usetikzlibrary{fit}
\RequirePackage{chngcntr}
\counterwithout{footnote}{chapter}
\RequirePackage{lastpage}
\RequirePackage{paralist}
\RequirePackage{xcolor}
\RequirePackage{graphicx}
\RequirePackage[inline]{enumitem}
\setlist{nosep}
\RequirePackage{float}
\RequirePackage[normalem]{ulem}
\RequirePackage{xfp}
\RequirePackage{soul}
\RequirePackage{xifthen}
\RequirePackage[autostyle=try]{csquotes}
\pagestyle{plain}
\RequirePackage{setspace}
\setstretch{1.2}
\makeatletter\ifdefined\yb@draft\setstretch{1.1}\fi\makeatother
\makeatletter\ifdefined\yb@compact\setstretch{1.0}\fi\makeatother
\makeatletter\ifdefined\yb@manuscript\setstretch{1.1}\fi\makeatother
\RequirePackage[indexing=cite,style=authoryear,
natbib=true,maxnames=1,minnames=1,doi=false,
url=false,isbn=false,isbn=false]{biblatex}
\DeclareCiteCommand{\citetitle}
{\boolfalse{citetracker}%
\boolfalse{pagetracker}%
\usebibmacro{prenote}}
{\ifciteindex
{\indexnames{labelname}}
{}%
\printfield[citetitle]{labeltitle}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareCiteCommand*{\citetitle}
{\boolfalse{citetracker}%
\boolfalse{pagetracker}%
\usebibmacro{prenote}}
{\ifciteindex
{\indexnames{labelname}}
{}%
\printfield[citetitle]{title}}
{\multicitedelim}
{\usebibmacro{postnote}}
\newenvironment{condensed}
{\begingroup\setstretch{1.0}\lsstyle}
{\endgroup}
\makeatletter\ifdefined\yb@draft\else
\RequirePackage[letterspace=-50]{microtype}
\fi\makeatother
\makeatletter\ifdefined\yb@manuscript
\RequirePackage[tt=false,type1=true]{libertine}
\fi\makeatother
\makeatletter
\let\yb@oldsection\section
\ifdefined\yb@draft
\RequirePackage[medium]{titlesec}
\else
\RequirePackage[raggedright]{titlesec}
\titlespacing{\section}{0in}{6pt}{6pt}[1in]
\renewcommand\section{\newpage\yb@oldsection}
\fi
\ifdefined\yb@compact
\renewcommand\section{\vspace{2em}\yb@oldsection}
\fi
\makeatother
\makeatletter\ifdefined\yb@draft
\RequirePackage[absolute]{textpos}
\TPGrid{16}{16}
\RequirePackage{fancyhdr}
\pagestyle{fancy}
\renewcommand\headrulewidth{0pt}
\renewcommand\footrulewidth{0pt}
\setlength{\headheight}{16pt}
\fancyhf{}
\fancyhead[L,C,LO,CO]{}
\fancyhead[R,RO]{
\begin{textblock}{4}(11.5,1)
\tikz \node [color=gray, rotate=270,
font=\ttfamily\scriptsize, text width=5in] at (0,0) {
Copyright \textcopyright{} \the\year{} by \theauthor{}.
All rights reserved. No part of the contents of
this book may be reproduced or transmitted in any
form or by any means without the written permission
of the publisher. This particular manuscript is
printed for \textbf{\thereviewer{}} and may be used only
for one-time review. The manuscript has to be destroyed
after the review.
};
\end{textblock}
}
\fancyfoot[C,CO,CE]{\small\ttfamily
page \#\thepage{} of \pageref{LastPage}}
\fi\makeatother
\renewcommand\maketitle{
{\LARGE\textbf{\thetitle}}
\\[1em]
by \theauthor{}
\\[4em]
\ifx\thevolume\empty\else%
Volume \thevolume{}\\
\fi
\ifx\thedate\empty\else%
Rendered on \thedate{}
\fi
\ifx\theversion\empty\else%
\\
Ver. \theversion{}
\fi
}
\makeatletter\newcommand\ybPrintTitlePage{
\ifdefined\yb@draft\else
\begin{titlepage}
\ttfamily
\vspace*{\fill}
\noindent
{\Huge\textbf{\thetitle}}
\\[1em]
by \theauthor{}
\\[4em]
\ifx\thevolume\empty\else%
Volume \thevolume{}\\
\fi
\ifx\thedate\empty\else%
\thedate{}
\fi
\ifx\thedate\empty\else%
\\
\theversion{}
\fi
\vspace*{\fill}
\end{titlepage}
\fi
}\makeatother
\makeatletter\newcommand\ybPrintTOC{
\ifdefined\yb@draft\else
\ifdefined\yb@compact\else\cleardoublepage\fi
{\setstretch{0.7}\tableofcontents}
\fi
}\makeatother
\RequirePackage{imakeidx}
\renewbibmacro*{citeindex}{\indexnames{labelname}{}}
\makeindex
\indexsetup{othercode={\hyphenpenalty=10000}}
\makeatletter\newcommand\ybPrintIndex[1][Index]{
\ifdefined\yb@draft\else
\cleardoublepage
{
\setstretch{1.0}
\small
\addcontentsline{toc}{chapter}{#1}
\printindex
}
\fi
}\makeatother
\RequirePackage{wrapfig}
\RequirePackage{mdframed}
\RequirePackage{changepage}
\strictpagecheck
\mdfdefinestyle{quoteodd}{backgroundcolor=black!0,
leftmargin=6pt,rightmargin=0pt,
innerleftmargin=6pt,innerrightmargin=0pt,
innertopmargin=0pt,innerbottommargin=0pt,
skipabove=0pt,skipbelow=0pt,
linewidth=2pt,
topline=false,bottomline=false,rightline=false}
\mdfdefinestyle{quoteeven}{backgroundcolor=black!0,
rightmargin=6pt,leftmargin=0pt,
innerrightmargin=6pt,innerleftmargin=0pt,
innertopmargin=0pt,innerbottommargin=0pt,
skipabove=0pt,skipbelow=0pt,
linewidth=2pt,
topline=false,bottomline=false,leftline=false}
\makeatletter\newcommand\ybQuote[3]{%
\ifthenelse{\isempty{#3}}{}{
\ifx\hfuzz#2\hfuzz%
\index{#3}%
\else%
\index{#3, #2}%
\fi%
}%
\def\yb@body{%
\raggedright%
\ifx\hfuzz#3\hfuzz%
#1%
\else%
``#1''\\\raggedleft---#2 #3%
\fi%
}
\ifdefined\yb@draft%
\begin{wrapfigure}{r}{0.4\textwidth}%
\begin{mdframed}[style=quoteodd]%
\yb@body%
\end{mdframed}%
\end{wrapfigure}%
\else%
\begin{wrapfigure}{o}[12pt]{0.4\textwidth}%
\sffamily\checkoddpage%
\ifoddpage%
\begin{mdframed}[style=quoteodd]\yb@body\end{mdframed}%
\else%
\begin{mdframed}[style=quoteeven]\yb@body\end{mdframed}%
\fi%
\vspace{-12pt}
\end{wrapfigure}%
\fi%
}\makeatother
\RequirePackage{perpage}
\RequirePackage[bottom,perpage,multiple]{footmisc}
\makeatletter
\let\yb@oldfootnote\footnote
\newcommand\yb@nexttoken\relax
\newcommand\yb@isfootnote{%
\ifx\footnote\yb@nexttoken\textsuperscript{,}\fi}
\renewcommand\footnote[1]{%
\yb@oldfootnote{#1}\futurelet\yb@nexttoken\yb@isfootnote}
\makeatother
\makeatletter\newcommand\ybPrintBibliography{%
\AtNextBibliography{\small}%
\raggedright%
\ifdefined\yb@manuscript%
\setlength\bibitemsep{0pt}%
\newpage%
\begin{multicols}{2}
{\setstretch{1.0}\printbibliography}
\end{multicols}
\else
\printbibliography
\fi
}\makeatother
\AtBeginDocument{%
\raggedbottom%
\setlength\topskip{0mm}%
\setlength\parindent{0pt}%
\setlength\fboxsep{0pt}%
\setlength\parskip{6pt}%
\interfootnotelinepenalty=10000%
}
\newcommand*\thetitle{\textbackslash{}thetitle}
\newcommand*\thevolume{}
\newcommand*\thedate{}
\newcommand*\theversion{\textbackslash{}theversion}
\newcommand*\theauthor{\textbackslash{}theauthor}
\newcommand*\thereviewer{\textbackslash{}thereviewer}
\endinput
%%
%% End of file `yb-book.cls'.
|