|
1 | 1 | \NeedsTeXFormat{LaTeX2e} |
2 | | -\ProvidesClass{sbabook}[2013/03/08] |
| 2 | +\ProvidesClass{sbabook}[2020/02/28] |
3 | 3 |
|
4 | 4 | % \ExecuteOptions{a4paper,11pt,twoside} |
5 | 5 | \ProcessOptions* |
|
42 | 42 | %%% |
43 | 43 | %%% Fonts & paragraph typography |
44 | 44 | %%% |
45 | | -\RequirePackage{fontspec} |
46 | | - |
47 | | -\setmainfont[ |
48 | | - Ligatures=TeX, % supposed to replace Mapping=tex-text |
49 | | - UprightFont = {Gentium Book Basic}, |
50 | | - ItalicFont = {Gentium Book Basic Italic} |
51 | | -]{Gentium Basic} |
52 | | -\setsansfont[ |
| 45 | +\RequirePackage{fontspec,gentium,opensans,FiraMono} |
| 46 | + |
| 47 | +\setmainfont{Gentium Book Basic} |
| 48 | +\setsansfont{Open Sans}[ |
| 49 | + \@ifpackagelater{opensans}{2019/06/19}% test for font naming bug |
| 50 | + {}% 2019/06/20 fixed it |
| 51 | + {BoldFont = {* Bold},} |
53 | 52 | Scale=MatchLowercase, |
54 | | - BoldFont = {* Bold}, |
55 | | - Ligatures=TeX, |
56 | 53 | Numbers=OldStyle |
57 | | -]{Open Sans} |
58 | | -\setmonofont[ |
| 54 | +] |
| 55 | +\setmonofont{Fira Mono}[ |
59 | 56 | Scale=MatchLowercase, |
60 | 57 | HyphenChar={-} % enable hyphenation (disabled by default in mono fonts) |
61 | 58 | % caveat: LuaLaTeX doesn't support changing the actual character |
62 | 59 | % alternative solution: \usepackage[htt]{hyphenat} |
63 | | -]{Fira Mono}%{Hack} |
| 60 | +] |
64 | 61 |
|
65 | 62 | \let\codefamily\ttfamily |
66 | 63 | \newcommand\textcode[1]{\texttt{#1}} |
|
251 | 248 | \setfloatadjustment{figure}{\small\sffamily\centering} |
252 | 249 | \setfloatadjustment{table} {\small\sffamily\centering} |
253 | 250 |
|
| 251 | +\usepackage{xtab} |
| 252 | +\newenvironment{fullwidthtabular}[1]{% |
| 253 | + \begin{xtabular*}{\textwidth}{@{}#1@{}}% |
| 254 | +}{\end{xtabular*}} |
| 255 | + |
254 | 256 | %%% |
255 | 257 | %%% Graphics |
256 | 258 | %%% |
|
271 | 273 | %%% |
272 | 274 | \RequirePackage{listings} |
273 | 275 |
|
274 | | -% \renewcommand{\lstlistlistingname}{Code examples} |
| 276 | +% declare unicode points to support in listings |
| 277 | +% see https://tex.stackexchange.com/a/25396 |
| 278 | +\lst@InputCatcodes |
| 279 | +\def\lst@DefEC{% |
| 280 | + \lst@CCECUse \lst@ProcessLetter |
| 281 | + ^^80^^81^^82^^83^^84^^85^^86^^87^^88^^89^^8a^^8b^^8c^^8d^^8e^^8f% |
| 282 | + ^^90^^91^^92^^93^^94^^95^^96^^97^^98^^99^^9a^^9b^^9c^^9d^^9e^^9f% |
| 283 | + ^^a0^^a1^^a2^^a3^^a4^^a5^^a6^^a7^^a8^^a9^^aa^^ab^^ac^^ad^^ae^^af% |
| 284 | + ^^b0^^b1^^b2^^b3^^b4^^b5^^b6^^b7^^b8^^b9^^ba^^bb^^bc^^bd^^be^^bf% |
| 285 | + ^^c0^^c1^^c2^^c3^^c4^^c5^^c6^^c7^^c8^^c9^^ca^^cb^^cc^^cd^^ce^^cf% |
| 286 | + ^^d0^^d1^^d2^^d3^^d4^^d5^^d6^^d7^^d8^^d9^^da^^db^^dc^^dd^^de^^df% |
| 287 | + ^^e0^^e1^^e2^^e3^^e4^^e5^^e6^^e7^^e8^^e9^^ea^^eb^^ec^^ed^^ee^^ef% |
| 288 | + ^^f0^^f1^^f2^^f3^^f4^^f5^^f6^^f7^^f8^^f9^^fa^^fb^^fc^^fd^^fe^^ff% |
| 289 | + % |
| 290 | + ^^^^20ac% EURO SIGN |
| 291 | + % french |
| 292 | + ^^^^0152% LATIN CAPITAL LIGATURE OE |
| 293 | + ^^^^0153% LATIN SMALL LIGATURE OE |
| 294 | + ^^^^0178% LATIN CAPITAL LETTER Y WITH DIAERESIS |
| 295 | + % esperanto |
| 296 | + ^^^^0108% LATIN CAPITAL LETTER C WITH CIRCUMFLEX |
| 297 | + ^^^^0109% LATIN SMALL LETTER C WITH CIRCUMFLEX |
| 298 | + ^^^^011c% LATIN CAPITAL LETTER G WITH CIRCUMFLEX |
| 299 | + ^^^^011d% LATIN SMALL LETTER G WITH CIRCUMFLEX |
| 300 | + ^^^^0124% LATIN CAPITAL LETTER H WITH CIRCUMFLEX |
| 301 | + ^^^^0125% LATIN SMALL LETTER H WITH CIRCUMFLEX |
| 302 | + ^^^^0134% LATIN CAPITAL LETTER J WITH CIRCUMFLEX |
| 303 | + ^^^^0135% LATIN SMALL LETTER J WITH CIRCUMFLEX |
| 304 | + ^^^^015c% LATIN CAPITAL LETTER S WITH CIRCUMFLEX |
| 305 | + ^^^^015d% LATIN SMALL LETTER S WITH CIRCUMFLEX |
| 306 | + ^^^^016c% LATIN CAPITAL LETTER U WITH BREVE |
| 307 | + ^^^^016d% LATIN SMALL LETTER U WITH BREVE |
| 308 | + % serbian |
| 309 | + ^^^^0106% LATIN CAPITAL LETTER C WITH ACUTE |
| 310 | + ^^^^0107% LATIN SMALL LETTER C WITH ACUTE |
| 311 | + ^^^^010c% LATIN CAPITAL LETTER C WITH CARON |
| 312 | + ^^^^010d% LATIN SMALL LETTER C WITH CARON |
| 313 | + ^^^^0110% LATIN CAPITAL LETTER D WITH STROKE |
| 314 | + ^^^^0111% LATIN SMALL LETTER D WITH STROKE |
| 315 | + ^^^^0160% LATIN CAPITAL LETTER S WITH CARON |
| 316 | + ^^^^0161% LATIN SMALL LETTER S WITH CARON |
| 317 | + ^^^^017d% LATIN CAPITAL LETTER Z WITH CARON |
| 318 | + ^^^^017e% LATIN SMALL LETTER Z WITH CARON |
| 319 | + ^^00} |
| 320 | +\lst@RestoreCatcodes |
| 321 | + |
275 | 322 | \lstdefinestyle{sbabook}{ |
276 | 323 | inputencoding=utf8, |
| 324 | + extendedchars=true, |
277 | 325 | aboveskip=0pt, belowskip=0pt, |
278 | 326 | columns=fullflexible, |
279 | 327 | keepspaces, |
|
285 | 333 | keywordstyle={}, |
286 | 334 | stringstyle={}, |
287 | 335 | commentstyle={}, |
| 336 | + numberstyle = \tiny\ttfamily, |
| 337 | + numberblanklines = false, |
| 338 | + % numberfirstline = true, |
| 339 | + firstnumber = 1, |
| 340 | + stepnumber = 2, % number placement varies from listing to listing… |
| 341 | + numbersep = 7pt, |
288 | 342 | } |
289 | 343 | \lstset{style = sbabook} |
290 | 344 |
|
|
396 | 450 |
|
397 | 451 | %% Combine figures, tables, listings into a single list. We redirect everything |
398 | 452 | %% to the list of figures |
399 | | -\renewcommand\listfigurename{Illustrations} |
400 | 453 | \renewcommand\ext@table{lof} |
401 | 454 |
|
402 | 455 | %% Avoid ugly page breaks in contents / list of illustrations |
|
468 | 521 | %%% Language, localizations, hyphenation |
469 | 522 | %%% |
470 | 523 | \RequirePackage{polyglossia} |
471 | | - |
| 524 | +\setmainlanguage{english} |
| 525 | +\addto\captionsenglish{% |
| 526 | + \renewcommand*\listfigurename{Illustrations}} |
0 commit comments