如何增加甘特图组和任务之间的空间(pgfgantt 包)

如何增加甘特图组和任务之间的空间(pgfgantt 包)

我正在输入这个甘特图(代码如下),但我不知道如何增加“WP 1”和“任务 1.1”之间的间距(请参阅附图)。我该怎么做?谢谢!

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[margin=2cm]{geometry}
\usepackage{times}
\usepackage{xcolor}
\usepackage{pgfgantt}

\begin{document}

\renewcommand\sfdefault{phv}
\renewcommand\mddefault{mc}
\renewcommand\bfdefault{bc}
\setganttlinklabel{s-s}{START-TO-START}
\setganttlinklabel{f-s}{FINISH-TO-START}
\setganttlinklabel{f-f}{FINISH-TO-FINISH}
\sffamily
\begin{ganttchart}[
    canvas/.append style={fill=none, draw=black!5, line width=.75pt},
    hgrid style/.style={draw=black!5, line width=.75pt},
    vgrid={*1{draw=black!5, line width=.75pt}},
    today=none,
    today rule/.style={
      draw=black!64,
      dash pattern=on 3.5pt off 2.5pt,
      line width=1.5pt
    },
    today label font=\small\bfseries,
    title/.style={draw=none, fill=none},
    title label font=\bfseries\footnotesize,
    title label node/.append style={below=7pt},
    include title in canvas=false,
    bar label font=\mdseries\small\color{black!70},
    bar label node/.append style={left=0cm,align=left,text width=20em},
    bar/.append style={draw=none, fill=black!63},
    bar incomplete/.append style={fill=blue!50},
    bar progress label font=\mdseries\footnotesize\color{black!70},
    group incomplete/.append style={fill=blue},
    group left shift=0,
    group right shift=0,
    group height=.3,
    group peaks tip position=0,
    group label node/.append style={align=left, left=-.5cm, text width=22.5em},
    group progress label font=\bfseries\small,
    link/.style={-latex, line width=1.5pt, red},
    link label font=\scriptsize\bfseries,
    link label node/.append style={below top=2pt and 0pt},
    y unit chart=0.5cm
  ]{1}{13}
  \ganttset{bar height=0.25}
  \gantttitle[
    title label node/.append style={below left=7pt and -2pt}
  ]{MONTHS:\quad1}{1}
  \gantttitlelist{2,4,8,12,16,18,20,24,28,30,32}{1} \\
  \ganttgroup[]{WP 1: Planning}{1}{9} \\
  \ganttbar[]{\textbf{Task 1.1} Task prioritization}{1}{5} \\
  \ganttbar[]{\textbf{Task 1.2} Gantt charts creation}{4}{9} \\
  \ganttgroup[]{Execution}{3}{10} \\
  \ganttbar[]{\textbf{Task 2.1} Synthesis and characterization}{3}{9} \\
  \ganttbar[]{\textbf{Task 2.2} Data Analysis}{4}{10} \\
  \ganttbar[]{\textbf{Task 2.3} Imaging Errors}{5}{10} \\
  \ganttgroup[]{WP3 Conclusion}{4}{12} \\
  \ganttbar[]{\textbf{Task 3.1}  Storytelling of the results}{4}{9} \\
  \ganttbar[]{\textbf{Task 3.2} Presenting}{7}{12}
\end{ganttchart}

\end{document}

打印

答案1

\\或许可以根据需要添加一些额外内容。

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[margin=2cm]{geometry}
\usepackage{times}
\usepackage{xcolor}
\usepackage{pgfgantt}

\begin{document}

\renewcommand\sfdefault{phv}
\renewcommand\mddefault{mc}
\renewcommand\bfdefault{bc}
\setganttlinklabel{s-s}{START-TO-START}
\setganttlinklabel{f-s}{FINISH-TO-START}
\setganttlinklabel{f-f}{FINISH-TO-FINISH}
\sffamily
\begin{ganttchart}[
    canvas/.append style={fill=none, draw=black!5, line width=.75pt},
    hgrid style/.style={draw=black!5, line width=.75pt},
    vgrid={*1{draw=black!5, line width=.75pt}},
    today=none,
    today rule/.style={
      draw=black!64,
      dash pattern=on 3.5pt off 2.5pt,
      line width=1.5pt
    },
    today label font=\small\bfseries,
    title/.style={draw=none, fill=none},
    title label font=\bfseries\footnotesize,
    title label node/.append style={below=7pt},
    include title in canvas=false,
    bar label font=\mdseries\small\color{black!70},
    bar label node/.append style={left=0cm,align=left,text width=20em},
    bar/.append style={draw=none, fill=black!63},
    bar incomplete/.append style={fill=blue!50},
    bar progress label font=\mdseries\footnotesize\color{black!70},
    group incomplete/.append style={fill=blue},
    group left shift=0,
    group right shift=0,
    group height=.3,
    group peaks tip position=0,
    group label node/.append style={align=left, left=-.5cm, text width=22.5em},
    group progress label font=\bfseries\small,
    link/.style={-latex, line width=1.5pt, red},
    link label font=\scriptsize\bfseries,
    link label node/.append style={below top=2pt and 0pt},
    y unit chart=0.5cm
  ]{1}{13}
  \ganttset{bar height=0.25}
  \gantttitle[
    title label node/.append style={below left=7pt and -2pt}
  ]{MONTHS:\quad1}{1}
  \gantttitlelist{2,4,8,12,16,18,20,24,28,30,32}{1} \\
  \ganttgroup[]{WP 1: Planning}{1}{9} \\ \\
  \ganttbar[]{\textbf{Task 1.1} Task prioritization}{1}{5} \\
  \ganttbar[]{\textbf{Task 1.2} Gantt charts creation}{4}{9} \\
  \ganttgroup[]{Execution}{3}{10} \\ \\
  \ganttbar[]{\textbf{Task 2.1} Synthesis and characterization}{3}{9} \\
  \ganttbar[]{\textbf{Task 2.2} Data Analysis}{4}{10} \\
  \ganttbar[]{\textbf{Task 2.3} Imaging Errors}{5}{10} \\
  \ganttgroup[]{WP3 Conclusion}{4}{12} \\ \\
  \ganttbar[]{\textbf{Task 3.1}  Storytelling of the results}{4}{9} \\
  \ganttbar[]{\textbf{Task 3.2} Presenting}{7}{12}
\end{ganttchart}

\end{document}

在此处输入图片描述

相关内容