3

I used to compile Gantt charts nicely with XeLaTeX (to deal with fonts) by including pgfgantt from Texmaker on my macOS (High Sierra). Now, after upgrading Texmaker to version 5.0.2, with this same workflow, I'm having the following error regarding the option compress calendar:

​! Package pgfkeys Error: I do not know the key '/pgfgantt/compress calendar' and I am going to ignore it. Perhaps you misspelled it.

The MWE below reproduces this unique error:

\documentclass[11pt,a4paper]{article}
\usepackage{pgfgantt}
\begin{document}
\begin{center}

%\resizebox{\textwidth}{!}{

\begin{ganttchart}[hgrid, vgrid,
time slot format=isodate-yearmonth,
bar/.append style={fill=black!50},
milestone/.append style={fill=black, rounded corners=3pt},
compress calendar
]{1-01}{1-12}
\gantttitlecalendar{year, month} \\
\ganttbar[bar/.append style={fill=white}]{Pre}{1-1}{1-3} \\
\ganttbar[bar/.append style={shape=ellipse, fill=black}]{Post}{1-10}{1-10} \\
\ganttmilestone{Milestone}{1-6}
\end{ganttchart}

%}% close \resizebox

\end{center}
\end{document}

When I comment compress calendar, everything works, but the chart leaks outside the page. If I force a resizebox, I have a visual improvement, but not good enough. Also, x unit to reduce the new column widths obtained didn't help.

Could somebody give a word on this issue?

4

This behaviour has been changed in v5.0 (published 2018/01/18) of the pgfgantt package. From the changelog inside the package documentation:

Key compress calendar has been replaced by time slot unit to allow an additional level of compression (year)

To use the old behaviour from compress calendar, time slot unit=month seems like the right choice now:

\documentclass[11pt,a4paper]{article}
\usepackage{pgfgantt}
\begin{document}
\begin{center}

\begin{ganttchart}[hgrid, vgrid,
    time slot format=isodate-yearmonth,
    bar/.append style={fill=black!50},
    milestone/.append style={fill=black, rounded corners=3pt},
    time slot unit=month
]{1-01}{1-12}
    \gantttitlecalendar{year, month} \\
    \ganttbar[bar/.append style={fill=white}]{Pre}{1-1}{1-3} \\
    \ganttbar[bar/.append style={shape=ellipse, fill=black}]{Post}{1-10}{1-10} \\
    \ganttmilestone{Milestone}{1-6}
\end{ganttchart}

\end{center}
\end{document}
| improve this answer | |
  • Hi! Perfect! It worked. Indeed, a big unawareness (or lack of experience) not observing that and hunting for the package's changelog. I guess this came accompanied by a MacTex update, right? Thanks a lot! :) – opcg May 9 '18 at 21:18
  • Hi, here show me error: "Package pgfkeys Error: I do not know the key '/pgfgantt/time slot unit', to w. ]{1-01}{1-12}". MikTex Updated today. :( – cbe-user-99263 Dec 21 '18 at 2:01
  • @cbe-user-99263 Please have a look at your log file which version of pgfgantt is used on your system. The log file should contain Package: pgfgantt 2018/01/10 v5.0 Draw Gantt diagrams with TikZ for this to work. If you are using v5.0 and this error still shows up, please ask a new question including a MWE of your setup as a quick test did not show this error for me. – epR8GaYuh Dec 21 '18 at 8:35
  • I copied the same code above inside Overleaf and it show me the same error: "Package pgfkeys Error: I do not know the key '/pgfgantt/time slot unit', to which you passed 'month', and I am going to ignore it. Perhaps you misspelled it." And I checked the package configurations: pgfgantt 2013/06/01 v4.0 Draw Gantt diagrams with TikZ. Nevertheless, this error happens similar when I use this code in my TeXStudio with pgfgantt v5.0 (admin mode) but using pgfgantt v4.0 (user mode). Miktex User mode is not updated. Maybe this could be the reason why my error is showed. – cbe-user-99263 Dec 25 '18 at 2:04

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.