I am trying to place some rectangles as markers in the margin of my document. I have been messing about with them and noticed that the size of the rectangle affects it’s position in the document even if the anchor, dx, and dy values are the same. Here’s my code:
set page(foreground: context {
place(
top + left,
dx:500pt,
dy:4cm,
rotate(90deg, rect(width: 5cm, height: 2cm, fill:green))
)
})
Hello @g_vac ,
can you please format your code, so that it is readable? See
On behalf of your question: This behaviour is due to the size of the rotated object, if you specify reflow: true in rotate, the bounding box of the rotated content is updated and the positioning behaves as expected.
1 Like
Because rotate-d content will retain the bounding box of the original content by default. Please set reflow to true to get your desired result.
#set page(foreground: place(
top + left,
dx: 500pt,
dy: 4cm,
rotate(
90deg,
rect(width: 5cm, height: 2cm, fill: green),
reflow: true, // 👈 Add this
),
))
Not sure what I’m doing wrong, but I’m unable to get the code to format properly. Before posting, I tried wrapping it as specified in the How to post and couldn’t get it to work. Still can’t get it.
Thanks for the answer!
That explains it. Thanks!
1 Like