ntjess / typst-drafting

Some common drafting utilities for the `typst` document typesetter
The Unlicense
52 stars 2 forks source link

fix position.side #4

Open fredguth opened 9 months ago

fredguth commented 9 months ago

Hacky way to fix position.side. It is assuming a specific biding. Probably won't work in right-to-left languages.

ntjess commented 9 months ago

Thanks for the PR! However, I would avoid merging for a few reasons:

  1. As you noted, binding will change what this default should be, so I wouldn't want unexpected behavior as a result of swapping l/r on an odd page. Moreover, the margins are only swapped if binding is specified in the first place, otherwise they stay on their respective sides. Therefore, it makes the most sense to wait until get rules are implemented to detect these cases.
  2. It is possible to use margin-note in a smaller container -- it's how the minipages in the manual are generated: image In this case, it wouldn't be ideal to artificially swap left- and right-margin values based on the current page.