Skip to content

Documentation for place() is a bit misleading #3159

Closed

Description

@zegkljan

Description

This code

first
#place(top + left, dx: 100pt, rect(width: 30pt, height: 30pt, fill: aqua))
second
third

produces this output
image
while it would be expected to produce this output (here achieved by moving the #place call at the end)
image
as per the documentation:

Places content at an absolute position.

Placed content will not affect the position of other content. Place is always relative to its parent container and will be in the foreground of all other content in the container. Page margins will be respected.

Either the behavior or the documentation is therefore incorrect.

Possibly related to #1833

Reproduction URL

No response

Operating system

Linux

Typst version

  • I am using the latest version of Typst

Activity

  1. added
    bug
    on Jan 9, 2024
  2. laurmaedje commented on Jan 9, 2024

    @laurmaedje
    Member

    The documentation is perhaps a bit misleading here. In general, everything except for a few things (text, inline equations, boxes) is block-level and so is place. However, it will not affect other block-level containers.

  3. added
    docs
    and removed
    bug
    on Jan 15, 2024
  4. changed the title [-]place() triggers paragraph break[/-] [+]Documentation for `place()` is a bit misleading[/+] on Jan 15, 2024
  5. SolidTux commented on Sep 9, 2024

    @SolidTux

    This can sometimes be circumvented with box(place(...)) by the way. I don't know in which cases this breaks, though.

  6. added a commit that references this issue on Sep 25, 2024
    243a196
  7. SolidTux commented on Sep 27, 2024

    @SolidTux

    Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsgood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions