SOP 修订控制表

SOP 修订控制表

我正在使用基于“Book”类的自己的类。现在,我想创建一个用于修订记录的表。

我正在考虑这样的事情:

\revcont{}{}{}{}{}
\revcont{}{}{}{}{}

其中每个\revcont表示一行,每个{}表示一列。现在,我想添加代码来my.cls创建像附图这样的输出。 在此处输入图片描述

我在课程方面很差。我根据其他人的答案和教程制作自己的课程。

谢谢

答案1

如果您想事先做更多工作,并最终获得更灵活的系统,我会在这里使用键值系统。这具有以下优点:

a) 您稍后可以轻松地为不同的表或相同的表添加更多键,同时排除或添加您想要的特定表的列 b) 您可以进行各种计算、索引和其他操作。

下面是一个例子。我没有尝试完全复制您的表格,也没有尝试实现漂亮的表格布局。您需要自己研究一下才能弄清楚这对您有何用处,但这并不难。

最后两列是稍微复杂一些的示例,用于展示如何做更花哨的事情。倒数第二列展示了如何创建键的不同变体以转到不同的地方(在本例中是两个单独的变体,一个用于表格,另一个可用于其他地方,例如索引中)。最后一列展示了如何在表格打印时处理不同的值(在本例中,元素是标签,如果标签不存在,您可以将该列留空,如果标签存在,则可以打印参考和页面参考)

正如我所说,这只是一个模型,而不是对你具体练习的答案。

\documentclass[a4paper]{article}
\usepackage{xkeyval}
\usepackage{ifthen}%this is only optional used here to show how you could do an optional formatting

%cemtab in the below could be changed to anything you like for a particular key set, so can have several sets
\makeatletter
\define@key      [PRE] {cemtab}     {fname}  {\gdef\myfname{#1}}
\define@key      [PRE] {cemtab}     {sname}  {\gdef\mysname{#1}}
\define@key      [PRE] {cemtab}     {city}  {\gdef\mycity{#1}}
\define@key      [PRE] {cemtab}     {plot}  {\gdef\myplot{#1}\ifthenelse{\equal{\myplot}{}}{\gdef\myplotbr{}}{\gdef\myplotbr{ (plot #1)}}}%second macro with brackets as cannot have macros in index macro
\define@key      [PRE] {cemtab}     {figref}  {\gdef\myfigref{#1}}

\presetkeys         [PRE] {cemtab} {fname =,
    sname =,
    city =,
    plot =,
    figref =,}{}%

\makeatother

 \newcommand{\personage}[1]{%
\setkeys[PRE]{cemtab}{#1}%
 \mysname & \myfname & \mycity & \myplot & \ifthenelse{\equal{\myfigref}{}}{}{\ref{\myfigref} \pageref{\myfigref}}\\
}%

\begin{document}

\begin{tabular}{lllll}
\personage{sname=Smith,fname=Reuben,city=York,plot=213,figref=}
\personage{sname=Jones,fname=Peter,city=Norwich,plot=213,figref=}
\personage{sname=Steele,fname=Reuben,city={example, with comma},plot=213,figref=}
%\personage{sname=Steele,fname=Reuben,city=London,plot=213,figref=afiglabel}
\end{tabular}

\end{document}

相关内容