4

I tried the example given here.

\documentclass{article}
\usepackage{pgfgantt}

\begin{document}

\begin{figure}[ftbp] \begin{center}

\begin{ganttchart}[y unit title=0.4cm, y unit chart=0.5cm, vgrid,hgrid, title label anchor/.style={below=-1.6ex}, title left shift=.05, title right shift=-.05, title height=1, bar/.style={fill=gray!50}, incomplete/.style={fill=white}, progress label text={}, bar height=0.7, group right shift=0, group top shift=.6, group height=.3, group peaks={}{}{.2}]{24} %labels \gantttitle{Week}{24} \ \gantttitle{Monday}{4} \gantttitle{Tuesday}{4} \gantttitle{Wednesday}{4} \gantttitle{Thursday}{4} \gantttitle{Friday}{4} \gantttitle{Saturday}{4} \ %tasks \ganttbar{first task}{1}{2} \ \ganttbar{task 2}{3}{8} \ \ganttbar{task 3}{9}{10} \ \ganttbar{task 4}{11}{15} \ \ganttbar[progress=33]{task 5}{20}{22} \ \ganttbar{task 6}{18}{19} \ \ganttbar{task 7}{16}{18} \ \ganttbar[progress=0]{task 8}{21}{24}

%relations \ganttlink{elem0}{elem1} \ganttlink{elem0}{elem3} \ganttlink{elem1}{elem2} \ganttlink{elem3}{elem4} \ganttlink{elem1}{elem5} \ganttlink{elem3}{elem5} \ganttlink{elem2}{elem6} \ganttlink{elem3}{elem6} \ganttlink{elem5}{elem7} \end{ganttchart} \end{center} \caption{Gantt Chart} \end{figure}

\end{document}

I probably forgot to install a package but Tex Live shows that pgfgantt is installed. I get a lot of errors. The first two are:

! LaTeX Error: Unknown float option `f'.
! Package pgfkeys Error: I do not know the key '/pgfgantt/group peaks', to whic h you passed '{}{}{.2}', and I am going to ignore it. Perhaps you misspelled it . See the pgfkeys package documentation for explanation. Type H <return> for immediate help.... \gantttitle

Could you help me? Thanks in advance.

Dunno
  • 329

1 Answers1

9
  • There is no option f for the environment float, remove it.

  • The example you are trying uses an old version of pgfgantt. For the current version, 5.0, you have to change three things.

    • Remove group peaks={}{}{.2} from the options of ganttchart.
    • Replace the parameter {24} of the ganttchart environment by {1}{24}.
    • The key incomplete changed to bar incomplete. In the example below, I removed the key, as the current default settings might be anyway what you want.

enter image description here

\documentclass{article}
\usepackage{pgfgantt}

\begin{document}

\begin{figure}[tbp] \begin{center} \begin{ganttchart}[ y unit title=0.4cm, y unit chart=0.5cm, vgrid, hgrid, title label anchor/.style={below=-1.6ex}, title left shift=.05, title right shift=-.05, title height=1, progress label text={}, bar height=0.7, group right shift=0, group top shift=.6, group height=.3 ]{1}{24}

  % labels
  \gantttitle{Week}{24} \\
  \gantttitle{Monday}{4}
  \gantttitle{Tuesday}{4}
  \gantttitle{Wednesday}{4}
  \gantttitle{Thursday}{4} 
  \gantttitle{Friday}{4} 
  \gantttitle{Saturday}{4} \\

  % tasks
  \ganttbar{first task}{1}{2} \\
  \ganttbar{task 2}{3}{8} \\
  \ganttbar{task 3}{9}{10} \\
  \ganttbar{task 4}{11}{15} \\
  \ganttbar[progress=33]{task 5}{20}{22} \\
  \ganttbar{task 6}{18}{19} \\
  \ganttbar{task 7}{16}{18} \\
  \ganttbar[progress=0]{task 8}{21}{24}

  % relations 
  \ganttlink{elem0}{elem1} 
  \ganttlink{elem0}{elem3} 
  \ganttlink{elem1}{elem2} 
  \ganttlink{elem3}{elem4} 
  \ganttlink{elem1}{elem5} 
  \ganttlink{elem3}{elem5} 
  \ganttlink{elem2}{elem6} 
  \ganttlink{elem3}{elem6} 
  \ganttlink{elem5}{elem7} 
\end{ganttchart}

\end{center} \caption{Gantt Chart} \end{figure}

\end{document}

gernot
  • 49,614