cetz-package / cetz

CeTZ: ein Typst Zeichenpaket - A library for drawing stuff with Typst.
https://cetz-package.github.io
GNU Lesser General Public License v3.0
885 stars 36 forks source link

coordinate error strict mode #91

Closed astrale-sharp closed 1 year ago

astrale-sharp commented 1 year ago

Hey,

Wouldn't it be nice if when your coordinate is "name.topleft" or ""name.top.left" or if name is undefined you get an error with a list of what anchors are valid or what named element are available? :innocent:

astrale-sharp commented 1 year ago

tested with 0.0.1 since my computer is small and typst cant just bring the repo in for me (yet?)

fenjalien commented 1 year ago

I don't undstand your question or request? When a name or anchor is not recognised CeTZ prints a list of existing ones in the error message.

circle((), name: "circle")
circle("circle.other")

image

johannes-wolf commented 1 year ago

Tested it with the online Editor. It seems that assertions from packages are ignored there, while they work with local packages. Maybe this is a typst bug?

Test: https://typst.app/project/rzySqn8YqS4A_uZ46yhvZO

Local package: grafik

astrale-sharp commented 1 year ago

Oh fair enough, yes i tested it on the online editor! it just appear to succeed for all these cases! I'll open an issue in typst later

ThatOneCalculator commented 10 months ago

Tested it with the online Editor. It seems that assertions from packages are ignored there, while they work with local packages. Maybe this is a typst bug?

Can I ask how you were able to get CeTZ working on typst.app?

johannes-wolf commented 10 months ago

With the current version of Typst, assertions are shown in the online editor:

#import "@preview/cetz:0.1.2": canvas, plot, draw
#set page(width: auto, height: auto)

#canvas(length: 1cm, {
  import draw: *
  circle("non-existing")
})

grafik