Board & Pieces — A package to display chessboards

Board & Pieces is a package that lets you display chessboards in your Typst documents. Configurations can be specified using FEN, or even read from a PGN file. You can also mark some squares and draw arrows on the board.

For example, the result below is obtained from the following code.

// From https://lichess.org/study/Xf1PGrM0.
#board(
  fen("3k4/7R/8/2PK4/8/8/8/6r1 b - - 0 1"),

  marked-squares: "c7 c6 h6",
  arrows: ("d8 c8", "d8 c7", "g1 g6", "h7 h6"),
  display-numbers: true,

  white-square-fill: rgb("#d2eeea"),
  black-square-fill: rgb("#567f96"),
  marking-color: rgb("#2bcbC6"),
  arrow-stroke: 0.2cm + rgb("#38f442df"),

  stroke: 0.8pt + black,
)

I just released version 0.6, which is available on Typst Universe.

6 Likes