@@ -42,14 +42,15 @@ headings is added.
4242Changing the default behavior can be done using the vairous named parameters:
4343``` typst
4444#let hydra(
45- sel: heading, // the elements to consider
46- prev-filter: (_, _, _) => true, // check if the last element is eligible
47- next-filter: (_, _, _) => true, // check if the next element is eligible
48- display: core.display, // displays the eligible element
49- paper: "a4", // the paper size to use
50- page-size: auto, // the smaller page size if set
51- top-margin: auto, // the top margin is set
52- loc: none, // a location from which to search
45+ sel: heading, // the elements to consider
46+ prev-filter: (ctx, p, n) => true, // check if the last element is eligible
47+ next-filter: (ctx, p, n) => true, // check if the next element is eligible
48+ display: core.display, // displays the eligible element
49+ is-book: false, // whether the redundancy check should be book aware
50+ paper: "a4", // the paper size to use
51+ page-size: auto, // the smaller page size if set
52+ top-margin: auto, // the top margin is set
53+ loc: none, // a location from which to search
5354) = {
5455 ...
5556}
@@ -61,10 +62,15 @@ a complicated selector `(heading, h => h.level in (1, 2, 3))`. This function is
6162matching element in your document.
6263
6364` loc ` can be used in contexts where location is already known, this avoids a call to ` locate ` ,
64- allowing you to inspect the result of ` display ` directly. ` prev-filter ` and ` next-filter ` are used
65- to check if an element is eligible for being displayed. They receive the ` context ` , the previous and
66- next element relative to the given ` loc ` , the element thast is checked for is not ` none ` , but the
67- other may be.
65+ allowing you to inspect the result of ` display ` directly.
66+
67+ ` prev-filter ` and ` next-filter ` are used to check if an element is eligible for being displayed.
68+ They receive the ` context ` , the previous and next element relative to the given ` loc ` , the element
69+ that is checked for is not ` none ` , but the other may be. These fucntions are executed at most once.
70+
71+ If ` is-book ` is set to ` true ` , it will not display the element if it is visible on the previous
72+ open page. This means for a book with ` left ` binding, if hydra is used on the right page while the
73+ previous section is visible on the left page, it will display nothing.
6874
6975Of ` paper ` , ` page-size ` and ` top-margin ` exactly one must be given. ` paper ` and ` page-size ` are for
7076convenience aand will be used to calculate the ` top-margin ` for you. Use them as follows:
0 commit comments