0

pgf-pie keeps giving me headaches.

This is my LaTeX code:

\documentclass{article}
\usepackage{pgf-pie}

\begin{document}

\begin{tikzpicture}
\pie[color={black!10, black!20, black!30}]
    {62/\TeX\ Live and Mac\TeX,
     32/MiK\TeX\ and Pro\TeX t, 6/Other \TeX}
\end{tikzpicture}

\end{document}

I use MiKTeX and PdfLaTeX as my PDF engine, when I run it the log file returns these errors:

Missing character: There is no b in font nullfont!
Missing character: There is no l in font nullfont!
Missing character: There is no a in font nullfont!
Missing character: There is no c in font nullfont!
Missing character: There is no k in font nullfont!
Missing character: There is no ! in font nullfont!
Missing character: There is no 1 in font nullfont!
Missing character: There is no 0 in font nullfont!
Missing character: There is no b in font nullfont!
Missing character: There is no l in font nullfont!
Missing character: There is no a in font nullfont!
Missing character: There is no c in font nullfont!
Missing character: There is no k in font nullfont!
Missing character: There is no ! in font nullfont!
Missing character: There is no 2 in font nullfont!
Missing character: There is no 0 in font nullfont!
Missing character: There is no b in font nullfont!
Missing character: There is no l in font nullfont!
Missing character: There is no a in font nullfont!
Missing character: There is no c in font nullfont!
Missing character: There is no k in font nullfont!
Missing character: There is no ! in font nullfont!
Missing character: There is no 3 in font nullfont!
Missing character: There is no 0 in font nullfont!

And the PDF looks like this:

Pie chart with properties printed as text

To me it looks like attributes/options are being accidentally being printed as text.

I've found similar issues (e.g. tikzpicture options causing "There is no [ in font nullfont!"?), but none of these pointed me in the direction of solving this.

UPDATE: This question appeared to be a duplicate. One of the answers put me on the track to the the answer on this issue: Problem generating pie chart with pgf-pie package

That solved it for me.

gijswijs
  • 181

1 Answers1

1

For some reason pgf-pie outputs the color in one place. You can patch the command.

But I wouldn't recommend the package. It quite ruthlessly redefines user commands like \color and so it bound to break other code.

\documentclass{article}
\usepackage{pgf-pie,etoolbox}
\makeatletter
\patchcmd\pgfpie@findColor{\thecolor \breakforeach }{\breakforeach}{}{\fail}
\makeatother
\begin{document}

\begin{tikzpicture}
\pie[color={red!10, black!20, black!30}]
    {62/\TeX\ Live Mac\TeX,
     32/MiK\TeX\ and Pro\TeX t, 6/Other \TeX}
\end{tikzpicture}

\end{document}
Ulrike Fischer
  • 327,261
  • That doesn't yield the desired result. But I'm open for suggestions of alternative packages that can make pie charts. – gijswijs Oct 09 '19 at 12:54
  • what do mean by it doesn't give the desired result? It looks okay for me (the red!10 is only there because I wanted to be sure, that the user colors are used, you can change it back to black!10). – Ulrike Fischer Oct 09 '19 at 13:10
  • I meant that your problem didn't solve the printing of the attributes for me. But it did put me on the right track to finding the solution. See: https://tex.stackexchange.com/questions/469477/problem-generating-pie-chart-with-pgf-pie-package – gijswijs Oct 09 '19 at 13:15
  • 1
    I don't get the overprinting, only the missing char messages in a current tex system. – Ulrike Fischer Oct 09 '19 at 14:08