3

I would like to generate a chess animation in a beamer presentation.

As a MWE:

\documentclass{beamer}
\usepackage{chessfss}
\usepackage[controls]{animate}
\begin{document}
\begin{frame}[fragile]
\begin{animateinline}{1}
{{
\boardfont
\noindent
Z0L0\\
QZ0Z\\
Z0ZQ\\
0L0Z\\
\par
}}
\end{animateinline}
\end{frame}
\end{document}

The chess pieces are however displayed in one row.

How can I resolve this problem?

0

1 Answer 1

4

The content of animation frames is typeset into LR-boxes and thus \\ has no effect. Therefore, multi-line content has to be put into a \parbox:

\documentclass{beamer}
\usepackage{chessfss}
\usepackage[controls]{animate}

\newlength\mywidth
\settowidth\mywidth{\boardfont QZ0Z}

\begin{document}
\begin{frame}
\begin{center}
\begin{animateinline}{1}
  \parbox{\mywidth}{
    \boardfont
    \noindent
    Z0L0\\
    QZ0Z\\
    Z0ZQ\\
    0L0Z\\
  }
\end{animateinline}
\end{center}
\end{frame}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .