Skip to content

Commit

Permalink
Fixed compilation when page numbering was not set and back references…
Browse files Browse the repository at this point in the history
… are enabled

Co-authored-by: St0wy <[email protected]>

fixes #31
  • Loading branch information
slashformotion committed Apr 27, 2024
1 parent 99584f9 commit 3fd69d7
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 5 deletions.
Binary file modified examples/full-example/main.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/full-example/main.typ
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#show: make-glossary

#set page(numbering: "1", paper: "a5")
#set page(paper: "a5")

//I recommend setting a show rule for the links to that your reader understand that they can click on the references to go to the term in the glossary.
#show link: set text(fill: blue.darken(60%))
Expand Down
Binary file modified examples/groups/groups.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/groups/groups.typ
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#show: make-glossary

#set page(numbering: "1", paper: "a5")
#set page(paper: "a5")

//I recommend setting a show rule for the links to that your reader understand that they can click on the references to go to the term in the glossary.
#show link: set text(fill: blue.darken(60%))
Expand Down
Binary file modified examples/import-terms-from-yaml-file/main.pdf
Binary file not shown.
3 changes: 2 additions & 1 deletion examples/import-terms-from-yaml-file/main.typ
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@
print-glossary(entries, show-all: full)
}

#set page(numbering: "1")
#set page(paper: "a5")

#show: make-glossary

= Test Document
Expand Down
Binary file modified examples/plural-example/main.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/plural-example/main.typ
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#show: make-glossary

#set page(numbering: "1", paper: "a5")
#set page(paper: "a5")

#show link: set text(fill: blue.darken(60%))

Expand Down
9 changes: 8 additions & 1 deletion glossarium.typ
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,14 @@ SOFTWARE.*/
pages.push(x.page())
(values: values, pages: pages)
},
).values.map(x => link(x)[#numbering(x.page-numbering(), ..counter(page).at(x))]).join(", ")
).values.map(x => {
let page-numbering = x.page-numbering();
if page-numbering == none {
page-numbering = "1"
}
link(x)[#numbering(page-numbering, ..counter(page).at(x))]
}
).join(", ")
}
}
}
Expand Down

0 comments on commit 3fd69d7

Please sign in to comment.