我需要在时间表中提及每个步骤的投入和产出工作成果。
当前模板为我提供了类似这样的内容:
我需要在任务之前和之后添加一些额外的字段来添加输入和输出工作产品,如下所示:
对应的内容如下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
如果您想控制要插入的精确空间量,可以在规则之前、之后或之间使用。”(booktabs 文档第 5 页)
\addlinespace[0pt]
对于避免规则之间出现差距是必要的。