How to add comments and display movement notations for each move, using the following code
\documentclass{beamer}
\usepackage{xskak, chessboard}
\setbeamertemplate{navigation symbols}{}
\begin{document}
\newcommand\getmovestyle[1]{%
\ifthenelse
{\equal{#1}{N}}%knight move
{\def\mymovestyle{[clockwise=false,style=knight]curvemove}}%
{\ifthenelse
{\equal{#1}{}}% castling
{\def\mymovestyle{curvemove}}%
{\def\mymovestyle{straightmove}}}}%
\begin{center}
\[\newchessgame\]
\hidemoves{1.d4 Nf6 2.c4 g6 3.Nc3 Bg7}
\xskakloop{%
\getmovestyle{\xskakget{piecechar}}%
\chessboard[normalboard,
pgfstyle=\mymovestyle, color=blue!50,
markmoves=\xskakget{move}, pgfshortenend=0.3em, arrow=to, coloremph, color=red!50, markstyle=circle, markfield=\xskakget{movefrom},
emphfields=\xskakget{moveto}, setfen=\xskakget{nextfen}]
}% End of \xskakloop...
\end{center}
\end{document}

and putting the \makeatletter command in the preamble.
Thank you very much for your patience.
– Hany Aug 04 '17 at 14:35