| 1 |
% \iffalse meta-comment |
| 2 |
% |
| 3 |
% Copyright (c) 2026 David Purton <[email protected]> |
| 4 |
% |
| 5 |
% This work may be distributed and/or modified under the conditions of |
| 6 |
% the LaTeX Project Public License, either version 1.3c of this license |
| 7 |
% or (at your option) any later version. The latest version of this |
| 8 |
% license is in |
| 9 |
% http://www.latex-project.org/lppl.txt |
| 10 |
% and version 1.3c or later is part of all distributions of LaTeX |
| 11 |
% version 2005/12/01 or later. |
| 12 |
% |
| 13 |
%<*driver> |
| 14 |
\RequirePackage{pdfmanagement} |
| 15 |
\documentclass[a4paper]{l3doc} |
| 16 |
\usepackage[T1]{fontenc} |
| 17 |
\usepackage{microtype} |
| 18 |
\usepackage{mlmodern} |
| 19 |
\usepackage[font=small, skip=6pt]{caption} |
| 20 |
\usepackage{xcolor} |
| 21 |
\usepackage{listings} |
| 22 |
|
| 23 |
\AddToHook{env/macrocode/before}{% |
| 24 |
\addvspace{\medskipamount}} |
| 25 |
|
| 26 |
\AddToHook{env/macro/before}{% |
| 27 |
\addvspace{\medskipamount}} |
| 28 |
|
| 29 |
\begin{document} |
| 30 |
\DocInput{\jobname.dtx} |
| 31 |
\end{document} |
| 32 |
%</driver> |
| 33 |
% \fi |
| 34 |
% |
| 35 |
% \title{The \pkg{sblbook} Class} |
| 36 |
% \author{David Purton\thanks{Email: \url{[email protected]}}} |
| 37 |
% \date{2026-04-04 v1.0} |
| 38 |
% |
| 39 |
% \maketitle |
| 40 |
% |
| 41 |
% \begin{abstract} |
| 42 |
% \pkg{sblbook} provides a LaTeX class for producing articles and papers |
| 43 |
% conforming to the style required by the Society of Biblical Literature. It |
| 44 |
% depends on \pkg{sblfonts} for language support, \pkg{biblatex-sbl} for |
| 45 |
% referencing, \pkg{sblidx} for indexing and \pkg{bibleref-sbl} for |
| 46 |
% Scripture references. |
| 47 |
% \end{abstract} |
| 48 |
% |
| 49 |
% \tableofcontents |
| 50 |
% |
| 51 |
% \section{Introduction} |
| 52 |
% |
| 53 |
% The \pkg{sblbook} class creates a print ready book matching the style |
| 54 |
% specified in the \emph{Preparing Your Printer-Ready Manuscript}. See |
| 55 |
% \url{https://www.sbl-site.org/assets/pdfs/PRMmanual.pdf}. |
| 56 |
% |
| 57 |
% The class works with both |pdflatex| and the Unicode engines, but in order |
| 58 |
% to make use of the SBL fonts you need to install them and use a Unicode |
| 59 |
% engine (|lualatex| is recommended, especially for Hebrew). |
| 60 |
% |
| 61 |
% \subsection{Usage} |
| 62 |
% |
| 63 |
% Load the class using |\documentclass{sblbook}|. See |sbltex-book.tex| in |
| 64 |
% the documentation directory for an extended usage example. |
| 65 |
% |
| 66 |
% The following standard commands and environments have been customised for |
| 67 |
% this class: |
| 68 |
% \begin{itemize} |
| 69 |
% \item |\author|, |\title|, |\maketitle| |
| 70 |
% \item |\tableofcontents|, |\listoffigure|, |\listoftables| |
| 71 |
% \item |\section|, |\subsection|, |\subsubsection|, |\paragraph|, |
| 72 |
% |\subparagraph| |
| 73 |
% \item |\appendix|, |\frontmatter|, |\mainmatter|, |\backmatter| |
| 74 |
% \item |\footnote| |
| 75 |
% \item |\caption| |
| 76 |
% \item |\index| |
| 77 |
% \item |\printbibliography|, |\printbiblist{abbreviations}| |
| 78 |
% \item |abstract|, |quotation|, |quote| |
| 79 |
% \end{itemize} |
| 80 |
% |
| 81 |
% American, Greek and Hebrew are set up using \pkg{sblfonts} (and |
| 82 |
% \pkg{babel}). A different main language can be chosen by passing the |
| 83 |
% \pkg{babel} language name to the class. |
| 84 |
% |
| 85 |
% \subsection{Acknowledgements} |
| 86 |
% |
| 87 |
% The \pkg{sblbook} class depends on a number of other packages: |
| 88 |
% \begin{itemize} |
| 89 |
% \item \pkg{sblfonts} (with \pkg{fontspec}, \pkg{fontenc} and \pkg{babel}), |
| 90 |
% \pkg{biblatex-sbl} (with \pkg{biblatex}), \pkg{sblidx} (with |
| 91 |
% \pkg{imakeidx}, \pkg{idxlayout}, \pkg{bibleref-parse} and |
| 92 |
% \pkg{bibleref-sbl}) |
| 93 |
% \item \pkg{csquotes}, \pkg{geometry}, \pkg{setspace}, \pkg{ragged2e}, |
| 94 |
% \pkg{fancyhdr} |
| 95 |
% \item When \cs{DocumentMetadata} is not in use: \pkg{caption}, |
| 96 |
% \pkg{footmisc}, \pkg{titlesec}, \pkg{titletoc} |
| 97 |
% \end{itemize} |
| 98 |
% |
| 99 |
% \subsection{Bug Reports and Feature Requests} |
| 100 |
% |
| 101 |
% Bug reports and feature requests can be made at the \pkg{sbltex} |
| 102 |
% GitHub repository. See \url{https://github.com/dcpurton/sbltex}. |
| 103 |
% |
| 104 |
% \begin{description} |
| 105 |
% \item[Note:] This class is only partially compatible with the \LaTeX{} |
| 106 |
% tagging project at this stage. As the tagging project stabilises and |
| 107 |
% dependent packages are updated, compatibility will improve. |
| 108 |
% \end{description} |
| 109 |
% |
| 110 |
% \section{Package Environments} |
| 111 |
% |
| 112 |
% \begin{function}{acknowledgements} |
| 113 |
% \begin{syntax} |
| 114 |
% |\begin| \marg{acknowledgements} |
| 115 |
% |\end| \marg{acknowledgements} |
| 116 |
% \end{syntax} |
| 117 |
% Add an Acknowledgements page to the book. The name of the section can be |
| 118 |
% changed by redefining |\acknowledgementsname|. |
| 119 |
% \end{function} |
| 120 |
% |
| 121 |
% \begin{function}{copyrightpage} |
| 122 |
% \begin{syntax} |
| 123 |
% |\begin| \marg{copyrightpage} |
| 124 |
% |\end| \marg{copyrightpage} |
| 125 |
% \end{syntax} |
| 126 |
% Add a copyright page to the book. This page is supplied by SBL Press. |
| 127 |
% \end{function} |
| 128 |
% |
| 129 |
% \begin{function}{dedication} |
| 130 |
% \begin{syntax} |
| 131 |
% |\begin| \marg{dedication} |
| 132 |
% |\end| \marg{dedication} |
| 133 |
% \end{syntax} |
| 134 |
% Add a dedication to the book. This page is empty by default. If there is a |
| 135 |
% dedication, it should be placed on page v. |
| 136 |
% \end{function} |
| 137 |
% |
| 138 |
% \begin{function}{epigraph} |
| 139 |
% \begin{syntax} |
| 140 |
% |\begin| \marg{epigraph} |
| 141 |
% |\end| \marg{epigraph} |
| 142 |
% \end{syntax} |
| 143 |
% Add an epigraph to the book. This page is empty by default. If there is an |
| 144 |
% epigraph, it should be placed on page vii. |
| 145 |
% \end{function} |
| 146 |
% |
| 147 |
% \begin{function}{foreword} |
| 148 |
% \begin{syntax} |
| 149 |
% |\begin| \marg{foreword} |
| 150 |
% |\end| \marg{foreword} |
| 151 |
% \end{syntax} |
| 152 |
% Add a Foreword to the book. The name of the section can be changed by |
| 153 |
% redefining |\forewordname|. |
| 154 |
% \end{function} |
| 155 |
% |
| 156 |
% \begin{function}{introduction} |
| 157 |
% \begin{syntax} |
| 158 |
% |\begin| \marg{introduction} |
| 159 |
% |\end| \marg{introduction} |
| 160 |
% \end{syntax} |
| 161 |
% Add an Introduction to the book. The name of the section can be changed by |
| 162 |
% redefining |\introductionname|. |
| 163 |
% \end{function} |
| 164 |
% |
| 165 |
% \begin{function}{preface} |
| 166 |
% \begin{syntax} |
| 167 |
% |\begin| \marg{preface} |
| 168 |
% |\end| \marg{preface} |
| 169 |
% \end{syntax} |
| 170 |
% Add a Preface to the book. The name of the section can be changed by |
| 171 |
% redefining |\prefacename|. |
| 172 |
% \end{function} |
| 173 |
% |
| 174 |
% \begin{function}{seriespage} |
| 175 |
% \begin{syntax} |
| 176 |
% |\begin| \marg{seriespage} |
| 177 |
% |\end| \marg{seriespage} |
| 178 |
% \end{syntax} |
| 179 |
% Add a series page to the book. This page is supplied by SBL Press. |
| 180 |
% \end{function} |
| 181 |
% |
| 182 |
% \begin{function}{titlepage} |
| 183 |
% \begin{syntax} |
| 184 |
% |\begin| \marg{titlepage} |
| 185 |
% |\end| \marg{titlepage} |
| 186 |
% \end{syntax} |
| 187 |
% Add a title page to the book. This page is supplied by SBL Press. |
| 188 |
% Note that this page is distinct from the half title page which is added |
| 189 |
% with the |\maketitle| command. |
| 190 |
% \end{function} |
| 191 |
% |
| 192 |
% \section{Package Options} |
| 193 |
% |
| 194 |
% Items passed to the options below are \emph{appended} to the default options |
| 195 |
% rather than replacing them. |
| 196 |
% |
| 197 |
% Any unrecognised options passed to the \pkg{sblbook} class are passed |
| 198 |
% through to the \pkg{book} class. |
| 199 |
% |
| 200 |
% \begin{function}{biblatex} |
| 201 |
% \begin{syntax} |
| 202 |
% biblatex = \marg{arguments}\hfill Default: \{style=sbl, language=auto, autolang=hyphen\} |
| 203 |
% \end{syntax} |
| 204 |
% These options are passed to the \pkg{biblatex} package. |
| 205 |
% \end{function} |
| 206 |
% |
| 207 |
% See the \pkg{biblatex-sbl} package documentation for a full description of |
| 208 |
% supported options and usage. |
| 209 |
% |
| 210 |
% \begin{function}{sblfonts} |
| 211 |
% \begin{syntax} |
| 212 |
% sblfonts = \marg{arguments} |
| 213 |
% \end{syntax} |
| 214 |
% Options to pass to the \pkg{sblfonts} package. |
| 215 |
% \end{function} |
| 216 |
% |
| 217 |
% The defaults depend on whether the engine in use is 8bit or Unicode: |
| 218 |
% \begin{description} |
| 219 |
% \item[8bit defaults:] \mbox{}\\ |
| 220 |
% |{|\\ |
| 221 |
% \strut\quad |mainfont=Baskervaldx,|\\ |
| 222 |
% \strut\quad |grfont=Alegreya-LF,|\\ |
| 223 |
% \strut\quad |hefont=frank|\\ |
| 224 |
% |}| |
| 225 |
% \item[Unicode defaults:] \mbox{}\\ |
| 226 |
% |{|\\ |
| 227 |
% \strut\quad |mainfont=Baskervaldx,|\\ |
| 228 |
% \strut\quad |mainfontoptions={Extension=.otf, UprightFont=*-Reg,|\\ |
| 229 |
% \strut\qquad |ItalicFont=*-Ita, BoldFont=*-Bol,|\\ |
| 230 |
% \strut\qquad |BoldItalicFont=*-BolIta},|\\ |
| 231 |
% \strut\quad |sblfonts=true|\\ |
| 232 |
% |}| |
| 233 |
% \end{description} |
| 234 |
% Note that you will need to download and install the SBL fonts yourself from |
| 235 |
% \url{https://www.sbl-site.org/resources/fonts/}. |
| 236 |
% |
| 237 |
% See the \pkg{sblfonts} package documentation for a full description of |
| 238 |
% supported options and usage. |
| 239 |
% |
| 240 |
% \begin{function}{sblidx} |
| 241 |
% \begin{syntax} |
| 242 |
% sblidx = \marg{arguments}\hfill Default: \emph{Empty} |
| 243 |
% \end{syntax} |
| 244 |
% These options are passed to the \pkg{sblidx} package. |
| 245 |
% \end{function} |
| 246 |
% |
| 247 |
% Note that the \pkg{sblidx} package is only loaded if at least one of |
| 248 |
% |ancient sources|, |modern authors| or |subject| is passed to the |sblidx| |
| 249 |
% option. |
| 250 |
% |
| 251 |
% See the \pkg{sblidx} package documentation for a full description of |
| 252 |
% supported options and usage. |
| 253 |
% |
| 254 |
% \begin{function}{trim} |
| 255 |
% \begin{syntax} |
| 256 |
% trim = true \textbar\ false\hfill Default: false |
| 257 |
% \end{syntax} |
| 258 |
% Whether to trim the PDF to 6 $\times$ 9 inches or not. |
| 259 |
% \end{function} |
| 260 |
% |
| 261 |
% \section{Implementation} |
| 262 |
% |
| 263 |
% \setlength{\parindent}{0em} |
| 264 |
% |
| 265 |
% \begin{macrocode} |
| 266 |
%<*class> |
| 267 |
%<@@=sblbook> |
| 268 |
% \end{macrocode} |
| 269 |
% |
| 270 |
% \begin{macrocode} |
| 271 |
\NeedsTeXFormat{LaTeX2e} |
| 272 |
\ProvidesExplClass{sblbook}{2026-04-04}{1.0} |
| 273 |
{Society of Biblical Literature Book Class (DCP)} |
| 274 |
% \end{macrocode} |
| 275 |
% |
| 276 |
% \begin{macrocode} |
| 277 |
\clist_new:N \l_@@_options_to_book_class_clist |
| 278 |
% \end{macrocode} |
| 279 |
% |
| 280 |
% \begin{macrocode} |
| 281 |
\keys_define:nn { sblbook } |
| 282 |
{ |
| 283 |
, biblatex .clist_set:N = \l_@@_options_to_biblatex_clist |
| 284 |
, sblfonts .clist_set:N = \l_@@_options_to_sblfonts_clist |
| 285 |
, sblidx .clist_set:N = \l_@@_options_to_sblidx_clist |
| 286 |
, trim .bool_set:N = \l_@@_trim_bool |
| 287 |
, trim .default:n = true |
| 288 |
, trim .initial:n = false |
| 289 |
, unknown .code:n = { |
| 290 |
\clist_put_right:No |
| 291 |
\l_@@_options_to_book_class_clist |
| 292 |
{ \CurrentOption } |
| 293 |
} |
| 294 |
} |
| 295 |
% \end{macrocode} |
| 296 |
% |
| 297 |
% \begin{macrocode} |
| 298 |
\ProcessKeyOptions |
| 299 |
% \end{macrocode} |
| 300 |
% |
| 301 |
% Set default options. |
| 302 |
% |
| 303 |
% \begin{macrocode} |
| 304 |
\clist_put_left:Nn \l_@@_options_to_book_class_clist |
| 305 |
{ } |
| 306 |
% \end{macrocode} |
| 307 |
% |
| 308 |
% \begin{macrocode} |
| 309 |
\clist_put_left:Nn \l_@@_options_to_biblatex_clist |
| 310 |
{ |
| 311 |
, style = sbl |
| 312 |
, language = auto |
| 313 |
, autolang = hyphen |
| 314 |
} |
| 315 |
% \end{macrocode} |
| 316 |
% |
| 317 |
% \begin{macrocode} |
| 318 |
\sys_if_engine_opentype:TF |
| 319 |
{ |
| 320 |
\clist_put_left:Nn \l_@@_options_to_sblfonts_clist |
| 321 |
{ |
| 322 |
, mainfont = Baskervaldx |
| 323 |
, mainfontoptions = { |
| 324 |
, Extension = .otf |
| 325 |
, UprightFont = *-Reg |
| 326 |
, ItalicFont = *-Ita |
| 327 |
, BoldFont = *-Bol |
| 328 |
, BoldItalicFont = *-BolIta |
| 329 |
} |
| 330 |
, sblfonts = true |
| 331 |
} |
| 332 |
} |
| 333 |
{ |
| 334 |
\clist_put_left:Nn \l_@@_options_to_sblfonts_clist |
| 335 |
{ |
| 336 |
, mainfont = Baskervaldx |
| 337 |
, grfont = Alegreya-LF |
| 338 |
, hefont = frank |
| 339 |
} |
| 340 |
} |
| 341 |
% \end{macrocode} |
| 342 |
% |
| 343 |
% Load book class. |
| 344 |
% |
| 345 |
% \begin{macrocode} |
| 346 |
\exp_args:No \PassOptionsToClass |
| 347 |
{ \l_@@_options_to_book_class_clist } |
| 348 |
{ book } |
| 349 |
\LoadClass { book } |
| 350 |
% \end{macrocode} |
| 351 |
% |
| 352 |
% Font and language set up. |
| 353 |
% |
| 354 |
% \begin{macrocode} |
| 355 |
\exp_args:No \PassOptionsToPackage |
| 356 |
{ \l_@@_options_to_sblfonts_clist } |
| 357 |
{ sblfonts } |
| 358 |
\RequirePackage { sblfonts } |
| 359 |
% \end{macrocode} |
| 360 |
% |
| 361 |
% Set up upper case kerning. |
| 362 |
% |
| 363 |
% \begin{macrocode} |
| 364 |
\sys_if_engine_opentype:T |
| 365 |
{ |
| 366 |
\hook_gput_code:nnn |
| 367 |
{ cmd / MakeUppercase / before } |
| 368 |
{ sblbook } |
| 369 |
{ \addfontfeature { Kerning = Uppercase } } |
| 370 |
\hook_gput_code:nnn |
| 371 |
{ cmd / MakeUppercase / after } |
| 372 |
{ sblbook } |
| 373 |
{ \addfontfeature { Kerning = UppercaseOff } } |
| 374 |
} |
| 375 |
% \end{macrocode} |
| 376 |
% |
| 377 |
% \pkg{biblatex} set up. |
| 378 |
% |
| 379 |
% \begin{macrocode} |
| 380 |
\exp_args:No \PassOptionsToPackage |
| 381 |
{ \l_@@_options_to_biblatex_clist } |
| 382 |
{ biblatex } |
| 383 |
\RequirePackage { biblatex } |
| 384 |
\RequirePackage { csquotes } |
| 385 |
% \end{macrocode} |
| 386 |
% |
| 387 |
% \begin{macrocode} |
| 388 |
\clist_if_exist:NT \l_@@_options_to_sblidx_clist |
| 389 |
{ |
| 390 |
\exp_args:No \PassOptionsToPackage |
| 391 |
{ \l_@@_options_to_sblidx_clist } |
| 392 |
{ sblidx } |
| 393 |
\RequirePackage { sblidx } |
| 394 |
\@ifpackageloaded { bibleref } |
| 395 |
{ |
| 396 |
\RequirePackage { bibleref-parse } |
| 397 |
} |
| 398 |
{ } |
| 399 |
} |
| 400 |
% \end{macrocode} |
| 401 |
% |
| 402 |
% \subsection{Margins} |
| 403 |
% |
| 404 |
% \begin{macrocode} |
| 405 |
\bool_if:NTF \l_@@_trim_bool |
| 406 |
{ |
| 407 |
\RequirePackage |
| 408 |
[ |
| 409 |
, paperwidth = 6in |
| 410 |
, paperheight = 9in |
| 411 |
] |
| 412 |
{ geometry } |
| 413 |
} |
| 414 |
{ |
| 415 |
\RequirePackage { geometry } |
| 416 |
} |
| 417 |
\dim_new:N \l_@@_top_margin_dim |
| 418 |
\dim_new:N \l_@@_inner_margin_dim |
| 419 |
\dim_set:Nn \l_@@_top_margin_dim |
| 420 |
{ 0.5 \paperheight - 3.75in } |
| 421 |
\dim_set:Nn \l_@@_inner_margin_dim |
| 422 |
{ 0.5 \paperwidth - 2.25in } |
| 423 |
\geometry |
| 424 |
{ |
| 425 |
, includehead = true |
| 426 |
, marginparwidth = 0.5in |
| 427 |
, textwidth = 4.5in |
| 428 |
, height = 7.5in |
| 429 |
, top = \l_@@_top_margin_dim |
| 430 |
, inner = \l_@@_inner_margin_dim |
| 431 |
, headsep = 12pt |
| 432 |
, headheight = 12pt |
| 433 |
, footskip = 12pt |
| 434 |
} |
| 435 |
% \end{macrocode} |
| 436 |
% |
| 437 |
% \subsection{Text layout} |
| 438 |
% |
| 439 |
% \begin{macrocode} |
| 440 |
\dim_set:Nn \parindent { 0.25in } |
| 441 |
\RequirePackage [ all ] { nowidow } |
| 442 |
\RequirePackage [ hyphenation , lastparline ] { impnattypo } |
| 443 |
\RequirePackage { microtype } |
| 444 |
% \end{macrocode} |
| 445 |
% |
| 446 |
% \subsection{Headers and footers} |
| 447 |
% |
| 448 |
% \begin{macrocode} |
| 449 |
\RequirePackage { fancyhdr } |
| 450 |
\pagestyle { fancy } |
| 451 |
\fancyhf { } |
| 452 |
\fancyhead [ LE , RO ] { \thepage } |
| 453 |
\fancyhead [ CE ] { \itshape \nouppercase { \leftmark } } |
| 454 |
\fancyhead [ CO ] { \itshape \nouppercase { \rightmark } } |
| 455 |
\cs_set_nopar:Npn \headrulewidth { 0pt } |
| 456 |
\cs_set_nopar:Npn \chaptermark #1 |
| 457 |
{ |
| 458 |
\markboth { \@title } { #1 } |
| 459 |
} |
| 460 |
\cs_set_nopar:Npn \sectionmark #1 { } |
| 461 |
\fancypagestyle { plain } |
| 462 |
{ |
| 463 |
\fancyhf { } |
| 464 |
\fancyfoot |
| 465 |
[ C ] |
| 466 |
{ |
| 467 |
\smash { \raisebox { 12pt } { -\,\thepage\,- } } |
| 468 |
} |
| 469 |
\cs_set_nopar:Npn \headrulewidth { 0pt } |
| 470 |
\cs_set_nopar:Npn \footrulewidth { 0pt } |
| 471 |
} |
| 472 |
\cs_set_nopar:Npn \thispagestyle #1 |
| 473 |
{ |
| 474 |
\cs_if_exist:cTF { ps@#1 } |
| 475 |
{ |
| 476 |
\tl_if_eq:nnT {#1} { plain } |
| 477 |
{ |
| 478 |
\enlargethispage { -24pt } |
| 479 |
} |
| 480 |
\legacy_if_gset_true:n { @specialpage } |
| 481 |
\cs_gset_nopar:Npn \@specialstyle {#1} |
| 482 |
} |
| 483 |
{ |
| 484 |
\undefinedpagestyle |
| 485 |
} |
| 486 |
} |
| 487 |
\cs_set_nopar:Npn \cleardoublepage |
| 488 |
{ |
| 489 |
\clearpage |
| 490 |
\int_if_even:nT { \c@page } |
| 491 |
{ |
| 492 |
\hbox:n { } |
| 493 |
\thispagestyle { empty } |
| 494 |
\newpage |
| 495 |
} |
| 496 |
} |
| 497 |
|
| 498 |
|
| 499 |
|
| 500 |
% \end{macrocode} |
| 501 |
% |
| 502 |
% \subsection{Footnotes} |
| 503 |
% |
| 504 |
% Different handling is required for footnotes when tagging code is loaded. |
| 505 |
% |
| 506 |
% \begin{macrocode} |
| 507 |
\IfDocumentMetadataTF |
| 508 |
{ |
| 509 |
\socket_new_plug:nnn { fntext / mark } { sblbook } |
| 510 |
{ |
| 511 |
\skip_horizontal:N \footnotemargin |
| 512 |
\@thefnmark . \enspace |
| 513 |
} |
| 514 |
\socket_assign_plug:nn { fntext / mark } { sblbook } |
| 515 |
\socket_assign_plug:nn |
| 516 |
{ build / column / outputbox } |
| 517 |
{ floats-space-footnotes } |
| 518 |
} |
| 519 |
{ |
| 520 |
|
| 521 |
\RequirePackage [ bottom ] { footmisc } |
| 522 |
\cs_set:Npn \@makefntext #1 |
| 523 |
{ |
| 524 |
\dim_set_eq:NN \parindent \footnotemargin |
| 525 |
\@thefnmark . \enspace |
| 526 |
\footnotelayout #1 |
| 527 |
} |
| 528 |
} |
| 529 |
% \end{macrocode} |
| 530 |
% |
| 531 |
% \begin{macrocode} |
| 532 |
\dim_set:Nn \footnotemargin { 0.25in } |
| 533 |
\cs_set:Npn \footnoterule |
| 534 |
{ |
| 535 |
\kern -3pt |
| 536 |
\hrule width 1.5in height .5pt depth 0pt |
| 537 |
\kern 0.0625in |
| 538 |
} |
| 539 |
% \end{macrocode} |
| 540 |
% |
| 541 |
% \subsection{Captions} |
| 542 |
% |
| 543 |
% \begin{macrocode} |
| 544 |
\skip_set:Nn \abovecaptionskip { 6pt } |
| 545 |
\skip_set:Nn \belowcaptionskip { 6pt } |
| 546 |
\cs_set:Npn \thefigure |
| 547 |
{ |
| 548 |
\arabic { figure } |
| 549 |
} |
| 550 |
\cs_set:Npn \thetable |
| 551 |
{ |
| 552 |
\arabic { table } |
| 553 |
} |
| 554 |
\counterwithout { figure } { chapter } |
| 555 |
\counterwithout { table } { chapter } |
| 556 |
% \end{macrocode} |
| 557 |
% |
| 558 |
% \begin{macrocode} |
| 559 |
\IfDocumentMetadataTF |
| 560 |
{ |
| 561 |
\NewSocketPlug { caption / label } { sblbook } |
| 562 |
{ |
| 563 |
\small |
| 564 |
#1:~ |
| 565 |
} |
| 566 |
\AssignSocketPlug { caption / label } { sblbook } |
| 567 |
} |
| 568 |
{ |
| 569 |
\RequirePackage [ font = small , skip = 6pt ] { caption } |
| 570 |
} |
| 571 |
% \end{macrocode} |
| 572 |
% |
| 573 |
% \subsection{Block quotes} |
| 574 |
% |
| 575 |
% \begin{macrocode} |
| 576 |
\IfDocumentMetadataTF |
| 577 |
{ |
| 578 |
\hook_gput_code:nnn { begindocument / before } { sblbook } |
| 579 |
{ |
| 580 |
\RenewDocumentEnvironment { quotation } { !O { } } |
| 581 |
{ |
| 582 |
\UseInstance { blockenv } { quotation } |
| 583 |
{ |
| 584 |
, begin-extra-vspace = 0pt |
| 585 |
, begin-vspace = 11pt plus 5pt minus 3pt |
| 586 |
, left-margin = \parindent |
| 587 |
, right-margin = \parindent |
| 588 |
, para-indent = \parindent |
| 589 |
, para-vspace = 0pt |
| 590 |
, final-code = \small \ignorespaces |
| 591 |
, #1 |
| 592 |
} |
| 593 |
} |
| 594 |
{ \endblockenv } |
| 595 |
\RenewDocumentEnvironment { quote } { !O { } } |
| 596 |
{ |
| 597 |
\UseInstance { blockenv } { quote } |
| 598 |
{ |
| 599 |
, begin-extra-vspace = 0pt |
| 600 |
, begin-vspace = 11pt plus 5pt minus 3pt |
| 601 |
, left-margin = \parindent |
| 602 |
, right-margin = \parindent |
| 603 |
, para-indent = 0pt |
| 604 |
, para-vspace = 6pt plus 2pt minus 1pt |
| 605 |
, final-code = \small \ignorespaces |
| 606 |
, #1 |
| 607 |
} |
| 608 |
} |
| 609 |
{ \endblockenv } |
| 610 |
} |
| 611 |
} |
| 612 |
{ |
| 613 |
\renewenvironment { quotation } |
| 614 |
{ |
| 615 |
\small |
| 616 |
\list { } |
| 617 |
{ |
| 618 |
\dim_set_eq:NN \leftmargin \parindent |
| 619 |
\dim_set_eq:NN \rightmargin \leftmargin |
| 620 |
\skip_set:Nn \topsep { 11pt plus 5pt minus 3pt } |
| 621 |
\skip_zero:N \partopsep |
| 622 |
\skip_zero:N \itemsep |
| 623 |
\skip_zero:N \parsep |
| 624 |
\dim_set_eq:NN \itemindent \parindent |
| 625 |
\dim_set_eq:NN \listparindent \parindent |
| 626 |
} |
| 627 |
\item \ignorespaces |
| 628 |
} |
| 629 |
{ |
| 630 |
\endlist |
| 631 |
} |
| 632 |
% \end{macrocode} |
| 633 |
% |
| 634 |
% \begin{macrocode} |
| 635 |
\renewenvironment { quote } |
| 636 |
{ |
| 637 |
\small |
| 638 |
\list { } |
| 639 |
{ |
| 640 |
\dim_set_eq:NN \leftmargin \parindent |
| 641 |
\dim_set_eq:NN \rightmargin \leftmargin |
| 642 |
\skip_set:Nn \topsep { 11pt plus 5pt minus 3pt } |
| 643 |
\skip_zero:N \partopsep |
| 644 |
\skip_zero:N \itemsep |
| 645 |
\skip_set:Nn \parsep { 6pt plus 2pt minus 1pt } |
| 646 |
\dim_zero:N \itemindent |
| 647 |
\dim_zero:N \listparindent |
| 648 |
} |
| 649 |
\item \ignorespaces |
| 650 |
} |
| 651 |
{ |
| 652 |
\endlist |
| 653 |
} |
| 654 |
} |
| 655 |
% \end{macrocode} |
| 656 |
% |
| 657 |
% \subsection{Title page} |
| 658 |
% |
| 659 |
% Some pages are supplied by SBL Press and this command notes this at the |
| 660 |
% bottom of the page. |
| 661 |
% |
| 662 |
% \begin{macrocode} |
| 663 |
\cs_new_protected:Nn \@@_supplied_page: |
| 664 |
{ |
| 665 |
\group_begin: |
| 666 |
\vfill |
| 667 |
\normalfont |
| 668 |
\footnotesize |
| 669 |
\centering |
| 670 |
This ~ page ~ is ~ supplied ~ by ~ SBL ~ Press |
| 671 |
\para_end: |
| 672 |
\group_end: |
| 673 |
} |
| 674 |
% \end{macrocode} |
| 675 |
% |
| 676 |
% \begin{macrocode} |
| 677 |
\tl_new:N \g_@@_subtitle_tl |
| 678 |
\cs_set:Npn \subtitle #1 |
| 679 |
{ |
| 680 |
\tl_gset:Nn \g_@@_subtitle_tl {#1} |
| 681 |
} |
| 682 |
\tl_new:N \g_@@_series_tl |
| 683 |
\cs_set:Npn \series #1 |
| 684 |
{ |
| 685 |
\tl_gset:Nn \g_@@_series_tl {#1} |
| 686 |
} |
| 687 |
\title { [Title ~ of ~ Book] } |
| 688 |
\subtitle { [Subtitle ~ of ~ Book] } |
| 689 |
\author { [Your ~ Name] } |
| 690 |
\series { [Series ~ Name] } |
| 691 |
% \end{macrocode} |
| 692 |
% |
| 693 |
% \begin{macrocode} |
| 694 |
\cs_set_protected:Npn \maketitle |
| 695 |
{ |
| 696 |
\group_begin: |
| 697 |
\thispagestyle { empty } |
| 698 |
\centering |
| 699 |
\vspace* { 0.5in } |
| 700 |
\LARGE |
| 701 |
\MakeUppercase { \@title } |
| 702 |
\para_end: |
| 703 |
\tl_if_empty:NF \g_@@_subtitle_tl |
| 704 |
{ |
| 705 |
\vspace { 0.5in } |
| 706 |
\Large |
| 707 |
\g_@@_subtitle_tl |
| 708 |
\para_end: |
| 709 |
} |
| 710 |
\@@_supplied_page: |
| 711 |
\group_end: |
| 712 |
} |
| 713 |
% \end{macrocode} |
| 714 |
% |
| 715 |
% \begin{macrocode} |
| 716 |
\RenewDocumentEnvironment { titlepage } { } |
| 717 |
{ |
| 718 |
\clearpage |
| 719 |
\thispagestyle { empty } |
| 720 |
\centering |
| 721 |
\vspace* { 0.5in } |
| 722 |
\LARGE |
| 723 |
\MakeUppercase { \@title } |
| 724 |
\para_end: |
| 725 |
\tl_if_empty:NF \g_@@_subtitle_tl |
| 726 |
{ |
| 727 |
\vspace { 0.5in } |
| 728 |
\Large |
| 729 |
\g_@@_subtitle_tl |
| 730 |
\para_end: |
| 731 |
} |
| 732 |
\vspace { 0.5in } |
| 733 |
\large |
| 734 |
By |
| 735 |
\para_end: |
| 736 |
\@author |
| 737 |
\para_end: |
| 738 |
\normalsize |
| 739 |
} |
| 740 |
{ \@@_supplied_page: } |
| 741 |
% \end{macrocode} |
| 742 |
% |
| 743 |
% \subsection{Front matter environments} |
| 744 |
% |
| 745 |
% \begin{macrocode} |
| 746 |
\NewDocumentEnvironment { copyrightpage } { } |
| 747 |
{ |
| 748 |
\clearpage |
| 749 |
\thispagestyle { empty } |
| 750 |
\vspace* { 0.5in } |
| 751 |
\noindent |
| 752 |
Copyright ~ © ~ \number \year \space by ~ \@author |
| 753 |
} |
| 754 |
{ \@@_supplied_page: } |
| 755 |
% \end{macrocode} |
| 756 |
% |
| 757 |
% \begin{macrocode} |
| 758 |
\NewDocumentEnvironment { seriespage } { } |
| 759 |
{ |
| 760 |
\clearpage |
| 761 |
\thispagestyle { empty } |
| 762 |
\centering |
| 763 |
\vspace* { 0.5in } |
| 764 |
\LARGE |
| 765 |
\MakeUppercase { \g_@@_series_tl } |
| 766 |
\para_end: |
| 767 |
\normalsize |
| 768 |
} |
| 769 |
{ \@@_supplied_page: } |
| 770 |
% \end{macrocode} |
| 771 |
% |
| 772 |
% \begin{macrocode} |
| 773 |
\NewDocumentEnvironment { dedication } { } |
| 774 |
{ |
| 775 |
\cleardoublepage |
| 776 |
\int_compare:nNnT { \c@page } < { 5 } |
| 777 |
{ |
| 778 |
\int_gset:Nn \c@page { 5 } |
| 779 |
} |
| 780 |
\thispagestyle { empty } |
| 781 |
\centering |
| 782 |
\vspace* { 1.5in } |
| 783 |
\itshape |
| 784 |
} |
| 785 |
{ \para_end: } |
| 786 |
% \end{macrocode} |
| 787 |
% |
| 788 |
% \begin{macrocode} |
| 789 |
\NewDocumentEnvironment { epigraph } { } |
| 790 |
{ |
| 791 |
\cleardoublepage |
| 792 |
\int_compare:nNnT { \c@page } < { 5 } |
| 793 |
{ |
| 794 |
\int_gset:Nn \c@page { 5 } |
| 795 |
} |
| 796 |
\thispagestyle { empty } |
| 797 |
\vspace* { 0.5in } |
| 798 |
} |
| 799 |
{ \para_end: } |
| 800 |
% \end{macrocode} |
| 801 |
% |
| 802 |
% \begin{macrocode} |
| 803 |
\cs_new_nopar:Npn \acknowledgementsname { Acknowledgements } |
| 804 |
\NewDocumentEnvironment { acknowledgements } { } |
| 805 |
{ |
| 806 |
\chapter* { \acknowledgementsname } |
| 807 |
\chaptermark { \acknowledgementsname } |
| 808 |
\addcontentsline { toc } { chapter } { \acknowledgementsname } |
| 809 |
} |
| 810 |
{ \para_end: } |
| 811 |
% \end{macrocode} |
| 812 |
% |
| 813 |
% \begin{macrocode} |
| 814 |
\cs_new_nopar:Npn \forewordname { Foreword } |
| 815 |
\NewDocumentEnvironment { foreword } { } |
| 816 |
{ |
| 817 |
\chapter* { \forewordname } |
| 818 |
\chaptermark { \forewordname } |
| 819 |
\addcontentsline { toc } { chapter } { \forewordname } |
| 820 |
} |
| 821 |
{ \para_end: } |
| 822 |
% \end{macrocode} |
| 823 |
% |
| 824 |
% \begin{macrocode} |
| 825 |
\cs_new_nopar:Npn \introductionname { Introduction } |
| 826 |
\NewDocumentEnvironment { introduction } { } |
| 827 |
{ |
| 828 |
\chapter* { \introductionname } |
| 829 |
\chaptermark { \introductionname } |
| 830 |
\addcontentsline { toc } { chapter } { \introductionname } |
| 831 |
} |
| 832 |
{ \para_end: } |
| 833 |
% \end{macrocode} |
| 834 |
% |
| 835 |
% \begin{macrocode} |
| 836 |
\cs_new_nopar:Npn \prefacename { Preface } |
| 837 |
\NewDocumentEnvironment { preface } { } |
| 838 |
{ |
| 839 |
\chapter* { \prefacename } |
| 840 |
\chaptermark { \prefacename } |
| 841 |
\addcontentsline { toc } { chapter } { \prefacename } |
| 842 |
} |
| 843 |
{ \para_end: } |
| 844 |
% \end{macrocode} |
| 845 |
% |
| 846 |
% \subsection{Section titles} |
| 847 |
% |
| 848 |
% For documents using \cs{DocumentMetadata} use standard kernel commands to |
| 849 |
% redefine section headings, otherwise use the \pkg{titlesec} package. |
| 850 |
% |
| 851 |
% \begin{macrocode} |
| 852 |
\setcounter { secnumdepth } { 0 } |
| 853 |
\cs_set_nopar:Npn \thepart { \arabic { part } } |
| 854 |
% \end{macrocode} |
| 855 |
% |
| 856 |
% \begin{macrocode} |
| 857 |
\IfDocumentMetadataTF |
| 858 |
{ |
| 859 |
\cs_set:Npn \section |
| 860 |
{ |
| 861 |
\hook_gput_next_code:nn { para / end } |
| 862 |
{ |
| 863 |
\strut |
| 864 |
\dim_zero:N \hangindent |
| 865 |
} |
| 866 |
\@startsection { section } { 1 } { 0pt } |
| 867 |
{ -12pt plus -4pt minus -2pt } { 10pt plus 4pt minus 2pt } |
| 868 |
{ \normalfont \normalsize \centering \MakeUppercase } |
| 869 |
} |
| 870 |
\cs_set:Npn \subsection |
| 871 |
{ |
| 872 |
\hook_gput_next_code:nn { para / end } { \strut } |
| 873 |
\@startsection { subsection } { 2 } { 0pt } |
| 874 |
{ -6pt plus -2pt minus -1pt } { 4pt plus 2pt minus 1pt } |
| 875 |
{ \normalfont \normalsize \scshape \raggedright } |
| 876 |
} |
| 877 |
\cs_set:Npn \subsubsection |
| 878 |
{ |
| 879 |
\@startsection { subsubsection } { 3 } { 0pt } |
| 880 |
{ 6pt plus 2pt minus 1pt } { -1em } |
| 881 |
{ \normalfont \normalsize \scshape } |
| 882 |
} |
| 883 |
\cs_set:Npn \paragraph |
| 884 |
{ |
| 885 |
\@startsection { paragraph } { 4 } { 0pt } |
| 886 |
{ 6pt plus 2pt minus 1pt } { -1em } |
| 887 |
{ \normalfont \normalsize \itshape } |
| 888 |
} |
| 889 |
\cs_set:Npn \subparagraph |
| 890 |
{ |
| 891 |
\@startsection { subparagraph } { 5 } { 0.25in } |
| 892 |
{ 0pt } { -1em } |
| 893 |
{ \normalfont \normalsize \scshape } |
| 894 |
} |
| 895 |
} |
| 896 |
{ |
| 897 |
\RequirePackage [ newparttoc ] { titlesec } |
| 898 |
% \end{macrocode} |
| 899 |
% |
| 900 |
% \begin{macrocode} |
| 901 |
\titleclass { \part } { page } |
| 902 |
\assignpagestyle { \part } { empty } |
| 903 |
% \end{macrocode} |
| 904 |
% |
| 905 |
% \begin{macrocode} |
| 906 |
\titlespacing* { \part } { 0pt } { 0.5in } |
| 907 |
{ 0.5in plus 12pt minus 6pt } |
| 908 |
\titlespacing* { \chapter } { 0pt } { 0.5in } |
| 909 |
{ 0.5in plus 12pt minus 6pt } |
| 910 |
\titlespacing* { \section } { 0pt } { 12pt plus 4pt minus 2pt } |
| 911 |
{ 10pt plus 4pt minus 2pt } |
| 912 |
\titlespacing* { \subsection } { 0pt } { 6pt plus 2pt minus 1pt } |
| 913 |
{ 4pt plus 2pt minus 1pt } |
| 914 |
\titlespacing* {\subsubsection } { 0pt } { 6pt plus 2pt minus 1pt } |
| 915 |
{ 1em } |
| 916 |
\titlespacing* { \paragraph } { 0pt } { 6pt plus 2pt minus 1pt } |
| 917 |
{ 1em } |
| 918 |
\titlespacing* { \subparagraph } { 0.25in } { 0pt } { 1em } |
| 919 |
% \end{macrocode} |
| 920 |
% |
| 921 |
% \begin{macrocode} |
| 922 |
\titleformat |
| 923 |
{ \part } |
| 924 |
[ block ] |
| 925 |
{ \normalfont \Large \scshape \filcenter } |
| 926 |
{ \partname \space \thepart : } |
| 927 |
{ 0.5em } |
| 928 |
{ } |
| 929 |
\titleformat |
| 930 |
{ \chapter } |
| 931 |
[ display ] |
| 932 |
{ \normalfont \Large \filcenter } |
| 933 |
{ \thechapter } |
| 934 |
{ 12pt } |
| 935 |
{ } |
| 936 |
\titleformat |
| 937 |
{ \section } |
| 938 |
[ block ] |
| 939 |
{ \normalfont \normalsize \filcenter } |
| 940 |
{ \thesection } |
| 941 |
{ .5em } |
| 942 |
{ \MakeUppercase } |
| 943 |
\titleformat |
| 944 |
{ \subsection } |
| 945 |
[ block ] |
| 946 |
{ \normalfont \normalsize \scshape \filright } |
| 947 |
{ \thesubsection } |
| 948 |
{ .5em } |
| 949 |
{ } |
| 950 |
\titleformat |
| 951 |
{ \subsubsection } |
| 952 |
[ runin ] |
| 953 |
{ \normalfont \normalsize \scshape } |
| 954 |
{ \thesubsubsection } |
| 955 |
{ .5em } |
| 956 |
{ } |
| 957 |
\titleformat |
| 958 |
{ \paragraph } |
| 959 |
[ runin ] |
| 960 |
{ \normalfont \normalsize \itshape } |
| 961 |
{ \theparagraph } |
| 962 |
{ .5em } |
| 963 |
{ } |
| 964 |
\titleformat |
| 965 |
{ \subparagraph } |
| 966 |
[ runin ] |
| 967 |
{ \normalfont \normalsize \scshape } |
| 968 |
{ \thesubparagraph } |
| 969 |
{ .5em } |
| 970 |
{ } |
| 971 |
} |
| 972 |
% \end{macrocode} |
| 973 |
% |
| 974 |
% \subsection{Table of contents and list of figures/tables} |
| 975 |
% |
| 976 |
% \begin{macrocode} |
| 977 |
\int_set:Nn \c@tocdepth { 1 } |
| 978 |
% \end{macrocode} |
| 979 |
% |
| 980 |
% \begin{macrocode} |
| 981 |
\cs_set:Npn \tableofcontents |
| 982 |
{ |
| 983 |
\chapter* { \contentsname } |
| 984 |
\@mkboth |
| 985 |
{ \contentsname } |
| 986 |
{ \contentsname } |
| 987 |
\int_compare:nNnT { \c@page } < { 5 } |
| 988 |
{ \int_gset:Nn \c@page { 5 } } |
| 989 |
\@starttoc { toc } |
| 990 |
} |
| 991 |
% \end{macrocode} |
| 992 |
% |
| 993 |
% \begin{macrocode} |
| 994 |
\cs_set:Npn \listoffigures |
| 995 |
{ |
| 996 |
\chapter* { \listfigurename } |
| 997 |
\addcontentsline { toc } { chapter } { \listfigurename } |
| 998 |
\@mkboth |
| 999 |
{ \listfigurename } |
| 1000 |
{ \listfigurename } |
| 1001 |
\@starttoc { lof } |
| 1002 |
} |
| 1003 |
% \end{macrocode} |
| 1004 |
% |
| 1005 |
% \begin{macrocode} |
| 1006 |
\cs_set:Npn \listoftables |
| 1007 |
{ |
| 1008 |
\chapter* { \listtablename } |
| 1009 |
\addcontentsline { toc } { chapter } { \listtablename } |
| 1010 |
\@mkboth |
| 1011 |
{ \listtablename } |
| 1012 |
{ \listtablename } |
| 1013 |
\@starttoc { lot } |
| 1014 |
} |
| 1015 |
% \end{macrocode} |
| 1016 |
% |
| 1017 |
% For documents using \cs{DocumentMetadata} use standard kernel commands to |
| 1018 |
% redefine table of contents lines, otherwise use the \pkg{titletoc} package. |
| 1019 |
% |
| 1020 |
% \begin{macrocode} |
| 1021 |
\IfDocumentMetadataTF |
| 1022 |
{ |
| 1023 |
\cs_set:Npn \@pnumwidth { 2em } |
| 1024 |
\hook_gput_code_with_args:nnn { contentsline / text / after } |
| 1025 |
{ sblbook } |
| 1026 |
{ |
| 1027 |
\int_compare:nNnT {#1} = { 1 } |
| 1028 |
{ |
| 1029 |
\cs_set_nopar:Npn \leaders ##1 ##2 { } |
| 1030 |
\hook_gput_next_code:nn { cmd / SuspendTagging / after } |
| 1031 |
{ |
| 1032 |
\cs_set_nopar:Npn \leaders ##1 ##2 { } |
| 1033 |
} |
| 1034 |
} |
| 1035 |
} |
| 1036 |
\cs_set_nopar:Npn \numberline #1 |
| 1037 |
{ |
| 1038 |
\hbox_to_wd:nn { \@tempdima } |
| 1039 |
{ |
| 1040 |
\hook_use:nnw { contentsline / number / before } { 1 } {#1} |
| 1041 |
\hfill #1. \enspace |
| 1042 |
\hook_use:nnw { contentsline / number / after } { 1 } {#1} |
| 1043 |
} |
| 1044 |
} |
| 1045 |
% \end{macrocode} |
| 1046 |
% |
| 1047 |
% \begin{macrocode} |
| 1048 |
\cs_set_nopar:Npn \l@chapter |
| 1049 |
{ |
| 1050 |
\@dottedtocline { 0 } { 0em } { 2em } |
| 1051 |
} |
| 1052 |
\cs_set_nopar:Npn \l@section |
| 1053 |
{ |
| 1054 |
\@dottedtocline { 1 } { 2em } { 2.5em } |
| 1055 |
} |
| 1056 |
\cs_set_nopar:Npn \l@subsection |
| 1057 |
{ |
| 1058 |
\@dottedtocline { 2 } { 4.5em } { 3em } |
| 1059 |
} |
| 1060 |
\cs_set_nopar:Npn \l@subsubsection |
| 1061 |
{ |
| 1062 |
\@dottedtocline { 3 } { 7.5em } { 3em } |
| 1063 |
} |
| 1064 |
\cs_set_nopar:Npn \l@paragraph |
| 1065 |
{ |
| 1066 |
\@dottedtocline { 4 } { 10.5em } { 3em } |
| 1067 |
} |
| 1068 |
\cs_set_nopar:Npn \l@subparagraph |
| 1069 |
{ |
| 1070 |
\@dottedtocline { 5 } { 13.5em } { 0em } |
| 1071 |
} |
| 1072 |
\cs_set_nopar:Npn \l@figure |
| 1073 |
{ |
| 1074 |
\@dottedtocline { 0 } { 0em } { 2em } |
| 1075 |
} |
| 1076 |
\cs_set_eq:NN \l@table \l@figure |
| 1077 |
% \end{macrocode} |
| 1078 |
% |
| 1079 |
% Redefine \cs{@chapter}, \cs{@schapter}, \cs{@part} and \cs{@spart} to format |
| 1080 |
% chapter and part headings. |
| 1081 |
% |
| 1082 |
% \begin{macrocode} |
| 1083 |
\cs_set_nopar:Npn \@chapter [#1]#2 |
| 1084 |
{ |
| 1085 |
\@@_if_page_numbering:nT { roman } |
| 1086 |
{ \pagenumbering { arabic } } |
| 1087 |
\mode_leave_vertical: |
| 1088 |
\par |
| 1089 |
\addvspace { 0.5in } |
| 1090 |
\int_compare:nNnTF { \c@secnumdepth } > { -1 } |
| 1091 |
{ |
| 1092 |
\addtocontents { toc } { \addvspace { \bigskipamount } } |
| 1093 |
\refstepcounter { chapter } |
| 1094 |
\addcontentsline { toc } { chapter } |
| 1095 |
{ |
| 1096 |
\protect \numberline { \thechapter } #1 |
| 1097 |
} |
| 1098 |
} |
| 1099 |
{ |
| 1100 |
\addcontentsline { toc } { chapter } {#1} |
| 1101 |
} |
| 1102 |
\group_begin: |
| 1103 |
\dim_zero:N \parindent |
| 1104 |
\centering |
| 1105 |
\interlinepenalty 10000 |
| 1106 |
\normalfont |
| 1107 |
\Large |
| 1108 |
\int_compare:nNnT { \c@secnumdepth } > { -1 } |
| 1109 |
{ |
| 1110 |
\thechapter |
| 1111 |
\par |
| 1112 |
\nobreak |
| 1113 |
\skip_vertical:n { \bigskipamount } |
| 1114 |
} |
| 1115 |
#2 |
| 1116 |
\strut |
| 1117 |
\chaptermark {#1} |
| 1118 |
\par |
| 1119 |
\group_end: |
| 1120 |
\nobreak |
| 1121 |
\skip_vertical:n { 0.5in plus 12pt minus 6pt } |
| 1122 |
\@afterheading |
| 1123 |
} |
| 1124 |
% \end{macrocode} |
| 1125 |
% |
| 1126 |
% \begin{macrocode} |
| 1127 |
\cs_set_nopar:Npn \@schapter #1 |
| 1128 |
{ |
| 1129 |
\mode_leave_vertical: |
| 1130 |
\par |
| 1131 |
\addvspace { 0.5in } |
| 1132 |
\group_begin: |
| 1133 |
\dim_zero:N \parindent |
| 1134 |
\centering |
| 1135 |
\interlinepenalty 10000 |
| 1136 |
\normalfont |
| 1137 |
\Large |
| 1138 |
#1 |
| 1139 |
\strut |
| 1140 |
\par |
| 1141 |
\group_end: |
| 1142 |
\nobreak |
| 1143 |
\skip_vertical:n { 0.5in plus 12pt minus 6pt } |
| 1144 |
\@afterheading |
| 1145 |
} |
| 1146 |
% \end{macrocode} |
| 1147 |
% |
| 1148 |
% \begin{macrocode} |
| 1149 |
\cs_set:Npn \@part [#1]#2 |
| 1150 |
{ |
| 1151 |
\unskip |
| 1152 |
\skip_vertical:n { 0.5in } |
| 1153 |
\thispagestyle { empty } |
| 1154 |
\int_compare:nNnTF { \c@secnumdepth } > { -2 } |
| 1155 |
{ |
| 1156 |
\addtocontents { toc } { \addvspace { \bigskipamount } } |
| 1157 |
\refstepcounter { part } |
| 1158 |
\addcontentsline { toc } { part } |
| 1159 |
{ |
| 1160 |
\partname \space \thepart : \hspace { 0.5em } #1 |
| 1161 |
} |
| 1162 |
} |
| 1163 |
{ |
| 1164 |
\addcontentsline { toc } { part } {#1} |
| 1165 |
} |
| 1166 |
\markboth { } { } |
| 1167 |
\group_begin: |
| 1168 |
\centering |
| 1169 |
\interlinepenalty 10000 |
| 1170 |
\normalfont |
| 1171 |
\Large |
| 1172 |
\scshape |
| 1173 |
\int_compare:nNnT { \c@secnumdepth } > { -2 } |
| 1174 |
{ \partname \nobreakspace \thepart : \enspace } |
| 1175 |
#2 |
| 1176 |
\strut |
| 1177 |
\par |
| 1178 |
\group_end: |
| 1179 |
\@endpart |
| 1180 |
} |
| 1181 |
% \end{macrocode} |
| 1182 |
% |
| 1183 |
% \begin{macrocode} |
| 1184 |
\cs_set:Npn \@spart #1 |
| 1185 |
{ |
| 1186 |
\unskip |
| 1187 |
\skip_vertical:n { 0.5in } |
| 1188 |
\thispagestyle { empty } |
| 1189 |
\group_begin: |
| 1190 |
\centering |
| 1191 |
\interlinepenalty 10000 |
| 1192 |
\normalfont |
| 1193 |
\Large |
| 1194 |
\scshape |
| 1195 |
#1 |
| 1196 |
\strut |
| 1197 |
\par |
| 1198 |
\group_end: |
| 1199 |
\@endpart |
| 1200 |
} |
| 1201 |
} |
| 1202 |
{ |
| 1203 |
\RequirePackage { titletoc } |
| 1204 |
\contentsmargin { 2em } |
| 1205 |
% \end{macrocode} |
| 1206 |
% |
| 1207 |
% \begin{macro}{\@@_hyperlink:nn} \marg{link} \marg{text} |
| 1208 |
% |
| 1209 |
% \medskip |
| 1210 |
% |
| 1211 |
% A convenience version of |\hyperlink| that just uses \meta{text} if |
| 1212 |
% \pkg{hyperref} isn't loaded. |
| 1213 |
% |
| 1214 |
% \begin{macrocode} |
| 1215 |
\cs_new_protected:Nn \@@_hyperlink:nn |
| 1216 |
{ |
| 1217 |
\cs_if_exist_use:NTF \hyperlink |
| 1218 |
{ { #1 } { #2 } } |
| 1219 |
{ #2 } |
| 1220 |
} |
| 1221 |
% \end{macrocode} |
| 1222 |
% \end{macro} |
| 1223 |
% |
| 1224 |
% \begin{macro}{\@@_contents_label_box:nn} \marg{width} \marg{alignment} |
| 1225 |
% |
| 1226 |
% \medskip |
| 1227 |
% |
| 1228 |
% Create a boxed contents label with a hyperlink if \pkg{hyperref} is |
| 1229 |
% loaded. |
| 1230 |
% |
| 1231 |
% \begin{macrocode} |
| 1232 |
\cs_new_protected:Nn \@@_contents_label_box:nn |
| 1233 |
{ |
| 1234 |
\@@_hyperlink:nn |
| 1235 |
{ \Hy@tocdestname } |
| 1236 |
{ |
| 1237 |
\makebox [ #1 ] [ #2 ] { \thecontentslabel . \enspace } |
| 1238 |
} |
| 1239 |
} |
| 1240 |
% \end{macrocode} |
| 1241 |
% \end{macro} |
| 1242 |
% |
| 1243 |
% \begin{macro}{\@@_contents_label:} |
| 1244 |
% |
| 1245 |
% \medskip |
| 1246 |
% |
| 1247 |
% Create an unboxed contents label with a hyperlink if \pkg{hyperref} is |
| 1248 |
% loaded. |
| 1249 |
% |
| 1250 |
% \begin{macrocode} |
| 1251 |
\cs_new_protected:Nn \@@_contents_label: |
| 1252 |
{ |
| 1253 |
\@@_hyperlink:nn |
| 1254 |
{ \Hy@tocdestname } |
| 1255 |
{ \thecontentslabel . \enspace } |
| 1256 |
} |
| 1257 |
% \end{macrocode} |
| 1258 |
% \end{macro} |
| 1259 |
% |
| 1260 |
% \begin{macro}{\@@_contents_above:n} \marg{dimen} |
| 1261 |
% |
| 1262 |
% \medskip |
| 1263 |
% |
| 1264 |
% Convenience macro for code before contents line. \meta{dimen} is a |
| 1265 |
% horizontal offset the line. |
| 1266 |
% |
| 1267 |
% \begin{macrocode} |
| 1268 |
\cs_new_protected:Nn \@@_contents_above:n |
| 1269 |
{ |
| 1270 |
\hspace* { -#1 } |
| 1271 |
\filright |
| 1272 |
} |
| 1273 |
% \end{macrocode} |
| 1274 |
% \end{macro} |
| 1275 |
% |
| 1276 |
% \begin{macrocode} |
| 1277 |
\titlecontents { figure } |
| 1278 |
[ 2em ] |
| 1279 |
{ |
| 1280 |
\@@_contents_above:n { 2em } |
| 1281 |
} |
| 1282 |
{ |
| 1283 |
\@@_contents_label_box:nn { 2em } { r } |
| 1284 |
} |
| 1285 |
{ } |
| 1286 |
{ \hspace { 0.5em } \titlerule* [ 0.5pc ] { . } \contentspage } |
| 1287 |
\titlecontents { table } |
| 1288 |
[ 2em ] |
| 1289 |
{ |
| 1290 |
\@@_contents_above:n { 2em } |
| 1291 |
} |
| 1292 |
{ |
| 1293 |
\@@_contents_label_box:nn { 2em } { r } |
| 1294 |
} |
| 1295 |
{ } |
| 1296 |
{ \hspace { 0.5em } \titlerule* [ 0.5pc ] { . } \contentspage } |
| 1297 |
\titlecontents { part } |
| 1298 |
[ 2em ] |
| 1299 |
{ |
| 1300 |
\addvspace { \bigskipamount } |
| 1301 |
\scshape \filcenter |
| 1302 |
} |
| 1303 |
{ |
| 1304 |
\@@_hyperlink:nn |
| 1305 |
{ \Hy@tocdestname } |
| 1306 |
{ |
| 1307 |
\partname \space \thecontentslabel : \hspace { 0.5em } |
| 1308 |
} |
| 1309 |
} |
| 1310 |
{ } |
| 1311 |
{ } |
| 1312 |
\titlecontents { chapter } |
| 1313 |
[ 2em ] |
| 1314 |
{ |
| 1315 |
\tl_if_empty:NF \thecontentslabel |
| 1316 |
{ |
| 1317 |
\addvspace { \bigskipamount } |
| 1318 |
} |
| 1319 |
\@@_contents_above:n { 2em } |
| 1320 |
} |
| 1321 |
{ |
| 1322 |
\@@_contents_label_box:nn { 2em } { r } |
| 1323 |
} |
| 1324 |
{ } |
| 1325 |
{ \hspace { 0.5em } \titlerule* [ 0.5pc ] { . } \contentspage } |
| 1326 |
\titlecontents { section } |
| 1327 |
[ 4.5em ] |
| 1328 |
{ |
| 1329 |
\@@_contents_above:n { 2.5em } |
| 1330 |
} |
| 1331 |
{ |
| 1332 |
\@@_contents_label_box:nn { 2.5em } { r } |
| 1333 |
} |
| 1334 |
{ } |
| 1335 |
{ \hfill \contentspage } |
| 1336 |
\titlecontents { subsection } |
| 1337 |
[ 7.5em ] |
| 1338 |
{ |
| 1339 |
\@@_contents_above:n { 3em } |
| 1340 |
} |
| 1341 |
{ |
| 1342 |
\@@_contents_label: |
| 1343 |
} |
| 1344 |
{ } |
| 1345 |
{ \hfill \contentspage } |
| 1346 |
\titlecontents { subsubsection } |
| 1347 |
[ 10.5em ] |
| 1348 |
{ |
| 1349 |
\@@_contents_above:n { 3em } |
| 1350 |
} |
| 1351 |
{ |
| 1352 |
\@@_contents_label: |
| 1353 |
} |
| 1354 |
{ } |
| 1355 |
{ \hfill \contentspage } |
| 1356 |
\titlecontents { paragraph } |
| 1357 |
[ 13.5em ] |
| 1358 |
{ |
| 1359 |
\@@_contents_above:n { 3em } |
| 1360 |
} |
| 1361 |
{ |
| 1362 |
\@@_contents_label: |
| 1363 |
} |
| 1364 |
{ } |
| 1365 |
{ \hfill \contentspage } |
| 1366 |
\titlecontents { subparagraph } |
| 1367 |
[ 16.5em ] |
| 1368 |
{ |
| 1369 |
\@@_contents_above:n { 3em } |
| 1370 |
} |
| 1371 |
{ |
| 1372 |
\@@_contents_label: |
| 1373 |
} |
| 1374 |
{ } |
| 1375 |
{ \hfill \contentspage } |
| 1376 |
} |
| 1377 |
% \end{macrocode} |
| 1378 |
% |
| 1379 |
% Insert a space in the table of contents at the backmatter. |
| 1380 |
% |
| 1381 |
% \begin{macrocode} |
| 1382 |
\hook_gput_code:nnn |
| 1383 |
{ cmd / backmatter / after } |
| 1384 |
{ sblbook } |
| 1385 |
{ |
| 1386 |
\bool_if:NF \g_@@_appendix_bool |
| 1387 |
{ |
| 1388 |
\addtocontents { toc } { \addvspace { \bigskipamount } } |
| 1389 |
} |
| 1390 |
} |
| 1391 |
% \end{macrocode} |
| 1392 |
% |
| 1393 |
% \subsection{Appendices} |
| 1394 |
% |
| 1395 |
% Set up appendix headings and table of contents. |
| 1396 |
% |
| 1397 |
% \begin{macrocode} |
| 1398 |
\cs_set_eq:NN \sblbook@hyperlink \@@_hyperlink:nn |
| 1399 |
\bool_new:N \g_@@_appendix_bool |
| 1400 |
\newcounter { sblbook@appendix@count } |
| 1401 |
% \end{macrocode} |
| 1402 |
% |
| 1403 |
% \begin{macrocode} |
| 1404 |
\cs_new_protected:Nn \@@_set_up_appendices: |
| 1405 |
{ |
| 1406 |
\bool_gset_true:N \g_@@_appendix_bool |
| 1407 |
\cs_gset_nopar:Npn \thechapter |
| 1408 |
{ \@arabic \c@chapter } |
| 1409 |
\cs_set_nopar:Npn \chaptername |
| 1410 |
{ \appendixname } |
| 1411 |
\addtocontents { toc } { \def \protect \chaptername { \appendixname } } |
| 1412 |
\addtocontents { toc } { \addvspace { \bigskipamount } } |
| 1413 |
\int_compare:nNnT { \c@sblbook@appendix@count } = { \c_one_int } |
| 1414 |
{ |
| 1415 |
\int_zero:N \c@sblbook@appendix@count |
| 1416 |
} |
| 1417 |
\IfDocumentMetadataTF |
| 1418 |
{ |
| 1419 |
\cs_set_nopar:Npn \@chapter [##1]##2 |
| 1420 |
{ |
| 1421 |
\stepcounter { sblbook@appendix@count } |
| 1422 |
\mode_leave_vertical: |
| 1423 |
\par |
| 1424 |
\addvspace { 0.5in } |
| 1425 |
\int_compare:nNnTF { \c@secnumdepth } > { -1 } |
| 1426 |
{ |
| 1427 |
\refstepcounter { chapter } |
| 1428 |
\protected@write \@auxout |
| 1429 |
{ } |
| 1430 |
{ |
| 1431 |
\string \setcounter |
| 1432 |
{ sblbook@appendix@count } { \the \c@chapter } |
| 1433 |
} |
| 1434 |
\addcontentsline { toc } { chapter } |
| 1435 |
{ |
| 1436 |
\chaptername |
| 1437 |
\ifnum \c@sblbook@appendix@count > 1 |
| 1438 |
\space \thechapter |
| 1439 |
\fi |
| 1440 |
: \enspace ##1 |
| 1441 |
} |
| 1442 |
} |
| 1443 |
{ |
| 1444 |
\addcontentsline { toc } { chapter } {##1} |
| 1445 |
} |
| 1446 |
\group_begin: |
| 1447 |
\dim_zero:N \parindent |
| 1448 |
\centering |
| 1449 |
\interlinepenalty 10000 |
| 1450 |
\normalfont |
| 1451 |
\Large |
| 1452 |
\int_compare:nNnT { \c@secnumdepth } > { -1 } |
| 1453 |
{ |
| 1454 |
\chaptername |
| 1455 |
\int_compare:nNnT |
| 1456 |
{ \c@sblbook@appendix@count } > { \c_one_int } |
| 1457 |
{ |
| 1458 |
\nobreakspace \thechapter |
| 1459 |
} |
| 1460 |
\par |
| 1461 |
\nobreak |
| 1462 |
\skip_vertical:n { \bigskipamount } |
| 1463 |
} |
| 1464 |
##2 |
| 1465 |
\chaptermark {##1} |
| 1466 |
\par |
| 1467 |
\group_end: |
| 1468 |
\nobreak |
| 1469 |
\skip_vertical:n { 0.5in plus 12pt minus 6pt } |
| 1470 |
\@afterheading |
| 1471 |
} |
| 1472 |
} |
| 1473 |
{ |
| 1474 |
\titleformat |
| 1475 |
{ \chapter } |
| 1476 |
[ display ] |
| 1477 |
{ |
| 1478 |
\stepcounter { sblbook@appendix@count } |
| 1479 |
\protected@write \@auxout |
| 1480 |
{ } |
| 1481 |
{ |
| 1482 |
\protect \setcounter |
| 1483 |
{ sblbook@appendix@count } { \the \c@chapter } |
| 1484 |
} |
| 1485 |
\normalfont \Large \filcenter |
| 1486 |
} |
| 1487 |
{ |
| 1488 |
\chaptername |
| 1489 |
\ifnum \c@sblbook@appendix@count > 1 |
| 1490 |
\strut \space \thechapter |
| 1491 |
\fi |
| 1492 |
} |
| 1493 |
{ 12pt } |
| 1494 |
{ } |
| 1495 |
\titlecontents { chapter } |
| 1496 |
[ 2em ] |
| 1497 |
{ |
| 1498 |
\hspace* { -2em } |
| 1499 |
\filright |
| 1500 |
} |
| 1501 |
{ |
| 1502 |
\sblbook@hyperlink |
| 1503 |
{ \Hy@tocdestname } |
| 1504 |
{ |
| 1505 |
\chaptername |
| 1506 |
\ifnum \c@sblbook@appendix@count > 1 |
| 1507 |
\strut \space \thecontentslabel |
| 1508 |
\fi |
| 1509 |
: \enspace |
| 1510 |
} |
| 1511 |
} |
| 1512 |
{ } |
| 1513 |
{ \hspace { 0.5em } \titlerule* [ 0.5pc ] { . } \contentspage } |
| 1514 |
} |
| 1515 |
} |
| 1516 |
% \end{macrocode} |
| 1517 |
% |
| 1518 |
% \begin{macrocode} |
| 1519 |
\hook_gput_code:nnn |
| 1520 |
{ cmd / appendix / after } |
| 1521 |
{ sblbook } |
| 1522 |
{ \@@_set_up_appendices: } |
| 1523 |
% \end{macrocode} |
| 1524 |
% |
| 1525 |
% \subsection{Bibliography and list of abbreviations} |
| 1526 |
% |
| 1527 |
% \begin{macrocode} |
| 1528 |
\cs_set_nopar:Npn \bibfont { \small } |
| 1529 |
\dim_set:Nn \bibhang { 0.25in } |
| 1530 |
\dim_set:Nn \biblabelsep { 0.25in } |
| 1531 |
% \end{macrocode} |
| 1532 |
% |
| 1533 |
% \subsection{Helper functions} |
| 1534 |
% |
| 1535 |
% \begin{macro}{\@@_if_page_numbering:nT} \marg{numbering style} |
| 1536 |
% \marg{code if true} |
| 1537 |
% |
| 1538 |
% \medskip |
| 1539 |
% |
| 1540 |
% Test if the current page numbering style matches a particular style. |
| 1541 |
% (e.g., |arabic| or |roman|). |
| 1542 |
% |
| 1543 |
% \begin{macrocode} |
| 1544 |
\prg_new_conditional:Npnn \@@_if_page_numbering:n #1 { T } |
| 1545 |
{ |
| 1546 |
\cs_set_nopar:Nn \@@_thepage_test: |
| 1547 |
{ \csname @ #1 \endcsname \c@page } |
| 1548 |
\if_meaning:w \thepage \@@_thepage_test: |
| 1549 |
\prg_return_true: |
| 1550 |
\else: |
| 1551 |
\prg_return_false: |
| 1552 |
\fi: |
| 1553 |
} |
| 1554 |
% \end{macrocode} |
| 1555 |
% \end{macro} |
| 1556 |
% |
| 1557 |
% \begin{macrocode} |
| 1558 |
\endinput |
| 1559 |
% \end{macrocode} |
| 1560 |
% |
| 1561 |
% \begin{macrocode} |
| 1562 |
%</class> |
| 1563 |
% \end{macrocode} |