如果我在最后一行使用 \markthree,它总是会发出错误,见下文。错误是
! 缺失数字,视为零。{ l.60 }
这里应该有一个数字;我0'. (If you can't figure out why I needed to see a number, look up
在 TeXbook 索引中插入了“奇怪的错误”。)
! 非法计量单位(插入 pt)。{ l.60 }
{Personal Total $=$ Personal mark $+$ Group total mark \vskip1mm [20]} &\pgfmathparse{\markone+\groupmark}\pgfmathresult &\pgfmathparse{\marktwo+\groupmark}\pgfmathprint{\pgfmathresult} &\pgfmathparse{\groupmark+\markthree}\pgfmathprint{\pgfmathresult} \\[5mm]
如果我删除\markthree
此行,它就可以正常工作。我不明白问题是什么。是因为命令中使用的变量数量有限制吗\foreach
?
\documentclass[multi=true,tikz]{standalone}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{ctable}
\usepackage{array}
\usepackage{pgffor}
\usepackage{tikz}
\usetikzlibrary{shapes.arrows,chains,positioning,calc,}
%opening
\standaloneenv{tikzpicture, frame}
\date{}
\renewcommand{\arraystretch}{1.5}
\begin{document}
%\begin{tikzpicture}
% \node (1) {};
\foreach \groupnum/\grouptitle/\feedback/\groupmark/\pone/\markone/\ptwo/\marktwo/\pthree/\markthree in {
1/title1/
{feedbackone}
/{11}/name1/{5}/name2/{5}/name3/{4},
6/{}/{}/{0}/name1/{}/name2/{}/{}/{}
}{
% \node (\groupnum)[below=10 mm of current bounding box]{
\begin{tikzpicture}
\node (title) [below=10mm of current bounding box, text width = 18cm, align = flush center, font=\Large\bfseries]{marking proforma};
\node (table) [below=5mm of title, text width = 25cm]{
\begin{tabular}{|>{\centering}m{5cm} |m{6cm} |m{6cm} |m{6cm}|}
\toprule
\hline
Group Number: & \multicolumn{3}{c|}{\bfseries\groupnum}\\
\hline
Presentation title: & \multicolumn{3}{c|}{\large\textbf{\color{blue}\grouptitle}}\\
\hline
Feedback & \multicolumn{3}{p{18cm}|}{\feedback}\\[5cm]
\hline
Group Total [15]& \multicolumn{3}{c|}{\groupmark}\\[5mm]
\hline
Presenter & \multicolumn{1}{c|}{\bfseries\pone} & \multicolumn{1}{c|}{\bfseries\ptwo} & \multicolumn{1}{c|}{\bfseries\pthree} \\
\hline
Presenter personal mark ([5])&\multicolumn{1}{c|}{\markone} &\multicolumn{1}{c|}{\marktwo} & \multicolumn{1}{c|}{\markthree}\\[5mm]
\hline
{Personal Total $=$ Personal mark $+$ Group total mark \vskip1mm [20]} &\pgfmathparse{\markone+\groupmark}\pgfmathresult &\pgfmathparse{\marktwo+\groupmark}\pgfmathprint{\pgfmathresult} &\pgfmathparse{\groupmark+\markthree}\pgfmathprint{\pgfmathresult} \\[5mm]
\hline
\bottomrule
\end{tabular}};
\end{tikzpicture}
}
\end{document}
答案1
使用 10 个变量没有问题。问题在于\pgfmathparse{\groupmark+\markthree}
接收的{}
不是数字。
经过以下更改,您的代码就可以编译了:
\foreach \groupnum/\grouptitle/\feedback/\groupmark/\pone/\markone/\ptwo/\marktwo/\pthree/\markthree in {
1/title1/
{feedbackone}
/{11}/name1/{5}/name2/{5}/name3/{4},
6/{}/{}/{0}/name1/{}/name2/{}/{}/0 % <-- Notice change here
}{