-
-
Notifications
You must be signed in to change notification settings - Fork 808
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Promote margin
to a type
#3636
Comments
Related note: Since |
The auto margin can be resolved as |
Hi, could you pls elaborate on how making a |
The easiest example is to compare to a
In the same way, a
If the |
Can we also consider the ability to specify different margins on different pages? It will be very useful, especially for the first page! |
I'm not sure I see the link between resolving the page margin and making it into its own type with its own constructor. You can expose, through Indeed, what's missing here is a step in which we resolve page properties before each page is laid out (and, as a consequence, transform what users specified into what Typst effectively is aware of, i.e. into a single dictionary-like structure, through a custom type or not). I elaborate on this approach at #3671. We can see that #3811, for example, doesn't solve the resolving margin |
Description
Similar to how
stroke
allows converting a dictionary into stroke properties, there should be amargin
type that converts a dictionary specifier into a page marginUse Case
Page margins can be specified in numerous ways:
auto
This makes it difficult to consume through a
context
call due to the wide variety of potential outputs. Each of these specifiers results in a different-format output:Similar to how a stroke evolved from a dict into its own type, I recommend the same thing for a
margin
. This way, users can expect to resolvetop
,bottom
,left
, andright
without calculating it manually by checking the binding and page number, referencingauto
against paper defaults, etc.Real-world example: The "drafting" package would need to take all these into account to provide robust margin notes without user specifications.
The text was updated successfully, but these errors were encountered: