Latex 中的工作平面(表格)

Latex 中的工作平面(表格)

我想定义一个3年学习计划,但它只显示1年在pdf中,以下代码错误在哪里:

\documentclass{article}       
\usepackage{etoolbox}
\usepackage{parskip}
\usepackage{tikz}
\usepackage{pgfgantt}
\usepackage{ifthen}
\newcounter{myWeekNum}
\stepcounter{myWeekNum}

\begin{document}
    \newcommand{\myWeek}{\themyWeekNum
        \stepcounter{myWeekNum}
        \ifnum\themyWeekNum=53
        \setcounter{myWeekNum}{2}
        \else\fi
    }
    %
    %%% Begin document

        \setcounter{myWeekNum}{1}
        \ganttset{%
            calendar week text={\myWeek{}}%
        }
        %
        \begin{figure}[h!bt]
            \begin{center}
                \begin{ganttchart}[
                    vgrid={*{6}{draw=none}, dotted},
                    x unit=.08cm,
                    y unit title=.6cm,
                    y unit chart=.6cm,
                    time slot format=isodate,
                    time slot format/start date=2019-6-01]{2021-12-01}{2022-04-30}
                    \ganttset{bar height=1.6}
                    \gantttitlecalendar{year, month=name} \\
                    \ganttbar[bar/.append style={fill=blue}]{Task 1}{2019-6-01}{2021-12-01}\\
                    \ganttbar[bar/.append style={fill=blue}]{Task 2}{2019-6-01}{2021-12-01}\\
                    \ganttbar[bar/.append style={fill=blue}]{Task 3}{2019-6-01}{2021-12-01}\\
                    \ganttbar[bar/.append style={fill=red}]{Task 4}{2021-12-01}{2022-04-19}
                \end{ganttchart}
            \end{center}
                \caption{Time Plan}
            \end{figure}
    \end{document}

提前致谢。

相关内容