我想创建一个“命令”来为我完成这项工作:
\cventry{jobtitle}{organisation}{date}{description}{bulletpoint...}
例如:
\cventry{Potato peeler}{TESCO}{1999 -- to date}{
Responsible for the peeling of all potatoes}{
Sped-up potato peeling by 15 percent}{
Increased potatoes' smoothness by 20 percent as measured by 2004 customer survey}
得到:
\textbf{Potato peeler} \hfill 1999 -- to date \\
TESCO \\
Responsible for the peeling of all potatoes \\
\begin{list2}
\item Sped-up potato peeling by 15 percent
\item Increased potatoes' smoothness by 20 percent as measured by 2004 customer survey
\end{list2}
注意varargs
{bulletpoints...}“参数”的性质,我的意思是“命令”可以只接受一个参数、两个参数、n
参数,并且仍然按照预期工作。
请提供一个代码示例。
可选:在您的代码中,如果可以在 TeX/LaTeX 中使用(我不知道),允许创建一个“简历条目”数据结构来保存与单个“简历条目”有关的所有数据(标题、日期、项目符号数组,...)和此类对象的“数组”/“列表”,以便后者可以传递给“布局简历条目”函数,该函数将依次对每个“简历条目”进行排版,然后根据上述规范布局“简历条目”。
非常感谢您的帮助,我想我将从这个答案中学到很多东西,因此我提前感谢您的意见。
答案1
为了完成这项任务,一个新的环境似乎更好:
\documentclass{article}
\pagestyle{empty}
\usepackage{enumitem}
\setlist{noitemsep}
\newenvironment{cventry}[4]{%
\textbf{#1}\hfill#3\par#2\par#4\par%
\begin{itemize}% or other customized list environment
}{\end{itemize}}
\begin{document}
\begin{cventry}{Potato peeler}{TESCO}{1999 -- to date}%
{Responsible for the peeling of all potatoes}
\item Sped-up potato peeling by 15 percent
\item Increased potatoes' smoothness by 20 percent as measured by 2004
customer survey
\end{cventry}
\end{document}