I am trying to include a checkmark in my table that has for example blue color. I have managed to do it using a solution i have found here by using: \def\bluecheck{\tikz\fill[scale=0.4, color=blue](0,.35) -- (.25,0) -- (1,.7) -- (.25,.15) -- cycle;}

end then calling \bluecheck

The problem is when i insert \bluecheck in the caption of my table i get a number of errors (even though it compiles and renders the expected pdf)

Is there a library that creates a checkmark that allows to set its color?


The original problem is that \bluecheck is not a robust command and breaks inside moving arguments like \caption. The caption title moves via the .aux file to the .lot file for the list of contents. The solution is to define the command with \DeclareRobustCommand or with \protected\def:


  \tikz\fill[scale=0.4, color=blue]
  (0,.35) -- (.25,0) -- (1,.7) -- (.25,.15) -- cycle;%

\caption{Blue check mark \bluecheck}



Or, since you're probably using amsmath anyway.....




TikZ is overkill here. Just use a symbol and colour it.

  \expandafter\newcommand\csname #1check\endcsname{\textcolor{#1}{\ding{52}}}%
  \caption{OK \greencheck}
    \bluecheck & \greencheck & \redcheck\\

coloured checks

pifont provides an alternative check if you don't like this one, or use one from the font of your choice, otherwise.

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.