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.

  • I cannot reproduce these problems when I compile your code on my just updated TeXLive2019 installation with PDFLaTeX. So please provide more information on the installation you are using. – user194703 Oct 9 '19 at 2:39
  • @Schrödinger'scat I'm using MikTex (with PDFLaTex) – gijswijs Oct 9 '19 at 5:15
  • Your code works perfectly (note that I'm also using PDFLaTeX in MikTeX). Problem lies may be in your MikTeX installation... – MadyYuvi Oct 9 '19 at 6:01
  • @MadyYuvi Did a reinstall of MikTex. Problem persists – gijswijs Oct 9 '19 at 7:00
  • @gijswijs Can you post your .log file? – MadyYuvi Oct 9 '19 at 8:28
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}
| improve this answer | |
  • That doesn't yield the desired result. But I'm open for suggestions of alternative packages that can make pie charts. – gijswijs Oct 9 '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 9 '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: tex.stackexchange.com/questions/469477/… – gijswijs Oct 9 '19 at 13:15
  • 1
    I don't get the overprinting, only the missing char messages in a current tex system. – Ulrike Fischer Oct 9 '19 at 14:08

Not the answer you're looking for? Browse other questions tagged or ask your own question.