[Tex/LaTex] pgfgantt: option ‘/pgfgantt/compress calendar’ not recognised

macospgfgantttexmaker

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?

Best Answer

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}