tingerrr / anti-matter Goto Github PK
View Code? Open in Web Editor NEWA typst package for managing front and back matter page numbering of your documents.
License: MIT License
A typst package for managing front and back matter page numbering of your documents.
License: MIT License
I've used my own package successfully in a few reports for university, while using my unfinished template.
After starting work on my master's thesis and by extension the university template to turn it into a proper template package, I noticed that I once again got incorrect results. Namely, off-by-one errors, which I couldn't attribute to the metadata being shoved to the next page.
It was also trivial to create logical page numbering with a well-structured template, without anti-matter
. So I'm wondering if this package carries its own weight, especially since Typst cannot use logical numbering for PDF-export if this package is used.
// unnumbered title page if needed
// ...
// front-matter
#set page(numbering: "I")
#counter(page).update(1)
// ...
// page counter anchor
#metadata(()) <front-matter>
// main document body
#set page(numbering: "1")
#counter(page).update(1)
// ...
// back-matter
#set page(numbering: "I")
// must take page breaks into account, may need to be offset by +1 or -1
#context counter(page).update(counter(page).at(<front-matter>).first())
// ...
A document like this will provide correct logical page numbering for PDF-export, as well as simple front- and back-matter numbering with almost no setup.
The only thing this package can do that this approach cannot, is getting the correct total number at each point to allow for I / V
or 1 / 15
patterns. But this seems rare in practice.
Line 18 in ebdf1a8
Above line is from this repo (tingerrr/anti-mater)
Below line is from typst/packages
Maybe a small update that doesn't increment semver to fix?
Line 52 in f45315e
I think the let num
in the next scope should be in the parent scope instead?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.