What are the equivalent Typst functions for these LaTeX commands?

Hello ! I am new to typst with some LaTeX experience.
in LaTeX, I use a lot these commands : \parbox , \hfil , \hfill , \dotfill , \vfil , \scalebox.

for \parbox , I think the typst’s command is grid.
what about the other ones ?
Thank you :slight_smile:

Equivalents for \hfil, \hfill, \vfil, \vfill are #h(_fr) and #v(_fr), where _ is to be replaced with a number, to divide up the remaining space:

#set page(width: 8cm, height: 8cm)

Left#h(1fr);Right

A#h(1fr);A#h(1fr);A#h(1fr);A

A#h(1fr);A#h(2fr);A

#v(1fr)

Bottom

See also Spacing (H) Function – Typst Documentation and Spacing (V) Function – Typst Documentation for more details.


For \scalebox, i think you can use #scale: Scale Function – Typst Documentation


For \dotfill, have a look at Repeat Function – Typst Documentation


I am unsure what to do about \parbox… perhaps any of #box, #block, #place?

4 Likes

Unless there are multiple packages that define the command parbox, I think this should just be the Block Function – Typst Documentation?

2 Likes

Thank you so much !!
For parbox (I use it to write content side by side like in multicolumn environment but not necessirly with balanced columns), the code below gives the desired result

#grid(columns: (45%,1fr,45%), 
row-gutter: 0.5em,
[Top left text],[],[Top right text],
[Bottom left text], [], [Bottom right text]
)

so I can rely on it.
Capture d’écran_2025-07-14_16-32-13