You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Multi-column Float Elements (Figures, Tables, Code Blocks, etc.) #553
I want to be able to break the column rules for figures and tables to the full size of the page and I want to be able to float these elements. I believe these two must be tackled together as you can see in the motivating examples
Reacted by Philipp Niedermayer, Nicholas Gao, Michael Lohr, Filip Andersson, Dmitry, Mikaël Capelle, Grantham Taylor, Kreijstal, ⑆ Neved4 ⑈, Jonas Neugebauer and 156 more
Reacted by Matti Vuorre, Alexo, Nathan LeRoy, Daniel Salvadori, Reuben Gardos Reid, Olivier Fortier, lucas-bublitz, Jeppe Nørregaard, Alex Muirhead, voice of texnoforge and 5 more
Reacted by abcvav, Victor L., Jon Zelner, Oleksii Dovhaniuk, Raul Durand, Jakob Topholt Jensen, Nathan LeRoy, Daniel Salvadori, Dmitry, Reuben Gardos Reid and 9 more
Currently elements cannot break away from their local scope. If columns is activated globally in the document, subsequent elements cannot break from their column parent to use the full width of the page.
A separate issue is that if an element (e.g. image) doesn't fit into the remaining space it will move to the next page/column leaving a blank space behind it.
These two issues, while separate, must be tackled together as there are complex interactions between them.
To solve the first issue I propose that we introduce a scope argument to all the layout methods. Scope can either be global (relative to page) or local (relative to parent [existing behavior]).
To solve the second issue I propose a new layout element #wrap or #float (no strong preference but for the rest of this post I will be using #wrap). #wrap is the counterpart to #place. Unlike place however, it can participate in the flow.
Calculate #wrap element's dimensions and check if the element can fit to existing page/column (other #wrap elements might already populate the page)
If it can, place #wrap element at correct position in current page/column based on its alignment policy. Relayout all other content (except other #wrap elements) in current page/column.
If not, place #wrap element at correct position in the next page/column based on its alignment policy. Keep adding content to current page until it is filled.
In case 2 or more #wrap elements are placed in the same position in a page/column fallback arguments can be used to decide its position:
Repeated secondary alignment - [alignment1, alignment1]: place it to the next available spot (e.g. if 2 #wrap elements request the top position then place the first #wrap element at the top and the second #wrap below it.)
Alternate secondary alignment - [alignment1, alignment2]: Place the 2nd #wrap to the position indicated by alignment2. Assuming there are no more conflicts the content is laid out again in the available space. If there is another conflict move to the next page and repeat (alignment1 -> alignment2). For example if the first #wrap request the top position then the second can request in the fallback the bottom.
Only primary alignment - [alignment]: no fallback value is provided, move to the next page and repeat (alignment)
No primary alignment - []: no primary alignment value is provided, try to fit #wrap into existing page/column. Otherwise move to the top of next page/column. If there is a conflict move to an empty space below
Only secondary alignment - [, alignment]: Try to place to current page/column at current position. If it doesn't fit or there is some other conflict use secondary alignment. If there are more conflicts move to the top of next page and repeat
This is the most important missing feature to make typst as powerful as LaTeX.
Reacted by Ruben Bekaert, glatavento, Dominikus Herzberg, Jens, Andrew Boldi, Marc Gong Bacvanski, Gary Weissman, Filip Růžička, Daniel Salvadori, Alexander Schulz and 21 more
Reacted by Raul Durand, Dmitry Avtonomov and albalansi
Reacted by Colin Jacobs, astrale-sharp, Kevin Bonham, Andrew Boldi, Marc Gong Bacvanski, Alexander Schulz, Raul Durand and albalansi
Do you think the primary and secondary alignments are both necessary? @Andonome
I wouldn't say 'necessary', but I've found a great deal of flexibility in having both 'top' and 'bottom' options.
This page looks fine, as-is, but the two elements float apart when more text is added, which matches the general format of pictures-at-bottom, and tables-on-top.
I've not found tables in the centre work very often.
Of course if anyone wants to get really fancy, automatic wrapping around a PNGs filled parts would be punk-as-all-heck.
Reacted by Dimitri Tabatadze, gavales, Gaites Swanson and Lucas Chiesa
This is the most important missing feature to make typst as powerful as LaTeX.
LaTeX doesn't have this ability. There is no reliable text wrapping in a multicols environment. It's a big factor which stops it having reliable output - every compile, every page needs to be checked, images moved, et c.
Edit: I see I've received some silent naysayers downvoting this comment.
If anyone wants to put their code where their mouth is, check out my main project, and get any 3 images (of your choosing) to float, using any macro you please.
Reacted by Philipp Niedermayer, Ruben Bekaert and Jan
@Andonome I think is wrap is to be implemented it should be implemented with all these usecases in mind. Another usecase that comes to mind is that you have a central circular figure and that text should wrap around it as well. You examples are genuinely useful. Thanks!
I believe that the lack of support for multi-column figures and tables is the main limitation to using Typst for writing manuscripts for scientific journals.
Reacted by Edward Thomas, Philipp Niedermayer, Daniel Salvadori, DKierner, Dominikus Herzberg, Colin Jacobs and Jaroslav Pesek
It depends on the field - almost nothing I submit to (in biology) uses multi-column layouts, but I need line numbers (happily that's being worked on #352 )
I believe that the lack of support for multi-column figures and tables is the main limitation to using Typst for writing manuscripts for scientific journals.
Definitely true for informatics and computer sciences where the IEEE format is quite common. Some stuff is just to large to fit in a single half-page column meaningfullly.
Reacted by Dominikus Herzberg, Rachael Sexton, Colin Jacobs, lucas-bublitz, Daniel Salvadori, Grantham Taylor and Bangya Liu
I think the ideal solution, from a user's perspective, would involve adding a single parameter, tentatively called colspan, to non-breakable block elements, which would specify how many columns that element should span. Specifying a colspan of more columns than exist in the current context would result in an error. I think such a parameter, coupled with the existing usage of placement: "auto" | "top" | "bottom", would provide complete freedom to place multi-column blocks anywhere as desired.
I'm not a mod, but I think that there are now enough "This feature is stopping me from using Typst"/"This feature is missing for XYZ support" comments in this issue. The Devs are aware of this issue, and it is as-of-now the third most upvoted issue. So instead of adding more comments of the same, I'd suggest using the emoticons to express your support for this feature.
(And the selfish remark: Then people that have subscribed to this issue will not get spammed with non-progress messages)
Reacted by classabbyamp, Felix Wiegand, Lukas Stratmann, Martin Kröning, Ilia, Nathan Jessurun, Philipp Niedermayer, Miquel, Raul Durand, lucas-bublitz and 44 more
Reacted by lucas-bublitz, Stefan Glorch, Alberto Fabbri, Dennis Hoelgaard Bal, Kevin Bonham, Reuben Gardos Reid, Olivier Fortier, Nathan Williams, hinata235, Victor L. and 7 more
in case anyone who is still waiting for the new feature, here is my bypass (i really like typst and would never go back to latex, so i have played with the problem for quite a while):
add your figure to the first column and wrap it with a place function, so that it appears in the middle of two cols. Then at the top of second column, you place another empty rect, so that contents on the right side will align with left side.
you might want to adjust the location of the second place and the rect height so that visually it looks like that the table spans two columns. a nested place is used here to shift caption and table by different percentage. Interesting thing that the figure could still recognize the place wrapped table and generate "Table 1" as caption correctly.
i did not find a way to append a label in this case, so i simply type in "Table 1" whenever i refer it.
Reacted by Dmitry, Reuben Gardos Reid, Adrien Lavoillotte, lurenjiamax, Pradyumna Shome, Ben, Brian and Leo Li
Reacted by Shunichiro Nomura, Dmitry and Reuben Gardos Reid
Reacted by Sean Clayton, Roberto Nobrega, Shunichiro Nomura, Antoine Stevan, Benedikt Schäfer, vaisest, Kevin Bonham, Bastien Voirin, Maximilian Schmidt, Semen Germanskiy and 17 more
Reacted by Laurenz Stampfl, Bangya Liu, Sean Clayton, Enivex, Jos Backus, Shunichiro Nomura, Antoine Stevan, Alex Saveau, vaisest, Kevin Bonham and 11 more
Reacted by Kevin Bonham, Jannis Jorre, Dmitry, let-me-cook, Dennis Hoelgaard Bal, Andrew Boldi, Tony and Bastien Voirin
Hey guys, I'm probably missing something but can I use the new layout engine to wrap text around figures? The wrap-it package says that it's only relevant as long as this issue isn't resolved. Since it is now, does this mean I can actually wrap text around figures? (and how?) Or is it still not possible and the package documentation should be updated?
@sschuldenzucker Text wrapping around figures at the side was not part of the 0.12 work on floating placement. This subfeature was also proposed in this issue, but it was too large of an issue to be actionable. Side-wrapping is now tracked by #5181.
Hello !
I'm re-opening this discussion since I can't manage to place my figures the ways I would like. Basically, I want my figures to behave like Wrap (local scope) shown above.
With the placement option, this leads to the following logic:
If the figure has the space to stay on the same page/column: use placement: none
If the figure is pushed to a new page because it doesn't have enough space: use placement: top
This ensures that the image is placed at the correct spot in the text if it it has the space for it, and otherwise gets placed at the top of the very next page/column, while continuing the text before to not leave blank space.
Is there a way to achieve this behavior in the current version of Typst ? Otherwise, would this be possible to add in future versions ?
Thank you !
@AstroAure I don't think it makes sense to extend this old issue since the discussion has moved on. If you think this may be a bug in the implementation from v0.12, you can open a new issue (or better yet hop on discord and ask for help in case there's a good solution), or if it's relevant to #5181 you could comment there.
Reacted by Laurenz, Bastien Voirin and Aurélien Genin
Activity
[-][Feature Request] Multi-column Figure and Tables[/-][+]Multi-column Figure and Tables[/+]giannissc commentedon Apr 4, 2023
Currently elements cannot break away from their local scope. If
columnsis activated globally in the document, subsequent elements cannot break from their column parent to use the full width of the page.A separate issue is that if an element (e.g. image) doesn't fit into the remaining space it will move to the next page/column leaving a blank space behind it.
These two issues, while separate, must be tackled together as there are complex interactions between them.
To solve the first issue I propose that we introduce a
scopeargument to all the layout methods. Scope can either beglobal(relative to page) orlocal(relative to parent [existing behavior]).To solve the second issue I propose a new layout element
#wrapor#float(no strong preference but for the rest of this post I will be using#wrap).#wrapis the counterpart to#place. Unlike place however, it can participate in the flow.The function signatures would be:
#place(scope, alignment, dx, dy, body)#wrap(scope, [alignment], dx, dy, body)alignment:[]:[alignment]:[alignment, alignment, ...][, alignment, ...]giannissc commentedon Apr 4, 2023
Algorithm for
#wrapelements:#wrapelement's dimensions and check if the element can fit to existing page/column (other#wrapelements might already populate the page)#wrapelement at correct position in current page/column based on itsalignmentpolicy. Relayout all other content (except other#wrapelements) in current page/column.#wrapelement at correct position in the next page/column based on itsalignmentpolicy. Keep adding content to current page until it is filled.giannissc commentedon Apr 4, 2023
In case 2 or more
#wrapelements are placed in the same position in a page/column fallbackargumentscan be used to decide its position:alignment-[alignment1, alignment1]: place it to the next available spot (e.g. if 2#wrapelements request the top position then place the first#wrapelement at the top and the second#wrapbelow it.)alignment-[alignment1, alignment2]: Place the 2nd#wrapto the position indicated byalignment2. Assuming there are no more conflicts the content is laid out again in the available space. If there is another conflict move to the next page and repeat (alignment1 -> alignment2). For example if the first#wraprequest the top position then the second can request in the fallback the bottom.alignment-[alignment]: no fallback value is provided, move to the next page and repeat (alignment)alignment-[]: no primary alignment value is provided, try to fit#wrapinto existing page/column. Otherwise move to the top of next page/column. If there is a conflict move to an empty space belowalignment-[, alignment]: Try to place to current page/column at current position. If it doesn't fit or there is some other conflict use secondaryalignment. If there are more conflicts move to the top of next page and repeatgiannissc commentedon Apr 4, 2023
Does this seem reasonable? @laurmaedje, @reknih
Also is this the best place to discuss or do you prefer discord?
I am also willing to contribute code to get this out sooner! 🙂
giannissc commentedon Apr 5, 2023
Motivating Examples
No wrap (existing behavior)
Not allowing text to wrap around other elements can result in the following issue:

No wrap,break column rules (global scope)
Simple allowing content to break the column rules and layout based on page will also have the same issue:

Wrap (local scope) -
#wrap(scope: local, alignment: [])- DefaultWrap (global scope) -
#wrap(scope: global, alignment: [])Wrap (global scope) + Alignment(Centered) -
#wrap(scope: global, alignment: [center+horizon])Wrap (global scope) + Conflict (Repeated) -
#wrap(scope: global, alignment: [top, top])Wrap (global scope) + Conflict (Alternate) -
#wrap(scope: global, alignment: [top, bottom])[-]Multi-column Figure and Tables[/-][+]Multi-column Float Elements (Figures, Tables, Code Blocks, etc.)[/+]Andonome commentedon Apr 5, 2023
This is great. In fact, it'd be ideal.
giannissc commentedon Apr 5, 2023
Do you think the primary and secondary alignments are both necessary? @Andonome
eltos commentedon Apr 5, 2023
This is the most important missing feature to make typst as powerful as LaTeX.
Andonome commentedon Apr 5, 2023
I wouldn't say 'necessary', but I've found a great deal of flexibility in having both 'top' and 'bottom' options.
This page looks fine, as-is, but the two elements float apart when more text is added, which matches the general format of pictures-at-bottom, and tables-on-top.
I've not found tables in the centre work very often.
Of course if anyone wants to get really fancy, automatic wrapping around a PNGs filled parts would be punk-as-all-heck.
Andonome commentedon Apr 5, 2023
LaTeX doesn't have this ability. There is no reliable text wrapping in a multicols environment. It's a big factor which stops it having reliable output - every compile, every page needs to be checked, images moved, et c.
Edit: I see I've received some silent naysayers downvoting this comment.
If anyone wants to put their code where their mouth is, check out my main project, and get any 3 images (of your choosing) to float, using any macro you please.
giannissc commentedon Apr 6, 2023
@Andonome I think is wrap is to be implemented it should be implemented with all these usecases in mind. Another usecase that comes to mind is that you have a central circular figure and that text should wrap around it as well. You examples are genuinely useful. Thanks!
32 remaining items
andrewboldi commentedon Jul 19, 2024
@laurmaedje Any progress on this feature request? :)
RaulDurand commentedon Jul 19, 2024
I believe that the lack of support for multi-column figures and tables is the main limitation to using Typst for writing manuscripts for scientific journals.
kescobo commentedon Jul 19, 2024
It depends on the field - almost nothing I submit to (in biology) uses multi-column layouts, but I need line numbers (happily that's being worked on #352 )
DKierner commentedon Jul 20, 2024
Definitely true for informatics and computer sciences where the IEEE format is quite common. Some stuff is just to large to fit in a single half-page column meaningfullly.
danaugrs commentedon Jul 21, 2024
I think the ideal solution, from a user's perspective, would involve adding a single parameter, tentatively called
colspan, to non-breakable block elements, which would specify how many columns that element should span. Specifying acolspanof more columns than exist in the current context would result in an error. I think such a parameter, coupled with the existing usage ofplacement: "auto" | "top" | "bottom", would provide complete freedom to place multi-column blocks anywhere as desired.jounathaen commentedon Jul 22, 2024
I'm not a mod, but I think that there are now enough "This feature is stopping me from using Typst"/"This feature is missing for XYZ support" comments in this issue. The Devs are aware of this issue, and it is as-of-now the third most upvoted issue. So instead of adding more comments of the same, I'd suggest using the emoticons to express your support for this feature.
(And the selfish remark: Then people that have subscribed to this issue will not get spammed with non-progress messages)
NeutrinoLiu commentedon Aug 29, 2024
in case anyone who is still waiting for the new feature, here is my bypass (i really like typst and would never go back to latex, so i have played with the problem for quite a while):
add your figure to the first column and wrap it with a place function, so that it appears in the middle of two cols. Then at the top of second column, you place another empty rect, so that contents on the right side will align with left side.
you might want to adjust the location of the second
placeand therectheight so that visually it looks like that the table spans two columns. a nestedplaceis used here to shift caption and table by different percentage. Interesting thing that the figure could still recognize theplacewrappedtableand generate "Table 1" as caption correctly.i did not find a way to append a
labelin this case, so i simply type in "Table 1" whenever i refer it.spped2000 commentedon Sep 19, 2024
a-stevan commentedon Sep 23, 2024
@NeutrinoLiu and @spped2000 👋
so i've tried your examples and they did not work on my side...
could you share a complete repro of your examples? that would be amazing
my repro
i have installed Typst today with
and i get the following
typst --versionmy Typst source is a single file, called
main.typand which containsthen i compile this with
and here is what i get 😕

laurmaedje commentedon Sep 24, 2024
Good news: #5017
sschuldenzucker commentedon Feb 11, 2025
Hey guys, I'm probably missing something but can I use the new layout engine to wrap text around figures? The wrap-it package says that it's only relevant as long as this issue isn't resolved. Since it is now, does this mean I can actually wrap text around figures? (and how?) Or is it still not possible and the package documentation should be updated?
laurmaedje commentedon Feb 11, 2025
@sschuldenzucker Text wrapping around figures at the side was not part of the 0.12 work on floating placement. This subfeature was also proposed in this issue, but it was too large of an issue to be actionable. Side-wrapping is now tracked by #5181.
AstroAure commentedon Nov 6, 2025
Hello !
I'm re-opening this discussion since I can't manage to place my figures the ways I would like. Basically, I want my figures to behave like Wrap (local scope) shown above.
With the
placementoption, this leads to the following logic:placement: noneplacement: topThis ensures that the image is placed at the correct spot in the text if it it has the space for it, and otherwise gets placed at the top of the very next page/column, while continuing the text before to not leave blank space.
Is there a way to achieve this behavior in the current version of Typst ? Otherwise, would this be possible to add in future versions ?
Thank you !
kescobo commentedon Nov 6, 2025
@AstroAure I don't think it makes sense to extend this old issue since the discussion has moved on. If you think this may be a bug in the implementation from v0.12, you can open a new issue (or better yet hop on discord and ask for help in case there's a good solution), or if it's relevant to #5181 you could comment there.