|
| 1 | +# Book template |
| 2 | + |
| 3 | +[](https://github.com/maucejo/bookly/releases/tag/4.1.0) |
| 4 | +[](https://github.com/maucejo/book_template/blob/86195a989b4336f4a648c572d2a574de1d1ca6d2/LICENSE) |
| 5 | +[](https://github.com/maucejo/bookly/blob/86195a989b4336f4a648c572d2a574de1d1ca6d2/docs/manual.pdf) |
| 6 | + |
| 7 | + |
| 8 | +The `bookly` template is a Typst package designed for writing academic documents such as theses, French habilitations, or scientific books. It provides a structured format that adheres to academic standards, making it easier for authors to focus on content rather than formatting. |
| 9 | + |
| 10 | +## Basic usage |
| 11 | + |
| 12 | +This section provides the minimal amount of information to get started with the template. For more detailed information, see the [manual](https://github.com/maucejo/bookly/blob/86195a989b4336f4a648c572d2a574de1d1ca6d2/docs/manual.pdf). |
| 13 | + |
| 14 | +To use the `bookly` template, you need to include the following line at the beginning of your typ file: |
| 15 | + |
| 16 | +```typ |
| 17 | +#import "@preview/bookly:4.1.0": * |
| 18 | +``` |
| 19 | + |
| 20 | +After importing `bookly`, you have to initialize the template by a show rule with the `#bookly()` command. |
| 21 | + |
| 22 | +**Example** |
| 23 | +```typ |
| 24 | +#show: bookly.with( |
| 25 | + title: "My document", |
| 26 | + author: "Author Name", |
| 27 | + theme: modern, |
| 28 | + lang: "en", |
| 29 | + tufte: false, |
| 30 | + fonts: ( |
| 31 | + body: "Lato", |
| 32 | + math: "Lete Sans Math" |
| 33 | + ), |
| 34 | + title-page: book-title-page( |
| 35 | + series: "Typst book series", |
| 36 | + institution: "Typst community", |
| 37 | + logo: image("images/typst-logo.svg"), |
| 38 | + cover: image("images/book-cover.jpg", width: 45%) |
| 39 | + ), |
| 40 | + config-options: ( |
| 41 | + open-right: true, |
| 42 | + alt-margins: false |
| 43 | + ) |
| 44 | +) |
| 45 | +``` |
| 46 | + |
| 47 | +## Main features |
| 48 | + |
| 49 | +* Themes: `classic`, `modern`, `fancy`, `obook`, `orly`, `pretty` |
| 50 | +* Tufte layout powered by `marginalia` package |
| 51 | +* Language support: English, Chinese, French, German, Italian, Portuguese, Spanish |
| 52 | +* Font customization: Body, math and raw fonts can be customized |
| 53 | +* Environments: `front-matter`, `main-matter`, `appendix`, `back-matter` |
| 54 | +* Outlines: `tableofcontents`, `listoffigures`, `listoftables`, `minitoc` |
| 55 | +* Part and chapter definition: `part`, `chapter`, `chapter-nonum` |
| 56 | + |
| 57 | +> **_Note:_** The chapters can be also written using the Typst standard markup syntax. |
| 58 | +
|
| 59 | +## Helper functions |
| 60 | + |
| 61 | +* Subfigures - based on the `subpar` package |
| 62 | + ```typ |
| 63 | + #subfigure( |
| 64 | + figure(image("image1.png"), caption: []), |
| 65 | + figure(image("image2.png"), caption: []), <b>, |
| 66 | + columns: (1fr, 1fr), |
| 67 | + caption: [Figure title], |
| 68 | + label: <fig:subfig>, |
| 69 | + ) |
| 70 | + ``` |
| 71 | +
|
| 72 | +* Equations |
| 73 | + * Boxed equations |
| 74 | + ```typ |
| 75 | + $ |
| 76 | + #boxeq[$p(A|B) prop p(B|A) space p(A)$] |
| 77 | + $ |
| 78 | + ``` |
| 79 | +
|
| 80 | + * Unnumbered equations |
| 81 | + ```typ |
| 82 | + $ |
| 83 | + integral_0^1 f(x) dif x = F(1) - F(0) |
| 84 | + $ <nonum-eq> |
| 85 | + ``` |
| 86 | +
|
| 87 | + * Subequation numbering based on the `equate` package |
| 88 | +
|
| 89 | +* Information boxes |
| 90 | + * `#info-box` for remarks |
| 91 | + * `#tip-box` for tips |
| 92 | + * `#important-box` for important notes |
| 93 | + * `proof-box` for proofs |
| 94 | + * `question-box` for questions |
| 95 | + * `custom-box` for user defined boxes |
| 96 | +
|
| 97 | +* `book-title-page` for defining the title page of a book |
| 98 | +
|
| 99 | +* `thesis-title-page` for defining the title page of a thesis |
| 100 | +
|
| 101 | +* `back-cover` for defining the back cover of a book |
| 102 | +
|
| 103 | +## Dependencies |
| 104 | +
|
| 105 | +`bookly` relies on the following packages: |
| 106 | +
|
| 107 | +* `marginalia:0.3.1`: for tufte layout. |
| 108 | +
|
| 109 | +* `hydra:0.6.2` : for bibliography management. |
| 110 | +
|
| 111 | +* `equate:0.3.3` : for advanced equation numbering. |
| 112 | +
|
| 113 | +* `showybox:2.0.4` : for custom boxes. |
| 114 | +
|
| 115 | +* `suboutline:0.3.0` : for mini tables of contents in chapters. |
| 116 | +
|
| 117 | +* `subpar:0.2.2` : for subfigures. |
| 118 | +
|
| 119 | +## Licence |
| 120 | +
|
| 121 | +MIT licensed |
| 122 | +
|
| 123 | +Copyright © 2026 Mathieu AUCEJO (maucejo) |
| 124 | +
|
0 commit comments