从乳胶代码打印pdf

从乳胶代码打印pdf

我试图打印以下代码 20 次而不必复制 20 次,因为它是一个随机数生成器,并且我希望每张表都不同,所以我遇到了麻烦。

\documentclass{article}
%AdditionCode
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{enumitem}
\usepackage{tikz}
\usepackage{xlop}
\usepackage{pstricks}
% \usepackage{showframe}

\usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{~\\56 Problem Practice Worksheet}
\rhead{Name: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ \\}
\lfoot{Number Correct: ~ \Large $\dfrac{~}{20}$}
\cfoot{~}


\newcommand*{\DifficultyOne}{999}%
\newcommand*{\DifficultyTwo}{99}%
%---------------------------------------%
\newcommand{\AddQuestion}[1]{%
    \foreach \i in {1,...,#1}{%

       \pgfmathtruncatemacro{\AddOnea}{random(\DifficultyOne)}%
       \pgfmathtruncatemacro{\AddTwoa}{random(\DifficultyTwo)}
       \pgfmathtruncatemacro{\AddOneb}{random(\DifficultyOne)}%
       \pgfmathtruncatemacro{\AddTwob}{random(\DifficultyTwo)}
       \pgfmathtruncatemacro{\AddOnec}{random(\DifficultyOne)}%
       \pgfmathtruncatemacro{\AddTwoc}{random(\DifficultyTwo)}
       \pgfmathtruncatemacro{\AddOned}{random(\DifficultyOne)}%
       \pgfmathtruncatemacro{\AddTwod}{random(\DifficultyTwo)}
       \pgfmathtruncatemacro{\AddOnee}{random(\DifficultyOne)}%
       \pgfmathtruncatemacro{\AddTwoe}{random(\DifficultyTwo)}
       \pgfmathtruncatemacro{\AddOnef}{random(\DifficultyOne)}%
       \pgfmathtruncatemacro{\AddTwof}{random(\DifficultyTwo)}
       \pgfmathtruncatemacro{\AddOneg}{random(\DifficultyOne)}%
       \pgfmathtruncatemacro{\AddTwog}{random(\DifficultyTwo)}
       \pgfmathtruncatemacro{\AddOneh}{random(\DifficultyOne)}%
       \pgfmathtruncatemacro{\AddTwoh}{random(\DifficultyTwo)}
  
       \hspace*{\fill}
       \opsub[carryadd=true, voperator=bottom, resultstyle=\white]{\AddOnea}   {\AddTwoa} \hfill  \opsub[carryadd=true, voperator=bottom, resultstyle=\white]{\AddOneb}{\AddTwob} \hfill \opsub[carryadd=true, voperator=bottom, resultstyle=\white]{\AddOnec}{\AddTwoc} \hfill \opsub[carryadd=true, voperator=bottom, resultstyle=\white]{\AddOned}{\AddTwod} \hfill \opsub[carryadd=true, voperator=bottom, resultstyle=\white]{\AddOnee}{\AddTwoe} \hfill \opsub[carryadd=true, voperator=bottom, resultstyle=\white]{\AddOnef}{\AddTwof} \hfill \opsub[carryadd=true, voperator=bottom, resultstyle=\white]{\AddOneg}{\AddTwog} \hfill \opsub[carryadd=true, voperator=bottom, resultstyle=\white]{\AddOneh}{\AddTwoh}  \hspace*{\fill}\\
              ~\newline
         ~\newline

 }%
 }%

 \begin{document}



  \vspace{2cm}

  \AddQuestion{5}

  \end{document}

有人建议我使用 Zhs 和以下代码;

for i in {1..20}
do
   xelatex practiseworksheet.tex
   mv practiseworksheet.pdf worksheetcopy$i.pdf
done
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=exercise20.pdf      worksheetcopy*.pdf

但我无法让它工作,有人有什么想法吗?

很抱歉,这可能超出了我的能力范围,但当我尝试所有建议时,我只收到这个错误:在此处输入图片描述

相关内容