# Space between mdframed text and chessboard / chess line

I have the following type of document, where I want to display some framed chess game header and continue with either a line or a chessboard:

\documentclass[ngerman]{scrreprt}
\usepackage{xskak}
\usepackage[linewidth=1pt]{mdframed}

\begin{document}

\begin{mdframed}
{\centering
1. \textsc{Player 1 -- Player 2}\\
Testland \textbf{2018}\\}
\end{mdframed}
\begin{center}
\chessboard[addfen=K7/6RR/8/2k5/8/8/8/8 w - - 0 1]
\end{center}

\begin{mdframed}
{\centering
1. \textsc{Player 1 -- Player 2}\\
Testland \textbf{2018}\\}
\end{mdframed}

\newgame
\mainline[level=1]{1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. Nc3 Nf6 5. d3 d6 6. Bg5 Na5}

\end{document}


However, the space between chessboard and header is quite large, while the space between the line and the header is good (far smaller). I fiddled around with several other solutions (like hrule and so on), but I can't solve this one. Actually it looks to me like twice the space between two paragraphs.

• The center environment introduce spaces – Ulrike Fischer Mar 16 '18 at 7:40
• thank you :-) stupid me, using \centerline{\chessboard...} does the job, I also tested {\centering\chessboard...}, but this causes other problems like centering the text above. – Ferdinand Kern Mar 16 '18 at 14:27
• \centering is better, but you need to ensure that you have a paragraph: {\par\centering \chessboard \par}. – Ulrike Fischer Mar 16 '18 at 14:29
• OK :-) Is there a quick answer why centering is better than the centerline solution? or is centering just better than the center environment? – Ferdinand Kern Mar 16 '18 at 14:36

Thanks to Ulrike Fischer for pointing the problem out. A combination of using \centering instead of the center environment and setting margintop=false in the chessboard options does the trick.

\documentclass[ngerman]{scrreprt}
\usepackage{xskak}
\usepackage[linewidth=1pt]{mdframed}

\begin{document}

\begin{mdframed}
{\centering
1. \textsc{Player 1 -- Player 2}\\
Testland \textbf{2018}\\}
\end{mdframed}
{\par\centering \chessboard[addfen=K7/6RR/8/2k5/8/8/8/8 w - - 0 1,margintop=false] \par}

\begin{mdframed}
{\centering
1. \textsc{Player 1 -- Player 2}\\
Testland \textbf{2018}\\}
\end{mdframed}

\newgame
\mainline[level=1]{1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. Nc3 Nf6 5. d3 d6 6. Bg5 Na5}

\end{document}