0

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.

Example document

  • 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
1

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}
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.