在時間表上新增額外字段

在時間表上新增額外字段

我需要在我的時間表中提及每個步驟的輸入和輸出工作產品。

目前的模板為我提供了這樣的內容:

在此輸入影像描述

我需要在任務之前和之後有一些額外的欄位來新增輸入和輸出工作產品,如下所示:

在此輸入影像描述

這是對應的MWE

\documentclass[•]{article}

\usepackage{amsfonts}
\usepackage{booktabs}
\usepackage{amsmath}
\usepackage{indentfirst}
\usepackage{mathtools}
\usepackage{siunitx}
\usepackage[doublespacing]{setspace}
\usepackage{fourier}
\usepackage{sectsty}
\allsectionsfont{\centering \normalfont\scshape}
\usepackage
[
        letterpaper,% other options: a3paper, a5paper, etc
        left=2cm,
        right=2cm,
        top=3cm,
        bottom=4cm,
        vmargin=2cm,
        % use vmargin=2cm to make vertical margins equal to 2cm.
        % us  hmargin=3cm to make horizontal margins equal to 3cm.
        % use margin=3cm to make all margins  equal to 3cm.
]
{geometry}
%for timetable
\usepackage{xcolor}
\newcommand\ytl[2]{
    \parbox[b]{8em}{\hfill{\color{cyan}\bfseries\sffamily #1}~$\cdots\cdots$~}\makebox[0pt][c]{$\bullet$}\vrule\quad \parbox[c]{7.5cm}{\vspace{7pt}\color{red!40!black!80}\raggedright\sffamily #2.\\[7pt]}\\[-3pt]}
%

\begin{document}

\begin{table}
    \caption{My timetable}
    \centering
    \begin{minipage}[t]{.7\linewidth}
        \color{gray}
        \rule{\linewidth}{1pt}
        \ytl{1947}{Composing the thesis draft}
        \ytl{1968}{Reviewing the thesis draft by the supervisor}
        \ytl{1971}{Analyzing and applying the supervisor's comments}
        \ytl{1973}{Sending the thesis to the referees}
        \ytl{1978}{Preparing presentation slides}
        \ytl{1968}{Reviewing the presentation slides by the supervisor}
        \ytl{1971}{Analyzing and applying the supervisor's comments}
        \ytl{1981}{Defense}
        \bigskip
        \rule{\linewidth}{1pt}%
    \end{minipage}%
\end{table}

\end{document}

如何編輯\ytl命令以反映所需的格式?

答案1

\documentclass{article}

\usepackage{amsfonts}
\usepackage{booktabs}
\usepackage{amsmath}
\usepackage{indentfirst}
\usepackage{mathtools}
\usepackage{siunitx}
\usepackage[doublespacing]{setspace}
\usepackage{fourier}
\usepackage{sectsty}
\allsectionsfont{\centering \normalfont\scshape}
\usepackage
[
        letterpaper,% other options: a3paper, a5paper, etc
        left=2cm,
        right=2cm,
        top=3cm,
        bottom=4cm,
        vmargin=2cm,
        % use vmargin=2cm to make vertical margins equal to 2cm.
        % us  hmargin=3cm to make horizontal margins equal to 3cm.
        % use margin=3cm to make all margins  equal to 3cm.
]
{geometry}
%for timetable
\usepackage{xcolor}
\newcommand{\ytlformat}{\color{red!40!black!80}\sffamily}
\newcommand\ytl[4]{%
    \color{cyan}\bfseries\sffamily #1%
    & \ytlformat #2
    & \ytlformat #3
    & \ytlformat #4
    \\[7pt]
}
%

\begin{document}

\begin{table}
    \centering
    \caption{My timetable}
    \smallskip
    \begin{tabular}{l !{~$\cdots\cdots$~\makebox[0pt][l]{$\bullet$}}| lll}%
        \toprule
        \multicolumn{1}{l}{} & \ytlformat input & \ytlformat task & \ytlformat output \\
        \midrule
        \addlinespace[0pt]%
        \rule{0pt}{1.8em}%
        \ytl{1947}{draft}{revery}{comments}
        \ytl{1948}{draft}{revery}{comments}
        \ytl{1949}{draft}{revery}{comments}
        \ytl{1950}{draft}{revery}{comments}
        \addlinespace[0pt]%
        \bottomrule
    \end{tabular}%
\end{table}

\end{document}

螢幕截圖

“此外,\addlinespace如果您想控制要插入的確切空間量,可以在規則之前、之後或之間使用。” (書籤文檔第 5 頁) \addlinespace[0pt]對於避免規則之間的差距是必要的。

相關內容