Repository navigation
Description
Description
Currently, the figure placement in typst documents is restricted to 'top', 'bottom', or 'auto' (which places figures at either the top or bottom based on the figure element's location). This approach, while functional, has several limitations:
Contextual Placement:
The need arises for figures to be positioned relative to their main reference in the text, especially within large paragraphs. The current method, which aligns figures based on their point of definition, often results in suboptimal placements. When trying to define the figure inmidst a paragraph, the paragraph gets split, which disrupts the flow of text. Ideally, figures could dynamically align with the reference used within the text, maintaining coherence and visual integrity.
Adjacent Page Placement for Double-Sided Documents:
In double-sided documents, it would be highly beneficial for figures not be limited to the current page. They could automatically appear on an adjacent visible page—either the previous or the next. This placement ensures that figures are readily visible without necessitating a page turn and increases the systems degree of freedom. The ability to automatically adjust figure placement significantly reduces the manual effort involved in repositioning figures following text modifications. Implementing these features would greatly enhance the usability and flexibility of typst for producing professionally formatted documents.
Thank you for considering these enhancements.
Use Case
Placing figures in general (point 1) and especially in double sided documents like theses (point 2)
Activity
Beiri22 commentedon Apr 20, 2024
(see #3159 and #3951)
laurmaedje commentedon Jul 1, 2024
Another case are full page figures as requested in #4442.
p-e-n-t-h-a commentedon Sep 1, 2026
I agree with @Beiri22 here, this is a real limitation essential for scientific writing, and honestly a bit surprising that this feature is missing.
It appears to me that it is currently impossible to "put this figure near its reference point" without either manually shuffling the figure definition around the source (fragile, breaks on any edit, not even possible with paragraphs that are longer than one page) or accepting a layout that doesn't match the reference. (If there is a good option here, please help.)
This is a genuine regression in ergonomics compared to LaTeX, where this behavior is easily achieved by placing the figure definition within the paragraph. This workaround is not possible in Typst, since the "insert a figure mid-paragraph" behavior (splitting the paragraph) makes the it actively harmful to the surrounding text flow. Also the
#box(figure...)workaround does nothing in this case, since the figure does not float anymore.I suggest maybe adding this to the known limitations between Typst and LaTeX, since it might deter people to start writing their thesis using Typst, knowing proper figure placement cannot be achieved. At least for me this is one of the major reasons why even choosing LaTeX over Word. It should do the layouting for me and not force me to do
parbreaksthat don't make sense just to place my figure in the vicinity of it's first reference.Typst example illustrating the problem
yields:
typ.pdf
Easy LaTeX approach
yields:
tex.pdf