Skip to content

Where does the arrow plotting end? #666

Answered by fenjalien
psads-git asked this question in Q&A
Discussion options

You must be logged in to vote

The arrow is drawn at the end coordinate, its behaving like that because you're using relative coordinates to place the equation. You should use anchors to place it intead:

#import "@preview/cetz:0.2.2"

#cetz.canvas({
  import cetz.draw: *

  line((0, 0), (2, 0), mark: (end: ">", fill: black), name: "line")
  content(
    "line.end",
    align(center, $a^2 = b^2+c^2$), 
    padding: (left: 1em, right: 1em),
    name: "form",
    anchor: "west"
  )
  line("form.east", (rel: (2, 0)), mark: (end: ">", fill: black))
})

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by psads-git
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants