Skip to content

[Quesion] How to setup line thickness globally #895

Answered by orbitoo
Cierra-Runis asked this question in Q&A
Discussion options

You must be logged in to vote

try this

#import "@preview/cetz:0.4.0"

#set page(height: auto, width: auto, margin: (x: 10pt, y: 10pt))

#let canvas(
  body,
  background: none,
  baseline: none,
  debug: false,
  length: 28.35pt,
  padding: none,
  stroke: none,
) = cetz.canvas(
  {
    cetz.draw.set-style(stroke: (thickness: 5pt)) // HERE
    body
  },
  background: background,
  baseline: baseline,
  debug: debug,
  length: length,
  padding: padding,
  stroke: stroke,
)

#canvas({
  import cetz.draw: *
  line((0, 0), (1, 1))
})

Just define a brandnew canvas function, and preclude all your global settings.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Cierra-Runis
Comment options

@orbitoo
Comment options

Answer selected by Cierra-Runis
@Cierra-Runis
Comment options

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