Hobby & special docs

LaTeX is not only for papers. Write a chess game in ordinary PGN and the board diagram follows automatically; there are packages on CTAN for crosswords, sudoku, knitting charts and family trees too. This corner of the ecosystem has a particular hazard, though: the package someone recommends online is quite often not in TeX Live. The go package psgo does ship, but it will not run under pdflatex, and kpsewhich shogi.sty returned nothing at all. So every package below was checked for existence with kpsewhich and then actually compiled before being named here. Where something does not work, this page says so.

Writing a chess game in PGN: skak, xskak and chessboard

Chess is the best-served hobby in LaTeX. Load \usepackage{xskak}, open a game with \newchessgame, and write the moves in plain PGN as \mainline{1. e4 e5 2. Nf3 Nc6 3. Bb5 a6}: the moves are typeset, and wherever you put \chessboard the position at that point appears as a diagram. What matters is that the package keeps an internal board and actually plays the moves through. The diagram therefore cannot drift out of step with the score. Unlike hand-entered coordinate diagrams, insert one extra move in the middle and every later diagram follows.

latex
\documentclass{article}
\usepackage{xskak}   % loads skak and chessboard
\begin{document}
\newchessgame
\mainline{1. e4 e5 2. Nf3 Nc6 3. Bb5 a6}
\chessboard

