3

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.

1
  • 2
    Welcome to TeX.SX. Your problem is related with dimension-too-large. You can solve it using a x unit lower than 13mm. But even then, will need to use a \resizebox command to fit the chart into a beamer frame. 12mm x 237 days will result in a at least 2844 mm wide Gantt chart.
    – Ignasi
    Commented Oct 29, 2014 at 8:10

1 Answer 1

4

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .