You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9f2064c
Browse filesBrowse the repository at this point in the historyBrowse files
_Configurable margin-notes with smart positioning and matching wide blocks for Typst_
2
+
3
+
_Configurable margin-notes with smart positioning and matching wide blocks for
4
+
Typst_
3
5
4
6
> [!NOTE]
5
-
> This is the readme file for the project repository and contains more development-oriented info.
6
-
>
7
+
> This is the readme file for the project repository and contains more
8
+
> development-oriented info.
9
+
>
7
10
> [A more friendly readme for the published package can be found on Typst Universe.](https://typst.app/universe/package/marginalia).
8
11
9
12
## Docs
@@ -14,38 +17,49 @@ _Configurable margin-notes with smart positioning and matching wide blocks for T
14
17
15
18
[](https://github.com/nleanba/typst-marginalia/blob/main/Marginalia.pdf)
16
19
17
-
18
20
## Development
19
21
20
-
- Remember to `typst watch main.typ Marginalia.pdf` and `typst watch main.typ preview.svg --pages 1` while development to make these stay current.
22
+
- Remember to `typst watch main.typ Marginalia.pdf` and
23
+
`typst watch main.typ preview.svg --pages 1` while development to make these
24
+
stay current.
21
25
22
26
### Tests
23
27
24
28
Use `tt run` to check for test regressions.
25
29
26
-
The tests don’t necessarily represent _ideal_ behavior. If the behavior improves, they should be updated.
27
-
Use `tt update <name>` to update the reference of a test, and `tt new <name>` to create a new test.
30
+
The tests don’t necessarily represent _ideal_ behavior. If the behavior
31
+
improves, they should be updated. Use `tt update <name>` to update the reference
32
+
of a test, and `tt new <name>` to create a new test.
28
33
29
34
> [!IMPORTANT]
30
-
> Note that the tests need to have a modified `numbering` style as the GitHub CI runner does not have Inter.
35
+
> Note that the tests need to have a modified `numbering` style as the GitHub CI
36
+
> runner does not have Inter.
31
37
32
38
### New Versions
33
39
34
-
1. Replace all occurrences of the old version number with the new one, except where it refers to specific changes made in that version.
35
-
- Also replace placeholder `?.?.?` with the new number.
40
+
1. Replace all occurrences of the old version number with the new one, except
41
+
where it refers to specific changes made in that version.
42
+
43
+
- Also replace placeholder `?.?.?` with the new number.
44
+
36
45
2. Commit and create a tagged release.
37
46
3. “Sync Fork” in https://github.com/nleanba/typst-packages
38
47
4. In `nleanba/typst-packages`, Pull and create new branch from main
39
-
5. Create folder `packages/preview/marginalia/<VERSION>` and copy `LICENSE`, `README.md`, `lib.typ`, and `typst.toml`
48
+
5. Create folder `packages/preview/marginalia/<VERSION>` and copy `LICENSE`,
49
+
`README.md`, `lib.typ`, and `typst.toml`
40
50
6. Commit and create a pull-request to `typst/packages`.
41
51
7.`main.typ`: reset `#let VERSION = "?.?.?"`.
42
52
43
53
### Contributing
44
54
45
-
This is a personal project of mine.
46
-
I welcome bug reports and feature requests, but I don’t consider this a community project and have no real interest in reviewing pull-requests etc.
55
+
This is a personal project of mine. I welcome bug reports and feature requests,
56
+
but I don’t consider this a community project and have no real interest in
57
+
reviewing pull-requests etc.
47
58
48
59
## Feedback
49
-
Have you encountered a bug? [Please report it as an issue.](https://github.com/nleanba/typst-marginalia/issues)
50
60
51
-
Has this package been useful to you? [I am always happy when someone gives me a ~~sticker~~ star⭐](https://github.com/nleanba/typst-marginalia)
61
+
Have you encountered a bug?
62
+
[Please report it as an issue.](https://github.com/nleanba/typst-marginalia/issues)
63
+
64
+
Has this package been useful to you?
65
+
[I am always happy when someone gives me a ~~sticker~~ star⭐](https://github.com/nleanba/typst-marginalia)
Copy file name to clipboardExpand all lines: README.md
+97-34Lines changed: 97 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,11 +21,12 @@ If `book` is `false`, `inner` and `outer` correspond to the left and right
21
21
margins respectively. If book is true, the margins swap sides on even and odd
22
22
pages. Notes are placed in the outside margin by default.
23
23
24
-
Where you can then customize these options to your preferences.
25
-
Shown here (as comments) are the default values taken if the corresponding keys are unset.
24
+
Where you can then customize these options to your preferences. Shown here (as
25
+
comments) are the default values taken if the corresponding keys are unset.
26
26
[Please refer to the PDF documentation for more details on the configuration and the provided commands.](https://github.com/nleanba/typst-marginalia/blob/v0.3.0/Marginalia.pdf?raw=true)
27
27
28
-
Additionally, I recommend using Typst's partial function application feature to customize other aspects of the notes consistently:
28
+
Additionally, I recommend using Typst's partial function application feature to
29
+
customize other aspects of the notes consistently:
29
30
30
31
```typ
31
32
#let note = note.with(/* options here */)
@@ -36,24 +37,27 @@ Additionally, I recommend using Typst's partial function application feature to
36
37
37
38
Provided via the `#note[...]` command.
38
39
39
-
*New in version 0.3.0:* Notes can be labeled and referenced:
40
-
If you write `#note[]<xyz>`, then `@xyz` just works!
40
+
_New in version 0.3.0:_ Notes can be labeled and referenced: If you write
41
+
`#note[]<xyz>`, then `@xyz` just works!
41
42
42
-
-`#note(side: "inner")[...]` to put it on the inside margin (left margin for single-sided documents).
43
+
-`#note(side: "inner")[...]` to put it on the inside margin (left margin for
44
+
single-sided documents).
43
45
44
46
Also accepts: `auto`=`"outer"`, `"left"`, `"right"`.
45
47
46
48
-`#note(counter: none)[...]` to remove the marker.
47
49
48
-
The display of the marker can be customized with the `numbering`, `anchor-numbering`, and `flush-numbering` parameters. Refer to the docs for details.
50
+
The display of the marker can be customized with the `numbering`,
51
+
`anchor-numbering`, and `flush-numbering` parameters. Refer to the docs for
52
+
details.
49
53
50
54
-`#note(shift: false)[...]` to force exact position of the note.
51
55
52
-
Also accepts `auto` (behavior depends on whether it has a marker), `true`, `"avoid"` and `"ignore"`.
56
+
Also accepts `auto` (behavior depends on whether it has a marker), `true`,
57
+
`"avoid"` and `"ignore"`.
53
58
54
59
- And more options for fine control. All details are in the docs.
55
60
56
-
57
61
## Wide Blocks
58
62
59
63
Provided via the `#wideblock[...]` command.
@@ -62,33 +66,40 @@ Provided via the `#wideblock[...]` command.
62
66
63
67
Also accepts: `auto`=`"outer"`, `"left"`, `"right"`, or `"both"`.
64
68
65
-
Note: Wideblocks do not handle pagebreaks well, especially in `book: true` documents. This is a limitation of Typst which does not (yet) provide a robust way of detecting and reacting to page breaks.
69
+
Note: Wideblocks do not handle pagebreaks well, especially in `book: true`
70
+
documents. This is a limitation of Typst which does not (yet) provide a robust
71
+
way of detecting and reacting to page breaks.
66
72
67
73
## Figures
68
74
69
-
You can use figures as normal, also within wideblocks.
70
-
To get captions on the side, use
75
+
You can use figures as normal, also within wideblocks. To get captions on the
For small figures, the package also provides a `notefigure` command which places the figure in the margin.
100
+
For small figures, the package also provides a `notefigure` command which places
101
+
the figure in the margin.
102
+
92
103
```typ
93
104
#notefigure(
94
105
rect(width: 100%),
@@ -98,24 +109,76 @@ For small figures, the package also provides a `notefigure` command which places
98
109
99
110
It takes all the same options as `#note[]`, with some additions. In particular,
100
111
101
-
- You can use `#notefigure(note-label: <xyz>, ..)` to label the underlying note (if you want to reference it like a note)
112
+
- You can use `#notefigure(note-label: <xyz>, ..)` to label the underlying note
113
+
(if you want to reference it like a note)
102
114
103
-
-`#notefigure(show-caption: .., ..)` is how you change the caption rendering. NB.: this function is expected to take two arguments, please consult the docs.
115
+
-`#notefigure(show-caption: .., ..)` is how you change the caption rendering.
116
+
NB.: this function is expected to take two arguments, please consult the docs.
104
117
105
118
## Utilities
106
119
107
120
-`#marginalia.header()` for easy two/three-column headers
108
121
-`#show: marginalia.show-frame` to show the page layout with background lines
109
-
-`#marginalia.note-numbering()` to generate your own numberings from sequences of symbols
110
-
-`#marginalia.ref()` to reference notes by relative index, without using labels.
111
-
-`#marginalia.get-left()` and `#marginalia.get-right()` to get contextual layout information.
122
+
-`#marginalia.note-numbering()` to generate your own numberings from sequences
123
+
of symbols
124
+
-`#marginalia.ref()` to reference notes by relative index, without using
125
+
labels.
126
+
-`#marginalia.get-left()` and `#marginalia.get-right()` to get contextual
[](https://github.com/nleanba/typst-marginalia/blob/v0.3.0/Marginalia.pdf?raw=true)
117
133
134
+
### Changelog
135
+
136
+
- 0.3.0
137
+
- Notes and notefigures can now be labeled and referenced. The `label`
138
+
parameter on notefigures has been removed, a `note-label` parameter has been
139
+
added.
140
+
- Recommended way to disable numbering a note is using `counter: none`, this
141
+
now works uniformly for notes and notefigures. (Enable markers for a
142
+
notefigure simply by using `counter: marginalia.notecounter`)
143
+
- Note markers now link to the anchor (and vice versa). Controlled via new
144
+
`link-anchor` property.
145
+
- 0.2.4
146
+
- Pages with `height: auto` work now.
147
+
- Added `ref` utility function.
148
+
- 0.2.3: The counter used for notes can now be customized.
149
+
- 0.2.2
150
+
- More flexible `alignment` parameter replaces `align-baseline`.
151
+
(`notefigure.dy` no longer takes a relative length, use `alignemnt`
152
+
instead.)
153
+
- Added `show-frame` and `header` utility functions.
154
+
- 0.2.1: Allow customizing the anchor independently of the in-note number using
155
+
`anchor-numbering`.
156
+
- 0.2.0
157
+
-`block-style` can now be a function, allowing to customize the style for
158
+
even and odd pages.
159
+
-`reverse` and `double` parameters have been replaced by a uniform `side`
160
+
parameter.
161
+
- Setup is now done using the `setup` show-rule. (`configure()` and
162
+
`page-setup()` have been removed)
163
+
-`numbering` and `flush-numbering` parameters are now per-note. (`numbered`
164
+
has been removed.)
165
+
- 0.1.4: New styling parameter `block-style`.
166
+
- 0.1.3
167
+
- New styling parameters `par-style`, and `text-style`.
168
+
- Added `shift` and `keep-order` options.
169
+
- 0.1.1
170
+
- Notes will now avoid each other for any amount of notes.
171
+
- Added `notefigure`.
172
+
- Added `clearance` configuration option.
173
+
174
+
(Not listing bugfixes, see the
175
+
[release notes on GitHub](https://github.com/nleanba/typst-marginalia/releases)
176
+
for the full details.)
177
+
118
178
## Feedback
119
-
Have you encountered a bug? [Please report it as an issue in my GitHub repository.](https://github.com/nleanba/typst-marginalia/issues)
120
179
121
-
Has this package been useful to you? [I am always happy when someone gives me a ~~sticker~~ star⭐](https://github.com/nleanba/typst-marginalia)
180
+
Have you encountered a bug?
181
+
[Please report it as an issue in my GitHub repository.](https://github.com/nleanba/typst-marginalia/issues)
182
+
183
+
Has this package been useful to you?
184
+
[I am always happy when someone gives me a ~~sticker~~ star⭐](https://github.com/nleanba/typst-marginalia)
0 commit comments