Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grid doesn't seem to work? #16

Open
jlearnscode opened this issue Jun 16, 2024 · 0 comments
Open

Grid doesn't seem to work? #16

jlearnscode opened this issue Jun 16, 2024 · 0 comments

Comments

@jlearnscode
Copy link

None of the examples from Typst documentation work.

A simple example generates nothing and produces no error messages:

#grid(
  columns: 5,
  gutter: 5pt,
  ..range(25).map(str)
)

The tiger example and the chessboard example give an error message of 'expected semicolon or line break':

// We use `rect` to emphasize the
// area of cells.
#set rect(
  inset: 8pt,
  fill: rgb("e4e5ea"),
  width: 100%,
)

#grid(
  columns: (60pt, 1fr, 2fr),
  rows: (auto, 60pt),
  gutter: 3pt,
  rect[Fixed width, auto height],
  rect[1/3 of the remains],
  rect[2/3 of the remains],
  rect(height: 100%)[Fixed height],
  grid.cell(
    colspan: 2,
    image("tiger.jpg", width: 100%),
  ),
)
#set text(15pt, font: "Noto Sans Symbols 2")
#show regex("[♚-♟︎]"): set text(fill: rgb("21212A"))
#show regex("[♔-♙]"): set text(fill: rgb("111015"))

#grid(
  fill: (x, y) => rgb(
    if calc.odd(x + y) { "EFF0F3" }
    else { "7F8396" }
  ),
  columns: (1em,) * 8,
  rows: 1em,
  align: center + horizon,

  [♜], [♞], [♝], [♛], [♚], [♝], [♞], [♜],
  [♟], [♟], [♟], [♟], [],  [♟], [♟], [♟],
  grid.cell(
    x: 4, y: 3,
    stroke: blue.transparentize(60%)
  )[♟],

  ..(grid.cell(y: 6)[♙],) * 8,
  ..([♖], [♘], [♗], [♕], [♔], [♗], [♘], [♖])
    .map(grid.cell.with(y: 7)),
)

removing the first three lines (#set... #show...) gives an error of 'type color has no method transparentize'.
Removing .transparentize(60%) then gives an error of 'function grid does not contain field cell`'.

Perhaps a separate ticket but none of the table examples in table documentation seem to work, either.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant