MDLC01 / board-n-pieces

A Typst package to display chessboards.
https://typst.app/universe/package/board-n-pieces
MIT License
8 stars 1 forks source link

PGN variations support #1

Open 9glenda opened 3 months ago

9glenda commented 3 months ago

first of all thanks for creating this package. I'm not sure rather that's what your package is supposed to provide but I'd like to see more pgn support. You could take inspiration from https://www.overleaf.com/learn/latex/Chess_notation (the latex chess package I currently use).

It would be nice if you can do something similar:

\documentclass{article}
\usepackage{xskak}
\begin{document}
\newchessgame
\mainline{1.e4 e5 2.Nf3 Nc6 3.Bb5}

\chessboard

\mainline{3...a6}

A variant \variation{3...Nf6} is used here to show a \texttt{\string\variation} command.

\mainline{4.Ba4}

\chessboard
\end{document}
9glenda commented 3 months ago

it would also be nice to have a 0.1.1 release including the games in universe

MDLC01 commented 3 months ago

I'm currently working on PGN support. I will likely release the next version of the package, including the game function, when PGN is supported (should not be too long to implement). If you have an urgent need for the game function, I can create a release sooner.

I also want to note that the game function is currently not fully implemented (notably, castling and en passant are not supported).

MDLC01 commented 2 months ago

I finally added support for importing for the portable game notation format (which itself support variations) in efe0364e859736aa4d37f860001d3de33d5391f4.

I may look into variations later, but I'm not sure how to expose those in a user-friendly way.