文章目录
所需软件
安装VSCode,官方下载链接
配置LaTex
参考如下链接,VSCode配置LaTex
代码
%用XeLaTex编译
\documentclass[11pt]{ctexart}
\usepackage{amsmath,geometry,paralist,lastpage,graphicx,fancyhdr}
\geometry{a4paper, left=1.5cm, right=1.5cm, top=1.75cm, bottom=1.5cm, nohead}
\usepackage{lineno,indentfirst}
\usepackage{tikz,array,forloop}
\newcounter{x}
\newcounter{y}
\begin{document}
\begin{center}
{\songti\zihao{2}\textbf{乘法练习题}}\\
\vspace{2em}
{\songti\zihao{5}学号\underline{\hspace{9.2em}}~姓名\underline{\hspace{9.2em}}~日期\underline{\hspace{9.2em}}}\\
\vspace{2em}
\end{center}
\vspace{1em}
\begin{tabular}{ p{3.5cm} p{3.5cm} p{3.5cm} p{3.5cm}}
\forloop{y}{0}{\value{y} < 17}{
\forloop{x}{0}{\value{x} < 4}{ % generates the header row of the table
$
\pgfmathrandominteger{\numberOne}{10}{100} %随机生成10-100的数字
\pgfmathrandominteger{\numberTwo}{2}{9} %随机生成2-9的数字
\numberOne
\pgfmathparse{ifthenelse(\numberOne<\numberTwo, "+", "-")}\pgfmathresult %符号
\numberTwo
=
$ \par
\ifthenelse{\value{x}<3}{&}{}
% one less '&' than the number of columns
}\\
}
\end{tabular}
\end{document}
点击构建项目即可生成pdf文件,修改相应注释行的代码几个生成各种要求的计算题,Latex也可以生成更加专业复杂的数学公式,因此用来出题再合适不过了。