Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm attempting to make a Gantt chart in my LaTeX document with the pgfgantt package. However, when I try to compile, it gives me undefined control sequence at the first \gantttitle between the {7} and \\:

\begin{ganttchart}{7}
  \gantttitle{2012}{7} \\ 
  \gantttitlelist{1,...,7}{1} \\
  \ganttgroup{Planning}{1}{1} \\
  \ganttbar{Write Wiki page}{1}{1} \\
  \ganttmilestone{Wiki page complete}{1} \\
  \ganttgroup{Coding}{2}{6} \\
  \ganttbar{Code new monitoring into the proxy}{2}{3} \\
  \ganttbar{Code new database changes}{4}{5} \\
  \ganttbar{Code new notifications{5}{6} \\
  \ganttmilestone{All new functionality complete}{6} \\
  \ganttgroup{Testing and Deployment}{6}{7} \\
  \ganttbar{Write tests}{6}{7} \\
  \ganttbar{Deploy system}{7}{7} \\
  \ganttmilestone{Complete system up and running}{7}
\end{ganttchart}

If I comment out the \gantttitle, it just gives me an error on \ganttitlelist. I included the \usepackage{pgfgantt} at the beginning.

Any ideas?

share|improve this question
add comment

1 Answer

up vote 7 down vote accepted

You need to wrap the ganttchart environment inside a tikzpicture environment:

enter image description here

\documentclass{article}
\usepackage{pgfgantt}% http://ctan.org/pkg/pgfgantt
\begin{document}
\begin{tikzpicture}
  \begin{ganttchart}{7}
    \gantttitle{2012}{7} \\ 
    \gantttitlelist{1,...,7}{1} \\
    \ganttgroup{Planning}{1}{1} \\
    \ganttbar{Write Wiki page}{1}{1} \\
    \ganttmilestone{Wiki page complete}{1} \\
    \ganttgroup{Coding}{2}{6} \\
    \ganttbar{Code new monitoring into the proxy}{2}{3} \\
    \ganttbar{Code new database changes}{4}{5} \\
    \ganttbar{Code new notifications}{5}{6} \\
    \ganttmilestone{All new functionality complete}{6} \\
    \ganttgroup{Testing and Deployment}{6}{7} \\
    \ganttbar{Write tests}{6}{7} \\
    \ganttbar{Deploy system}{7}{7} \\
    \ganttmilestone{Complete system up and running}{7}
  \end{ganttchart}
\end{tikzpicture}
\end{document}

Edit: v2.1 (or newer) of pgfgantt does not require embedding inside a tikzpicture environment.

share|improve this answer
    
Perfect! Thanks for your help! I wish the documentation made that clearer. Or, more likely, I need to read it more carefully :) –  xxpor Nov 21 '11 at 4:43
    
@Jake: You are correct - I had v2.0 installed on my machine, but updated it this morning. Seems like v2.1 is fresh out of the oven. –  Werner Nov 21 '11 at 17:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.