% the shortest possible loss, in four plies
\newchessgame
\mainline{1. f3 e5 2. g4 Qh4#}
\chessboard[showmover=false]
\end{document}

The three packages divide the work cleanly. skak is the foundation: it parses the notation, keeps the internal board and provides the fonts whose glyphs are the pieces. xskak sits on top, adding variations and several simultaneous games, and it loads chessboard at the same time. Fine control of the diagram belongs to chessboard: keys such as \chessboard[showmover=false] turn off the side-to-move indicator, and you can crop the board to part of itself or colour and mark individual squares. Since the single line \usepackage{xskak} brings in all three layers, that is the line to write when in doubt.

The history is worth a moment. skak is Danish for chess — the README says so outright. The author is Torben Hoffmann, and the version in TeX Live 2024 is v1.5.3, dated 8 January 2018. According to TeX Live's own catalogue entry, the package is built on work by Piet Tutelaers, and its novelty was using PGN for input instead of coordinate notation: g1f3 becoming the more readable Nf3. xskak (v1.5, 23 June 2019) and chessboard (v1.9, 1 November 2020) are both by Ulrike Fischer, who is also thanked in skak's own acknowledgements for her work on how that package handles fonts.

Go has psgo, shogi has nothing, and psgo will not run under pdflatex

For go diagrams, TeX Live 2024 does carry psgo (v0.17) — but, as the name says, it draws with PSTricks, so it will not work under pdflatex. Pushing a \begin{psgoboard} through produced ! Undefined control sequence., expanding to \c@lor@to@ps ->\PSTricks _Not_Configured_For_This_Format: PSTricks announcing that it is not configured for this format. Curiously, \usepackage{psgo} on its own compiles fine; the breakage happens the moment you actually draw a board. The way out is the latex then dvips then ps2pdf route, or interposing auto-pst-pdf (which is in TeX Live 2024). The former produced a one-page PDF when tested.

On shogi, let this be plain: there is no shogi package in TeX Live 2024. kpsewhich shogi.sty, kpsewhich igo.sty and kpsewhich gochess.sty all returned nothing, and searching everything under /usr/local/texlive/2024 for shogi turned up no matching file. To typeset shogi games or positions you will have to install something from outside CTAN yourself, or draw the board in TikZ. Rather than trusting a memory of having used some package years ago, run kpsewhich first — in this corner of LaTeX that is the shortest path.

Crosswords and sudoku: cwpuzzle and sudoku

Crosswords use cwpuzzle and sudoku uses sudoku. Both feel like writing a table: cells go in a row separated by |. Inside cwpuzzle's Puzzle environment, |[1]T is a cell holding T and numbered 1, |* is a blocked square, and |. closes the row. Numbering and the frame are automatic, and the PuzzleClues environment with \Clue{number}{answer}{clue} sets the clues separately, so one source can produce both the blank grid and the filled solution. One thing to watch: the file name and the distribution name differ. You load \usepackage{cwpuzzle}, but on TeX Live the package is distributed as crossword, v1.11, dated 13 September 2022. Search for the latter with tlmgr.

latex
\usepackage{cwpuzzle}   % distributed on TeX Live under the name "crossword"
\usepackage{sudoku}
% ...
\begin{Puzzle}{5}{5}%
|[1]T|[2]E|[3]X |*  |*  |.
|E   |*   |E    |*  |*  |.
|[4]X|*   |X    |*  |*  |.
|*   |*   |*    |*  |*  |.
|*   |*   |*    |*  |*  |.
\end{Puzzle}
\begin{PuzzleClues}{\textbf{Across}}
\Clue{1}{TEX}{A typesetting system}
\end{PuzzleClues}

\begin{sudoku}
|2| | |6| |7| | |1|.
| |8| | | | | |5| |.
| | |6| |3| |4| | |.
| | |9| | | |8| | |.
|5| | |1| |4| | |2|.
| | |3| | | |7| | |.
| | |4| |6| |1| | |.
| |7| | | | | |3| |.
|9| | |2| |8| | |4|.
\end{sudoku}

sudoku (v1.0) wants exactly nine rows; an empty cell is written as | | with a space, and |. closes each row. Both examples above compiled without error on TeX Live 2024 — cwpuzzle produced the frame and numbering, sudoku a grid with the heavier 3×3 rules. Incidentally, despite its name cwpuzzle also sets sudoku and kakuro. If you are typesetting a whole book of puzzles, consolidating on it is a reasonable move.

Knitting charts: the knitting package and where the symbol key lives

knitting (v3.0, 3 April 2019, by Ariel Barton) supplies the symbol fonts and commands for cable and lace knitting charts. Its interface is distinctive: you type the symbols as ordinary letters, as in \textknit{kpkp}k for a knit stitch, p for a purl, one keyboard character per stitch symbol. A gridded chart is built with \chart[right]{...}, and there is a trap here: chart is a command, not an environment, and the body goes in braces. Writing \begin{chart} raises no error and exits 0, but comparing the two forms on identical input, the command produced stitch symbols and row numbers while the environment printed the plain letters kpkpkp. \knitgrid and \knitnogrid switch the grid on and off. In the manner of older packages, it works under both Plain TeX and LaTeX.

latex
\usepackage{knitting}
% ...
\textknit{kpkpkp}   % symbols are typed as ordinary letters

\knitgrid           % draw the grid; \knitnogrid for a chart without one
% \chart is a COMMAND taking a braced body -- not a "chart" environment.
\chart[right]{
kpkpkp
pkpkpk
}

The list of which letter makes which stitch lives in knitkey — which is not a package you load. kpsewhich knitkey.sty returns nothing; the real thing is a document, at texmf-dist/doc/fonts/knitting/knitkey.pdf. To open it locally, texdoc knitkey is the quick way. The same directory also holds knitexamples.pdf. Note too that TeX Live carries a separate package called knittingpattern, which is for setting the written instructions rather than the chart.

Family trees, recipes and calendars: genealogytree, cooking, termcal

Family trees are the job of genealogytree (v2.3.0). It is built on TikZ and runs under pdflatex as is. Inside \begin{genealogypicture} you write the family relations as nesting, as in parent{ g{child} p{father} p{mother} }, and the layout is worked out for you. template= chooses a visual style, and signpost is a reasonable place to start. What makes the package serious is that it distinguishes descent from marriage, so the diagram stays correct as genealogy and not merely as a picture.

latex
\usepackage[all]{genealogytree}
\usepackage{cooking}
% ...
\begin{genealogypicture}[template=signpost]
parent{
  g{Child}
  p{Father}
  p{Mother}
}
\end{genealogypicture}

\pagestyle{recipe}
\begin{recipe}{Pancakes (serves 4)}
\ingredient{200\,g flour} sift into a bowl.
\ingredient{2 eggs}
\ingredient{300\,ml milk} whisk in until smooth.
\end{recipe}

For recipes there is cooking (v0.9b, 24 June 1999, by Axel Reichert). Its age shows in a pleasingly decisive design: \ingredient{...} takes exactly one argument — quantity and ingredient go in together — and the instruction sentence simply follows it. The result is the familiar cookbook layout, with ingredients set flush right in a left-hand column and the method flowing to their right. TeX Live carries two other packages with the same aim, cuisine (v0.7) and xcookybooky (v1.5), the latter modern enough to take photographs and cooking times. For a calendar, termcal (v1.8) turns a start date and a number of weeks into a class schedule.

Run kpsewhich before recommending: what ships and what does not

In this corner of LaTeX, a package named in an old article is not necessarily still on your machine. Checking costs one second: type kpsewhich thepackage.sty and a path comes back if it is there, nothing if it is not. When you do not know the file name, tlmgr info name will tell you, description included. The table below is the actual result of running those commands while writing this page — and you can run the same commands yourself before writing any \usepackage line.

PackageStatus in TeX Live 2024What to watch for
skak / xskak / chessboardAll three present: v1.5.3 / v1.5 / v1.9The single line \usepackage{xskak} brings in all three
psgoPresent (v0.17)Depends on PSTricks; under pdflatex it dies as soon as you draw a board
shogi.styDoes not existkpsewhich is empty; igo.sty and gochess.sty are likewise absent
cwpuzzlePresent, v1.11 (13 September 2022)Distributed on TeX Live as crossword; also sets sudoku and kakuro
sudokuPresent (v1.0)Wants exactly nine rows; an empty cell is | | with a space
knittingPresent (v3.0, 3 April 2019)The knitkey symbol list is a PDF, not a package; read it with texdoc knitkey
genealogytreePresent (v2.3.0)TikZ-based; runs under pdflatex as is
cookingPresent (v0.9b, 24 June 1999)\ingredient takes only one argument; cuisine and xcookybooky are also present
termcalPresent (v1.8)Builds a class calendar from a start date and a number of weeks

One last thing this page deliberately does not cover: music. Musical typesetting has its own page, where it is measured that LilyPond is not bundled with TeX Live and that MusiXTeX requires three passes, etex then musixflx then etex. In every one of these hobby genres the whole deliverable is that the picture is right, so do not stop at a clean compile — open the PDF and look. If a chess diagram has one piece on the wrong square, TeX will not say a word about it.