[Tex/LaTex] Missing number treated as zero in gantttitle

pgfgantt

I'm trying to use pgfgantt 4.0 but I encounter a rather strange problem.

Here's my MWE:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{pgfgantt}

\begin{document}

\begin{ganttchart}{24}
\gantttitle{Y1}{12} \\
\gantttitle{Y2}{12} \\
\end{ganttchart}


\end{document}

The problem I encounter with this example is the \gantttitle macro reporting the following error:
! Missing number, treated as zero.

Yet, if I remember correctly, \gantttitle does need only two arguments.
Furthermore, I tested a pgfgantt example that worked correctly on an older machine, and
it produced the same errors.

I encounter this problem on several configurations, which are the following:

  1. Windows Miktek 2.9 up-to-date, pgfgantt automatically downloaded by miktek if I remember well. Used to work on an older machine.

  2. Linux texlive 2009 Debian, pgfgantt downloaded from CTAN as the tlmgr seems missing.

I don't have the root access on either machine.

If I ignore the initial gantttitle error, I get many other errors such as "illegal unit of measure", "you can't use \edef after \advance" or "dimension too large". The resulting file does not look like it is horizontally stretched. I don't understand what happens.

Best Answer

It seems that the ganttchart environment requires two mandatory arguments, and you gave it only one argument in your example.