|
| 1 | +# delegis |
| 2 | + |
| 3 | +<table> |
| 4 | +<tr> |
| 5 | +<td><img src="demo-1.png" alt="Page containing a logo at the top-right and a geric (example) title"></td> |
| 6 | +<td><img src="demo-2.png" alt="Page containing an outline"></td> |
| 7 | +<td><img src="demo-3.png" alt="Page containing a German-style legislative content including a preamble, division titles, sections, paragraph and sentence numbering, etc."></td> |
| 8 | +</tr> |
| 9 | +</table> |
| 10 | + |
| 11 | +A package and template for drafting legislative content in a German-style structuring, such as for bylaws, etc. |
| 12 | + |
| 13 | +While the template is designed to be used in German documents, all strings are customizable. You can have a look at the `delegis.typ` to see all available parameters. |
| 14 | + |
| 15 | +## General Usage |
| 16 | + |
| 17 | +While this `README.md` gives you a brief overview of the package's usage, we recommend that you use the template (in the `template` folder) as a starting point instead. |
| 18 | + |
| 19 | +### Importing the Package |
| 20 | + |
| 21 | +```typst |
| 22 | +#import "@preview/delegis:0.3.0": * |
| 23 | +``` |
| 24 | + |
| 25 | +### Initializing the template |
| 26 | + |
| 27 | +```typst |
| 28 | +#show: delegis.with( |
| 29 | + // Metadata |
| 30 | + title: "Vereinsordnung zu ABCDEF", // title of the law/bylaw/... |
| 31 | + abbreviation: "ABCDEFVO", // abbreviation of the law/bylaw/... (can be none) |
| 32 | + resolution: "3. Beschluss des Vorstands vom 24.01.2024", // resolution number and date |
| 33 | + in-effect: "24.01.2024", // date when it comes into effect |
| 34 | + draft: false, // whether this is a draft |
| 35 | + // Template |
| 36 | + logo: image("wuespace.jpg", alt: "WüSpace e. V."), // logo of the organization, shown on the first page |
| 37 | +) |
| 38 | +``` |
| 39 | + |
| 40 | +### Sections |
| 41 | + |
| 42 | +Sections are auto-detected as long as they follow the pattern `§ 1 ...` or `§ 1a ...` in its own paragraph: |
| 43 | + |
| 44 | +```typst |
| 45 | +§ 1 Geltungsbereich |
| 46 | +
|
| 47 | +(1) |
| 48 | +Diese Ordnung gilt für alle Mitglieder des Vereins. |
| 49 | +
|
| 50 | +(2) |
| 51 | +Sie regelt die Mitgliedschaft im Verein. |
| 52 | +
|
| 53 | +§ 2 Mitgliedschaft |
| 54 | +
|
| 55 | +(1) |
| 56 | +Die Mitgliedschaft im Verein ist freiwillig. |
| 57 | +
|
| 58 | +(2) |
| 59 | +Sie kann jederzeit gekündigt werden. |
| 60 | +
|
| 61 | +§ 2a Ehrenmitgliedschaft |
| 62 | +
|
| 63 | +(1) |
| 64 | +Die Ehrenmitgliedschaft wird durch den Vorstand verliehen. |
| 65 | +``` |
| 66 | + |
| 67 | +Alternatively (or if you want to use special characters otherwise not supported, such as `*`), you can also use the `#section[number][title]` function: |
| 68 | + |
| 69 | +```typst |
| 70 | +#section[§ 3][Administrator*innen] |
| 71 | +``` |
| 72 | + |
| 73 | +### Hierarchical Divisions |
| 74 | + |
| 75 | +If you want to add more structure to your sections, you can use normal Typst headings. Note that only the level 6 headings are reserved for the section numbers: |
| 76 | + |
| 77 | +```typst |
| 78 | += Allgemeine Bestimmungen |
| 79 | +
|
| 80 | +§ 1 ABC |
| 81 | +
|
| 82 | +§ 2 DEF |
| 83 | +
|
| 84 | += Besondere Bestimmungen |
| 85 | +
|
| 86 | +§ 3 GHI |
| 87 | +
|
| 88 | +§ 4 JKL |
| 89 | +``` |
| 90 | + |
| 91 | +Delegis will automatically use a numbering scheme for the divisions that is in line with the "Handbuch der Rechtsförmlichkeit", Rn. 379 f. If you want to customize the division titles, you can do so by setting the `division-prefixes` parameter in the `delegis` function: |
| 92 | + |
| 93 | +```typst |
| 94 | +#show: delegis.with( |
| 95 | + division-prefixes: ("Teil", "Kapitel", "Abschnitt", "Unterabschnitt") |
| 96 | +) |
| 97 | +``` |
| 98 | + |
| 99 | +### Sentence Numbering |
| 100 | + |
| 101 | +If a paragraph contains multiple sentences, you can number them by adding a `#s~` at the beginning of the sentences: |
| 102 | + |
| 103 | +```typst |
| 104 | +§ 3 Mitgliedsbeiträge |
| 105 | +
|
| 106 | +#s~Die Mitgliedsbeiträge sind monatlich zu entrichten. |
| 107 | +#s~Sie sind bis zum 5. des Folgemonats zu zahlen. |
| 108 | +``` |
| 109 | + |
| 110 | +This automatically adds corresponding sentence numbers in superscript. |
| 111 | + |
| 112 | +### Referencing other Sections |
| 113 | + |
| 114 | +Referencing works manually by specifying the section number. While automations would be feasible, we have found that in practice, they're not as useful as they might seem for legislative documents. |
| 115 | + |
| 116 | +In some cases, referencing sections using `§ X` could be mis-interpreted as a new section. To avoid this, use the non-breaking space character `~` between the `§` and the number: |
| 117 | + |
| 118 | +```typst |
| 119 | +§ 5 Inkrafttreten |
| 120 | +
|
| 121 | +Diese Ordnung tritt am 24.01.2024 in Kraft. §~4 bleibt unberührt. |
| 122 | +``` |
| 123 | + |
| 124 | +## Changelog |
| 125 | + |
| 126 | +### v0.4.0 |
| 127 | + |
| 128 | +#### Features |
| 129 | + |
| 130 | +- Improve heading levels to follow accessibility best practices (no longer skipping levels) |
| 131 | +- Make the `abbreviation` metadata field optional (can be `none` now) |
| 132 | + |
| 133 | +#### Bug Fixes |
| 134 | + |
| 135 | +- Fix sentence numbering for newer Typst versions (that require `context` for the numbering to work properly) |
| 136 | + |
| 137 | +### v0.3.0 |
| 138 | + |
| 139 | +#### Features |
| 140 | + |
| 141 | +- Adjust numbered list / enumeration numbering to be in line with "Handbuch der Rechtsförmlichkeit", Rn. 374 |
| 142 | +- Make division titles (e.g., "Part", "Chapter", "Division") customizable and conform to the "Handbuch der Rechtsförmlichkeit", Rn. 379 f. |
| 143 | + |
| 144 | +### v0.2.0 |
| 145 | + |
| 146 | +#### Features |
| 147 | + |
| 148 | +- Add `#metadata` fields for usage with `typst query`. You can now use `typst query file.typ "<field>" --field value --one` with `<field>` being one of the following to query metadata fields in the command line: |
| 149 | + - `<title>` |
| 150 | + - `<abbreviation>` |
| 151 | + - `<resolution>` |
| 152 | + - `<in-effect>` |
| 153 | +- Add `#section[§ 1][ABC]` function to enable previously unsupported special chars (such as `*`) in section headings. Note that this was previously possible using `#unnumbered[§ 1\ ABC]`, but the new function adds a semantically better-fitting alternative to this fix. |
| 154 | +- Improve heading style rules. This also fixes an incompatibility with `pandoc`, meaning it's now possible to use `pandoc` to convert delegis documents to HTML, etc. |
| 155 | +- Set the footnote numbering to `[1]` to not collide with sentence numbers. |
| 156 | + |
| 157 | +#### Bug Fixes |
| 158 | + |
| 159 | +- Fix a typo in the `str-draft` variable name that lead to draft documents resulting in a syntax error. |
| 160 | +- Fix hyphenation issues with the abbreviation on the title page (hyphenation between the parentheses and the abbreviation itself) |
| 161 | + |
| 162 | +### v0.1.0 |
| 163 | + |
| 164 | +Initial Release |
0 commit comments