Skip to content
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

Issue10294 new code for two column layout on typst 0.12.x #10324

Merged
merged 21 commits into from
Oct 29, 2024

Conversation

jarnowic
Copy link
Contributor

Typst 0.12.0 introduces some changes for two column layout, preferring #page(columns: <N>) for global two column output, and supplementing #place with new parameters scope and clearance to layout one column content (such as titleplage) on two column documents. This patch tries to upgrade the typst.template to comply with the newer requirements. Check issue 10294.

layout instructions for two column layout has changed. see typst/typst#5215
two column layout instructions have changed in typst 0.12; see  typst/typst#5215 for details.
fixed braces (I hope...)
fixed indentation?
Update default.typst for upcoming typst 0.12
@jgm
Copy link
Owner

jgm commented Oct 23, 2024

template.typst has a set page with other attributes. Why not put the columns there rather than in default.typst?

@jarnowic
Copy link
Contributor Author

jarnowic commented Oct 23, 2024

template.typst has a set page with other attributes. Why not put the columns there rather than in default.typst?

Because default.typst is where the variables can be accessed to from the YAML headers or the command line, iiuc; template.typst is out of reach, so pandoc variables cannot affect it.

To tell the truth, I am still not quite sure why so many defaults are set in template.typst; it seems to me that only the variables to be used in customizations in the typst documents should be declared in the typst template, while the document layout decisions might be delayed to the document itself. Looks to me as if template.typst would work as a latex.fmt, just declaring the variables available, while all layout defaults should be moved into default.typst to give room for customization, just as in LaTeX classes and packages. My apologies for the comparison, but that's the model I am more familiar with; groff_ms is still, not much unlike typst, work in progress on my side.

So, if i were to suggest something, i'd say that the layout code should be moved from template.typst into default.typst to allow for more customizations, and not the other way around; but we may ask the proponent of the original typst interface, I guess.

@jgm
Copy link
Owner

jgm commented Oct 24, 2024

template.typst is out of reach, so pandoc variables cannot affect it.

Not so. You can put variables in partials!

@jarnowic
Copy link
Contributor Author

template.typst is out of reach, so pandoc variables cannot affect it.

Not so. You can put variables in partials!

you're right; and doing so keeps the change less intrusive than the other one. proceeding.

set columns in template.typst
revert original `cols` variable from `template.typst`; `template.typst` keeps the original `page` settings
fixed regression (removed `paper` from `page` accidentally)...
misplaced `cols` variable...
restored empty line...
prettified (sort of) blank space...
@jarnowic
Copy link
Contributor Author

template.typst is out of reach, so pandoc variables cannot affect it.

Not so. You can put variables in partials!

you're right; and doing so keeps the change less intrusive than the other one. proceed

template.typst is out of reach, so pandoc variables cannot affect it.

Not so. You can put variables in partials!

you're right; and doing so keeps the change less intrusive than the other one. proceeding.

I think it is ready now...

data/templates/default.typst Outdated Show resolved Hide resolved
data/templates/default.typst Outdated Show resolved Hide resolved
data/templates/template.typst Outdated Show resolved Hide resolved
data/templates/template.typst Outdated Show resolved Hide resolved
data/templates/template.typst Outdated Show resolved Hide resolved
reverted cosmetic changes for functional ones... effectively restoring original version, iiuc.
removed extra space, added while debugging for clarity
space test added, for legibility
restored blank line, as in the original, to minimize the diff file
restored insets
removed extra blank
@jgm
Copy link
Owner

jgm commented Oct 29, 2024

looks good - I'll merge this and update the tests.

@jgm jgm merged commit e01023c into jgm:main Oct 29, 2024
0 of 12 checks passed
@jarnowic jarnowic deleted the issue10294 branch October 29, 2024 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants