[Tex/LaTex] How to draw the Queen’s moves on a chessboard

chessboard

I saw on the Internet a lecture with the title 8 QUEENS PROBLEM USING BACK TRACKING. There is a drawing of the Board following.
How to make this using the Latex? (I tried using the package Chessboard, but the result is very different)

\documentclass{article}
\usepackage{chessboard}
\storechessboardstyle{8x8}{maxfield=d8}
\begin{document}
\chessboard[style=4x4,setwhite={Qd4}, pgfstyle=straightmove,
arrow=to,linewidth=0.2ex,
color=red,
pgfstyle=straightmove,
markmoves={d4-h8,d4-a7,d4-a1,d4-g1,d4-d8,d4-d1,d4-a4,d4-h4},
shortenstart=1ex,showmover=false]
\end{document}

enter image description here

Best Answer

Maybe a start:

\documentclass{standalone}
\usepackage[LSB,LSBC3,T1]{fontenc}
\usepackage{chessboard}
\storechessboardstyle{8x8}{%
  maxfield=h8,
  borderwidth=10mm,
  boardfontencoding=LSBC3,
  color=white,
  colorwhitebackfields,
  color=black,
  colorblackbackfields,
  blackfieldmaskcolor=black,
  whitepiececolor=yellow,
  whitepiecemaskcolor=red,
  addfontcolors,
  pgfstyle=border,
  color=white,
  markregion=a1-h8,
  }
\begin{document}
  \chessboard[
    style=8x8,
    setwhite={Qa8,Qb4,Qc1,Qd3,Qe6,Qf2,Qg7,Qh5},
    pgfstyle=straightmove,
    arrow=stealth,
    linewidth=.5ex,
    padding=1ex,
    color=blue!75!white,
    pgfstyle=straightmove,
    shortenstart=1ex,
    showmover=true,
    markmoves={d3-h7,d3-a6,d3-b1,d3-f1,d3-d8,d3-d1,d3-a3,d3-h3},
  ]
\end{document}

fancier chess board

For straighter arrows:

\documentclass{standalone}
\usepackage[LSB,LSBC3,T1]{fontenc}
\usepackage{chessboard}
\usetikzlibrary{arrows.meta}
\makeatletter
\cbDefinePgfMoveStyle{mystraightmove}{%
    \pgfsetlinewidth{\board@pgf@linewidth}%
    \setlength\len@board@tempx{\dimexpr 0.1em + \board@pgf@shortenstart \relax}%
    \pgfsetshortenstart{\len@board@tempx}%
    \setlength\len@board@tempx{\board@pgf@shortenend}%
    \pgfsetshortenend{\len@board@tempx}%
    \pgfsetarrowsend{\board@pgf@arrow}%
    \pgfsetrectcap
    \pgfpathmoveto{\pgfpointorigin}%
    \pgfpathlineto{\pgfpointanchor{#1}{center}}%
    \pgfusepath{stroke}}%
\makeatother
\storechessboardstyle{8x8}{%
  maxfield=h8,
  borderwidth=10mm,
  boardfontencoding=LSBC3,
  color=white,
  colorwhitebackfields,
  color=black,
  colorblackbackfields,
  blackfieldmaskcolor=black,
  whitepiececolor=yellow,
  whitepiecemaskcolor=red,
  addfontcolors,
  pgfstyle=border,
  color=white,
  markregion=a1-h8,
  }
\begin{document}
  \chessboard[
    style=8x8,
    setwhite={Qa8,Qb4,Qc1,Qd3,Qe6,Qf2,Qg7,Qh5},
    pgfstyle=mystraightmove,
    linewidth=.5ex,
    padding=1ex,
    color=blue!75!white,
    arrow={Triangle[width=1.5ex, length=1ex]},
    shortenstart=1ex,
    shortenend=-.5ex,
    showmover=false,
    markmoves={d3-h7,d3-a6,d3-b1,d3-f1,d3-d8,d3-d1,d3-a3,d3-h3},
  ]
\end{document}

straighter arrows

I tried to figure out a way to wrap the arrows in a pgf transparency group so that I could make them partially transparent without weirdness. However, when I tried this, the arrows disappeared altogether and I couldn't figure it out.

Related Question