Each book has various commands in header.tex which help with writing.
header.tex
\d
\diagram{fen#1}{fen#2}
\example