2

How can I create the following chessboard with LaTex ?

enter image description here

Thank you in advance

Update

enter image description here

\usepackage{xskak,xcolor}
\usepackage[utf8]{inputenc}
\usepackage[LSBC3,T1]{fontenc}
\usepackage{chessboard}

\setchessboard{boardfontencoding=LSBC3}
\makeatletter
\renewcommand\board@do@printfieldempty[2]{%fileNr, rankNr
    \ifthenelse%
    {\board@test@iswhitefield{#1}{#2}}%white field
    {}% {\@nameuse{board@\board@val@game @piece@empty@white}}%
    {}% {\@nameuse{board@\board@val@game @piece@empty@black}}%
}
\makeatother   

\begin{document}
    \begin{center}
        \newchessgame
        \chessboard[whitefieldmaskcolor=gray!50!white,addfontcolors,
        border=false,
        printarea=a1-h8,
        hidefields={a1, a2, a3, a4, a5, a6, a7, a8,
                    b1, b2, b3, b6, b7, b8,
                    c1, c2, c7, c8,
                    d1, d8,                      
                    f8, f1,
                    g1, g2, g7, g8,
                    h1, h2, h3, h6, h7, h8},
        setwhite={rc6, rd5, re4, rf3},
        linewidth=0.5pt,
        markboard,
        pgfstyle=border,
        boardfontsize=30pt,
        showmover=false]
    \end{center}
\end{document}
  • Please post what you've got so far as MWE. – TeXnician May 21 '17 at 10:04
  • 1
    See the answer here, tex.stackexchange.com/a/133338/117534 and friends. Might be of some help. If you're stuck, post what you have and then ask a specific question relating to the problem you are facing. Currently the question is a do-it-for-me, which is not attractive to most people here. – Troy May 21 '17 at 10:17
  • 1
    Check also tex.stackexchange.com/a/358694/2388 – Ulrike Fischer May 21 '17 at 13:03
  • 1
    Please do not edit questions to include answers. If you have an answer of your own, post it as an answer. It is very confusing when questions contain answers to them! – cfr May 21 '17 at 23:33
6

I realized this with the chessboard package:

\documentclass{article}

\usepackage[LSBC3,T1]{fontenc}
\usepackage[svgnames]{xcolor}
\usepackage{chessboard}
\setchessboard{%
  showmover=false,
  boardfontencoding=LSBC3,
  blackfieldmaskcolor=BlanchedAlmond,
  whitefieldmaskcolor=BurlyWood!30!brown,
  blackfieldcolor=BlanchedAlmond,
  setfontcolors,
  label=false,
  border=false,
  maxfield=g8,
  hidefields={a1,a2,a3,a6,a7,a8,b1,b2,b7,b8,c1,c8,e1,e8,f1,f2,f7,f8,g1,g2,g3,g6,g7,g8}
}
\makeatletter
\renewcommand\board@do@printfieldempty[2]{}
\makeatother

\begin{document}

\chessboard[setpieces={Rb6,Rc5,Rd4,Re3}]

\end{document}

enter image description here

  • For the diamond shape of the chess board, I followed this solution: I specify with the hidefields key which fields are not needed, and redefine \board@do@printfieldempty to not print these fields. Additionally, you need to remove the outer border (border=false). Since the layout fits inside 7x8 cells, I set this size as maxfield.
  • For the colors, I use BlanchedAlmond and BurlyWood!30!brown from the xcolor package with the svgnames option. These are specified in the three keys blackfieldmaskcolor, whitefieldmaskcolor and blackfieldcolor (note: I swapped black and white to get exactly your example). setfontcolors then guarantees that these colors are actually used.
|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.