4

In latex chessboard package, by default, black squares are rendered with hatch patten. I want them in solid gray. enter image description here My several attempts failed, chessboard.pdf is not helpful here. The programming model is not clear, so I gave up. Need help. Thanks in advance.

\documentclass[preview]{standalone}
\usepackage[LSB,LSBC3,T1]{fontenc}
\usepackage{tikz}
\usepackage[skaknew]{skak,chessboard}
\begin{document}
\setchessboard{showmover=false}
\chessboard
\end{document}
userOne
  • 147

2 Answers2

7
\documentclass[preview]{standalone}
\usepackage[LSB,LSBC4,T1]{fontenc}
\usepackage{tikz}
\usepackage[skaknew]{skak,chessboard}
\begin{document}
    \setboardfontcolors{
        blackfieldmask=gray!30}
\setchessboard{boardfontencoding=LSBC4,setfontcolors,showmover=false}
\chessboard
\end{document}

Code with light gray. See setboardfontcolors.

Result

Sango
  • 887
5

The documentation on CTAN is here. I found something like what you wanted on page 34. I modified your code using boardfontencoding=LSBC4 to get the result below.

\documentclass[preview]{standalone}
\usepackage[LSB,LSBC4,T1]{fontenc}
\usepackage{tikz}
\usepackage[skaknew]{skak,chessboard}
\begin{document}
\setchessboard{boardfontencoding=LSBC4,setfontcolors,showmover=false}
\chessboard
\end{document}

enter image description here

DJP
  • 12,451
  • The solution works, but can I set a lighter shade of gray? Say gray!30. – userOne Sep 10 '19 at 15:27
  • I tested color properties from the documentation and ran into transparency issues, and gave up. Strange, a font change is producing a different color. – userOne Sep 10 '19 at 15:38
  • Sango found the fix to modify the gray color and posted it in their answer. – DJP Sep 10 '19 at 16:07