jneug / typst-codelst

A typst package to render sourcecode
MIT License
79 stars 4 forks source link

Render long code in multiple grids #3

Closed jneug closed 8 months ago

jneug commented 11 months ago

For long source code with many page breaks, the alignment of line numbers can sometimes drift off and no longer match the code lines.

Right now, #sourcecode creates a grid with multiple columns.

To solve the issue, long code blocks could be split into multiple grids, to allow the alignment of line numbers to "reset" and prevent drift.

Problem with this approach:

A solution could be to use the previous approach used in v0.0.5 to set the complete code in every grid, but to clip it to show only the appropriate lines.

jneug commented 8 months ago

With Typst 0.0.9 this should not be necessary any longer.