Skip to contents

Draw your plot then call gridcetz_off() to write the output.

Usage

gridcetz_open(
  filename = "Rplot.typ",
  width = 7,
  height = 5,
  header = NULL,
  footer = NULL,
  cetz_version = "0.4.2",
  page_width = "auto",
  page_height = "auto",
  emit_panel_meta = TRUE,
  embed_panel_shift = FALSE,
  quiet = TRUE
)

Arguments

filename

Output .typ file path. Default is "Rplot.typ".

width, height

Device dimensions in inches. Defaults to 7 and 5.

header

Optional Typst header text. If NULL, a default header is used.

cetz_version

CeTZ version string. Default is "0.4.2".

page_width, page_height

Typst page dimensions. Defaults are "auto".

embed_panel_shift

If TRUE, emit a built-in horizontal shift in the Typst fragment based on detected panel margins. The shift can still be disabled in a document by adding #metadata(true) <disable-panel-shift>.

Value

The device number, invisibly.

Examples

out <- tempfile(fileext = ".typ")
gridcetz_open(out, width = 5, height = 4)
grid::grid.newpage()
grid::grid.points(x = c(0.2, 0.5, 0.8), y = c(0.3, 0.7, 0.4))
gridcetz_off()
file.exists(out)
#> [1] TRUE