3

I would like the "1" being of the colour of the background (i.e., yellow!10). But actually I get the thin lines within the "one" when using the TikZ code below.

\begin{tikzpicture}
\fill[yellow!10] (0,0) rectangle (2,2);
\draw[step=1cm,gray,very thin] (0,0) grid (2,2);
\node at (1,1) {\Large{\color{red}\ding{202}}};
\end{tikzpicture}
4

If we insert \ding{202} inside a node even if we add inner sep=0pt a little space appear on the edges of the symbol, here an example

\documentclass[margin=5mm]{standalone}
\usepackage{tikz}
\usepackage{pifont}
\begin{document}
\begin{tikzpicture}
\fill [yellow!10] (0,0) rectangle (2,2);
\draw [step=1cm,gray,very thin] (0,0) grid (2,2);
\node [text=red,font=\Large,inner sep=0pt,fill=yellow!10,circle,draw]at (1,1) {\ding{202}};
\end{tikzpicture}
\end{document}

enter image description here

You can bypass this problem with a negative inner sep, just manual adjustments

\documentclass[margin=5mm]{standalone}
\usepackage{tikz}
\usepackage{pifont}
\begin{document}
\begin{tikzpicture}
\fill [yellow!10] (0,0) rectangle (2,2);
\draw [step=1cm,gray,very thin] (0,0) grid (2,2);
\node [text=red,font=\Large,inner sep=-1.8pt,fill=yellow!10,circle]at (1,1) {\ding{202}};
\end{tikzpicture}
\end{document}

enter image description here

  • The fix works well for me since I have only numbers from 1 to 9, but what if one has also letters like for instance a, b, p, q. – Nicolas Beldiceanu Sep 3 '16 at 17:40
  • @NicolasBeldiceanu Why would that be any different? – cfr Sep 3 '16 at 21:33
  • It may be different since the dingbats numbers have a shape that is a circle, so using a circle in the background is fine; but with letters whose shape is not a circle, using a circle may not work. – Nicolas Beldiceanu Sep 5 '16 at 16:29

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.