1

I can mark a square with X or with a circle, but I still can't to mark with the + sign. enter image description here

\usepackage{chessboard}

\begin{document}
\begin{center}

\newchessgame

\chessboard[maxfield=c4, color=black,
markstyle=cross,markfields=a2,
markstyle=cross,markfields=a3,
markstyle=cross,markfields=b1,
markstyle=cross,markfields=b2,
markstyle=cross,markfields=b3,
markstyle=cross,markfields=b4,
markstyle=cross,markfields=c2,
markstyle=cross,markfields=c3, 
pgfstyle={[fill]circle},
markarea=\mycenter,
padding=-0.8ex,color=black,
markfields=a1,
markfields=a4,
markfields=c1,
markfields=c4, showmover=false]

\end{center}

\end{document}
3
  • You get use the text mark type and insert a real plus. Or you will have to define a suitable markstyle. Mar 20 '18 at 15:32
  • Chris H- Excuse me, I've tried replacing the line markstyle=cross,markfields=a2, for markstyle=+,markfields=a2, but does not work. How can I do Mar 20 '18 at 16:43
  • Ulrike Fischer- Please, How I to define a suitable markstyle? Mar 20 '18 at 16:44
2

You can define a plus style e.g. like this:

\documentclass{article}
\usepackage{chessboard}
\makeatletter
\cbDefinePgfFieldStyle{plus}{%
    \pgfsetroundcap
    \setlength\len@board@tempx{\dimexpr 0.1em + \board@pgf@shortenstart \relax}%
    \pgfsetshortenstart{\len@board@tempx}%
    \setlength\len@board@tempx{\dimexpr 0.1em + \board@pgf@shortenend \relax}%
    \pgfsetshortenend{\len@board@tempx}%
    \pgfsetlinewidth{\board@pgf@linewidth}%
    \pgfpathmoveto{\pgfpointxy{0}{0.5}}%
    \pgfpathlineto{\pgfpointxy{0}{-0.5}}%
    \pgfusepath{stroke}%
    \pgfpathmoveto{\pgfpointxy{-0.5}{0}}%
    \pgfpathlineto{\pgfpointxy{0.5}{0}}%
    \pgfusepath{stroke}}%
\makeatother

\begin{document}
\begin{center}


\chessboard[maxfield=c4, color=black,
markstyle=plus,markfields=c3]

\end{center}

\end{document}

enter image description here

1
  • Ulrike Fischer- Thanks. Works. Unfortunately, after reading the Chessboard, couldn't find the solution. Thanks. Mar 20 '18 at 23:01

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.