我希望年份只出现一次,而不是重复写年份

我希望年份只出现一次,而不是重复写年份

我不能直接删除年份部分,想知道如何调整它,因为它只显示一次年份。

%% Code by Claudio:
%% https://tex.stackexchange.com/a/197447/221452
%% Uses code by Andrew:
%% http://tex.stackexchange.com/a/28452/13304
\makeatletter
    \let\matamp=&
    \catcode`\&=13
    \def&{%
        \iftikz@is@matrix%
            \pgfmatrixnextcell%
        \else%
            \matamp%
        \fi%
    }
\makeatother

\newcounter{lines}
\def\endlr{\stepcounter{lines}\\}

\newcounter{vtml}
\setcounter{vtml}{0}

\newif\ifvtimelinetitle
\newif\ifvtimebottomline

\tikzset{
    description/.style={column 2/.append style={#1}},
    timeline color/.store in=\vtmlcolor,
    timeline color=red!80!black,
    timeline color st/.style={fill=\vtmlcolor,draw=\vtmlcolor},
    use timeline header/.is if=vtimelinetitle,
    use timeline header=false,
    add bottom line/.is if=vtimebottomline,
    add bottom line=false,
    timeline title/.store in=\vtimelinetitle,
    timeline title={},
    line offset/.store in=\lineoffset,
    line offset=4pt,
}

\NewEnviron{vtimeline}[1][]{%
    \setcounter{lines}{1}%
    \stepcounter{vtml}%
    \begin{tikzpicture}[column 1/.style={anchor=east},
        column 2/.style={anchor=west},
        text depth=0pt,text height=1ex,
        row sep=1ex,
        column sep=1em,
        #1
    ]
        \matrix(vtimeline\thevtml)[matrix of nodes]{\BODY};
        \pgfmathtruncatemacro\endmtx{\thelines-1}

        \path[timeline color st]
            ($(vtimeline\thevtml-1-1.north east)!0.5!(vtimeline\thevtml-1-2.north west)$)--
            ($(vtimeline\thevtml-\endmtx-1.south east)!0.5!(vtimeline\thevtml-\endmtx-2.south west)$);

        \foreach \x in {1,...,\endmtx}{
            \node[circle,timeline color st, inner sep=0.15pt, draw=white, thick]
            (vtimeline\thevtml-c-\x) at
            ($(vtimeline\thevtml-\x-1.east)!0.5!(vtimeline\thevtml-\x-2.west)$){};
                \draw[timeline color st](vtimeline\thevtml-c-\x.west)--++(-3pt,0);
        }

        \ifvtimelinetitle%
            \draw[timeline color st]([yshift=\lineoffset]vtimeline\thevtml.north west)--
                ([yshift=\lineoffset]vtimeline\thevtml.north east);

            \node[anchor=west,yshift=16pt,font=\large]
                at (vtimeline\thevtml-1-1.north west)
                {\textsc{Timeline \thevtml}: \textit{\vtimelinetitle}};
        \else%
            \relax%
        \fi%

        \ifvtimebottomline%
            \draw[timeline color st]([yshift=-\lineoffset]vtimeline\thevtml.south west)--
            ([yshift=-\lineoffset]vtimeline\thevtml.south east);
        \else%
            \relax%
        \fi%
    \end{tikzpicture}
}


\begin{vtimeline}[timeline color=darkerblue, line offset=2pt]
    2016 & Hate speech detection using AI begins\endlr
    2017 & Convolutional neural network for document classification. \endlr
    2017 & Transformer Paper published. \endlr
    2017 & Bi-Transformer paper published.\endlr
    2018 & Scaling NLP across many languages.\endlr
    2018 & Understanding text in images/videos with ML.\endlr
    2018 &  CV tools for objectionable content detection.\endlr
    2019 & XLM for pre-training cross-lingual models.  \endlr
    2019 &Self-Supervision improves Hate Speech detection. \endlr
    2019 &Improvements in image post classifications. \endlr
    2019 &Whole entity understanding.\endlr
    2019 &Bi-Transformer in hate speech detection. \endlr
    2019 &XLM in hate speech review.\endlr
    2020 & Self-supervision enhances hate speech detection. \endlr
    2020 & Classification improvements for image posts. \endlr
    2020 & Whole entity: More robust image understanding. \endlr
    2020 & Whole entity: Weak-supervision. \endlr
    2020 & RIO: reinforcement-learning optimization. \endlr
    2020 & Linformer: Efficient text encoder.\endlr
\end{vtimeline}

相关内容