#set page(height: auto)
can make typst automatically determine the proper height to display all the stuffs in one page, like:
#set page(height: auto, width: 4.5in)
#lorem(100)
But now I want to use height: auto
option for two columns page, and this is how it looks like:
#set page(height: auto, width: 4.5in, columns: 2)
#lorem(50)
or
#set page(height: auto, width: 4.5in)
#columns(2)[#lorem(150)]
All the content is on the one side, and the other side is left blank, which is not that good.
What I want is something like:
i.e. two columns are balanced and just fit in one page.
At first, I tried to use measure
to get the height of all content and set the page height to half of it, but there are spacing between two columns, so the height is not always (maybe always not) that exact, even if I did some experiments and got a relatively good coefficient rather than simply using 1/2 to calculate the height for two columns from the original height.
Another idea is to detect whether a page is enough for the content and iterate several times to find the critical point and finally get a tight bound for height, but this may be of low efficiency and may encounter layout did not converge within 5 attempts
if doing this inside the typst document.
So what is the best practice for making a one page two columns document, or is that possible?
I am new to this community and not proficient in typst and English, and I’ve already searched the web and this forum for something relevant but in vain. I would appreciate it if you could offer any help, thanks in advance.
P.S. I need to do so as I am currently working with an automatic publishing system for campus news & information. We previously found out that this form may be the best for phone readers, and we could manually adjust the geometry for LaTeX document everyday in the past.