[Tex/LaTex] Dimension too large in pgfgantt

beamerpgfgantt

I am trying to create a gantt chart using pgfgantt.

Below is the 'sample' code I'm using

\begin{ganttchart}[
 hgrid,
 vgrid,
 x unit=18mm,
 time slot format=little-endian
 ]{9.6.2014}{1.2.2015}
 \gantttitlecalendar*{9.6.2014}{1.2.2015}{
 month=shortname
 }
 \end{ganttchart}

when I try to compile it in TeXworks, this happened

Dimension too large.

When I try smaller date duration, this code works. But I really need this 'long' date duration for my gantt chart.

I don't know how to resize this just enough for a beamer presentation.

Best Answer

Dimension too large error means that you are trying to calculate some operation with a result larger that what TeX can manage.

I don't know what can produce this result, but you are trying to draw a calendar wider than 4284 mm (18mm x 238 days).

After some tests, x unit=12mm solves the error but unless you use \resizebox, the calendar won't fit into a beamer slide. Even then the result is useless.

\documentclass{beamer}
\usepackage{pgfgantt}
\begin{document}
\begin{frame}
%\resizebox{\linewidth}{!}{
\begin{ganttchart}[
 hgrid,
 vgrid,
 x unit=12mm,   %<-----------------
 time slot format=little-endian
 ]{9.6.2014}{1.2.2015}
 \gantttitlecalendar*{9.6.2014}{1.2.2015}{
 month=shortname
 }
 \end{ganttchart}%}
 \end{frame}
 \end{document}

The result without \resizebox looks:

enter image description here

and with resizebox:

enter image description here