部分 LaTeX 考试类文档无法使用

部分 LaTeX 考试类文档无法使用

下面的代码通过在左侧的每一页上打印“第 x 页,共 y 页”,然后转到右侧的下一页(或最后一页的考试结束)。我无法让它做的是将问题 xx 继续写为中央页脚。由于我无法粘贴此代码作为对我之前帖子的评论/建议的回复为什么这个 ifincomplete latex 代码不起作用,这是该帖子的重复。

\documentclass[addpoints,10pt,fleqn]{exam}
\RequirePackage{amssymb, amsfonts, amsmath, latexsym, verbatim, xspace, setspace}
\usepackage{setspace}% http://ctan.org/pkg/setspace
\RequirePackage{tikz, pgflibraryplotmarks}
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\usepackage[margin=1in]{geometry}
\usepackage{enumerate,mdwlist}
\usepackage{mathtools}  % for 'bmatrix*' environment
\usepackage{paralist}   % for 'inparaenum' environment\newcommand{\dist}{\displaystyle}
\usepackage{enumitem}
\usepackage[normalem]{ulem}
\usepackage{geometry}
\geometry{
a4paper, total={210mm,297mm}, left=20mm, right=15mm, top=20mm, bottom=15mm,}
\singlespacing
\pagestyle{headandfoot}
\runningheadrule
\runningheader{Linear Algebra-MAT 2200}
{Tutorial shhet 7, Page \thepage\ of \numpages} {June, 2015}

\begin{document}
\raggedright
\begin{center}
\bf{Linear Algebra}
\end{center}
Handout 2 \hfill{May, 2015}\\
\flushright Tutorial Sheet 7
\noindent\makebox[\linewidth]{\rule{\textwidth}{1pt}}
\pagestyle{headandfoot}
\footrule
\lfoot{\footnotesize Page \thepage\ of \numpages}
\cfoot{\newcommand{\continues}{\ifincomplete
{\footnotesize Question \IncompleteQuestion\ continues \hfill Please go to next page\ldots}{}}} \rfoot{\iflastpage{End of Tutorial Sheet 7.}{\footnotesize Please go to next page\ldots}}
\begin{questions}
\begingroup\onehalfspacing
\question
Given the vectors \\
\begin{inparaenum}[a)]
\item
(2, -1, 1) and (1, 2, 1) \\
\item
(2, 1, -3) and (1, 1, 1) \\
\item
(2, -1, 2) and (1, -1, 2) \\
\end{inparaenum}
\break

Find \\
\begin{inparaenum}[i)]
\item
Which of the pairs of vectors are perpendicular \\
\item
A vector perpendicular to both of the given vectors \\
\end{inparaenum}
\endgroup
\end{questions}
\end{document}

答案1

您的代码中有 3 个小错误,并且恰好在

\cfoot{\newcommand{\continues}{\ifincomplete{\footnotesize Question \IncompleteQuestion\ continues \hfill Please go to next page\ldots}{}}}

你需要的是

\cfoot{\newcommand{\continues}{\ifincomplete{\footnotesize Question \IncompleteQuestion\ continues}{}}\continues}

或者简单地

\cfoot{\ifincomplete{\footnotesize Question \IncompleteQuestion\ continues}{}}

相关内容