Заслуженный участник |
|
31/01/14 11316 Hogtown
|
Последний раз редактировалось Red_Herring 22.04.2019, 03:04, всего редактировалось 1 раз.
Тогда я переписал код так что сначала он берет из pdf, который получен с сервера, буклет 1, и пишет в него вариант A, потом буклет 21, и пишет в него вариант B, потом 41 (C), 61 (D) и 81 (E), потом буклет 2 и пишет в него вариант A, и так по кругу. Тогда в pdf файле идут A,B,C,D,E,A,B, ... а вот сервер сортирует A,A,,.....,A, B,....,B, C,...,C, D,...,D, E,...,E. Вот pdf file, который Crowdmark Server сделал для нас, а внизу LaTeX file. Большую часть его занимают определение 5 вариантов problem, booklet (который включает в себя problem), bookletset (5 последовательных буклетов), а исполнение это просто линия, начинающаяся с \forloop, и затем переопределения этих штук для второй секции и опять исполнение. Маленький красный номер (реально ненужный, здесь просто для демонстрации) нумерует буклеты в пдф файле на выходе, и соответственно в той пачке, которую мы получаем от PrintShop, а большой черный номер это номера буклетов в Crowdmark, который и определяет в каком порядке их проверяют (по умолчанию). Естественно, что пдф файл dummy-Q7.pdf должен быть в той же директории. пакет forloop определяет соответствующую команду, пакет ifthen команду ifthenelse, ну а intcalc целочисленную арифметику.
\documentclass[14pt, oneside]{memoir}
\usepackage{ifthen}
\usepackage{intcalc}
\usepackage{forloop}
\usepackage{array}
\extrarowheight=5pt
\usepackage{mathtools}
\usepackage{amssymb, amsthm}
%\usepackage{tikz}
%\usetikzlibrary{patterns}
\usepackage[absolute,overlay]{textpos}
\usepackage{pdfpages}
\usepackage{enumitem}
\usepackage[textwidth=.75in]{todonotes}
\textheight=9.5in
\voffset=-20pt
\parindent=0pt
\theoremstyle{definition}
\newtheorem*{problem}{Problem}
\newcounter{problem}
\pagestyle{empty}
\newcounter{BookletSetNumber}
\newcounter{ProblemVersion}
\newcounter{BookletNumber}
\newcounter{CMBookletNumber}
\newcounter{CMBpage}
\newcommand{\lec}{LEC 0101}
\newcommand{\problemOneAX}{\begin{problem}[3pt]
Suppose that $u$ is a harmonic function on the open unit disc $\mathbb{D}=\{(x,y)\colon x^2+y^2 <1\}\subset\mathbb{R}^2$ which is continuous on the closed unit disc $\overline{\mathbb{D}}=\{(x,y)\colon x^2+y^2 \le 1\}$ and is equal to
\begin{equation*} g(\theta) = \theta(2\pi-\theta),
\quad 0\le \theta \le 2\pi, \end{equation*}
on the boundary unit circle $S^1=\{(x,y)\colon x^2+y^2 = 1\}$.
\begin{enumerate}[label=(\alph*)]
\item Determine the maximum value that $u$ takes on the closed disc $\overline{\mathbb{D}}$.
\item Determine $u(0)$.
\end{enumerate}
\end{problem}}
\newcommand{\problemOneBX}{\begin{problem}[3pt]
Suppose that $u$ is a harmonic function on the open unit disc $\mathbb{D}=\{(x,y)\colon x^2+y^2 <1\}\subset\mathbb{R}^2$ which is continuous on the closed unit disc $\overline{\mathbb{D}}=\{(x,y)\colon x^2+y^2 \le 1\}$ and is equal to
\begin{equation*} g(\theta) = \theta^4, \quad -\pi\le \theta\le \pi, \end{equation*}
on the boundary unit circle $S^1=\{(x,y)\colon x^2+y^2 = 1\}$.
\begin{enumerate}[label=(\alph*)]
\item Determine the maximum value that $u$ takes on the closed disc $\overline{\mathbb{D}}$.
\item Determine $u(0)$.
\end{enumerate}
\end{problem}}
\newcommand{\problemOneCX}{\begin{problem}[3pt]
Suppose that $u$ is a harmonic function on the open unit disc $\mathbb{D}=\{(x,y)\colon x^2+y^2 <1\}\subset\mathbb{R}^2$ which is continuous on the closed unit disc $\overline{\mathbb{D}}=\{(x,y)\colon x^2+y^2 \le 1\}$ and is equal to
\begin{equation*} g(\theta) = \left\{
\begin{aligned}
&\cos(\theta), && |\theta|\le \frac{\pi}{4}, \\
&\frac{1}{\sqrt{2}},
&& \theta\in\bigl[-\pi,-\frac{\pi}{4}\bigr)\cup\bigl(\frac{\pi}{4},\pi\bigr],
\end{aligned}
\right. \end{equation*}
on the boundary unit circle $S^1=\{(x,y)\colon x^2+y^2 = 1\}$.
\begin{enumerate}[label=(\alph*)]
\item Determine the maximum value that $u$ takes on the closed disc $\overline{\mathbb{D}}$.
\item Determine $u(0)$.
\end{enumerate}
\end{problem}}
\newcommand{\problemOneDX}{\begin{problem}[3pt]
Suppose that $u$ is a harmonic function on the open unit disc $\mathbb{D}=\{(x,y)\colon x^2+y^2 <1\}\subset\mathbb{R}^2$ which is continuous on the closed unit disc $\overline{\mathbb{D}}=\{(x,y)\colon x^2+y^2 \le 1\}$ and is equal to
\begin{equation*} g(\theta) = \left\{
\begin{aligned}
&\sec^2(\theta), && |\theta|\le \frac{\pi}{4}, \\
&2, && \theta\in\bigl[-\pi,-\frac{\pi}{4}\bigr)\cup\bigl(\frac{\pi}{4},\pi\bigr],
\end{aligned}
\right. \end{equation*}
on the boundary unit circle $S^1=\{(x,y)\colon x^2+y^2 = 1\}$.
\begin{enumerate}[label=(\alph*)]
\item Determine the maximum value that $u$ takes on the closed disc $\overline{\mathbb{D}}$.
\item Determine $u(0)$.
\end{enumerate}
\end{problem}}
\newcommand{\problemOneEX}{\begin{problem}[3pt]
Suppose that $u$ is a harmonic function on the open unit disc $\mathbb{D}=\{(x,y)\colon x^2+y^2 <1\}\subset\mathbb{R}^2$ which is continuous on the closed unit disc $\overline{\mathbb{D}}=\{(x,y)\colon x^2+y^2 \le 1\}$ and is equal to
\begin{equation*} g(\theta) = \left\{
\begin{aligned}
&-|\sin(\theta)|, && |\theta|\le \frac{\pi}{2}, \\[4pt]
&-1, && \theta\in\bigl[-\pi,-\frac{\pi}{2}\bigr)\cup\bigl(\frac{\pi}{2},\pi\bigr],
\end{aligned}
\right. \end{equation*}
on the boundary unit circle $S^1=\{(x,y)\colon x^2+y^2 = 1\}$.
\begin{enumerate}[label=(\alph*)]
\item Determine the maximum value that $u$ takes on the closed disc $\overline{\mathbb{D}}$.
\item Determine $u(0)$.
\end{enumerate}
\end{problem}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\problemOneAY}{\begin{problem}[3pt]
Suppose that $u$ is a harmonic function on the open unit disc $\mathbb{D}=\{(x,y)\colon x^2+y^2 <1\}\subset\mathbb{R}^2$ which is continuous on the closed unit disc $\overline{\mathbb{D}}=\{(x,y)\colon x^2+y^2 \le 1\}$ and is equal to
\begin{equation*} g(\theta) = \theta(2\pi-\theta),
\quad 0\le \theta \le 2\pi, \end{equation*}
on the boundary unit circle $S^1=\{(x,y)\colon x^2+y^2 = 1\}$.
\begin{enumerate}[label=(\alph*)]
\item Determine the maximum value that $u$ takes on the closed disc $\overline{\mathbb{D}}$.
\item Determine $u(0)$.
\end{enumerate}
\end{problem}}
\newcommand{\problemOneBY}{\begin{problem}[3pt]
Suppose that $u$ is a harmonic function on the open unit disc $\mathbb{D}=\{(x,y)\colon x^2+y^2 <1\}\subset\mathbb{R}^2$ which is continuous on the closed unit disc $\overline{\mathbb{D}}=\{(x,y)\colon x^2+y^2 \le 1\}$ and is equal to
\begin{equation*} g(\theta) = \frac{\sin(\theta)}{2+\cos(\theta)}, \quad -\pi\le \theta\le \pi, \end{equation*}
on the boundary unit circle $S^1=\{(x,y)\colon x^2+y^2 = 1\}$.
\begin{enumerate}[label=(\alph*)]
\item Determine the maximum value that $u$ takes on the closed disc $\overline{\mathbb{D}}$.
\item Determine $u(0)$.
\end{enumerate}
\end{problem}}
\newcommand{\problemOneCY}{\begin{problem}[3pt]
Suppose that $u$ is a harmonic function on the open unit disc $\mathbb{D}=\{(x,y)\colon x^2+y^2 <1\}\subset\mathbb{R}^2$ which is continuous on the closed unit disc $\overline{\mathbb{D}}=\{(x,y)\colon x^2+y^2 \le 1\}$ and is equal to
\begin{equation*} g(\theta)=\frac{1}{1+\theta^2} \qquad -\pi\le \theta<\pi \end{equation*}
on the boundary unit circle $S^1=\{(x,y)\colon x^2+y^2 = 1\}$.
\begin{enumerate}[label=(\alph*)]
\item Determine the maximum value that $u$ takes on the closed disc $\overline{\mathbb{D}}$.
\item Determine $u(0)$.
\end{enumerate}
\end{problem}}
\newcommand{\problemOneDY}{\begin{problem}[3pt]
Suppose that $u$ is a harmonic function on the open unit disc $\mathbb{D}=\{(x,y)\colon x^2+y^2 <1\}\subset\mathbb{R}^2$ which is continuous on the closed unit disc $\overline{\mathbb{D}}=\{(x,y)\colon x^2+y^2 \le 1\}$ and is equal to
\begin{equation*} g(\theta) = \sin(\frac{\theta}{2})\qquad 0\le \theta <2\pi \end{equation*}
on the boundary unit circle $S^1=\{(x,y)\colon x^2+y^2 = 1\}$.
\begin{enumerate}[label=(\alph*)]
\item Determine the maximum value that $u$ takes on the closed disc $\overline{\mathbb{D}}$.
\item Determine $u(0)$.
\end{enumerate}
\end{problem}}
\newcommand{\problemOneEY}{\begin{problem}[3pt]
Suppose that $u$ is a harmonic function on the open unit disc $\mathbb{D}=\{(x,y)\colon x^2+y^2 <1\}\subset\mathbb{R}^2$ which is continuous on the closed unit disc $\overline{\mathbb{D}}=\{(x,y)\colon x^2+y^2 \le 1\}$ and is equal to
\begin{equation*} g(\theta) = \theta(2\pi-\theta),
\qquad 0\le \theta <2\pi, \end{equation*}
on the boundary unit circle $S^1=\{(x,y)\colon x^2+y^2 = 1\}$.
\begin{enumerate}[label=(\alph*)]
\item Determine the maximum value that $u$ takes on the closed disc $\overline{\mathbb{D}}$.
\item Determine $u(0)$.
\end{enumerate}
\end{problem}}
\newcommand\problemOne[1]{\ifthenelse{\equal{#1}{1}}%
{\problemOneAX}{\ifthenelse{\equal{#1}{2}}{\problemOneBX}{\ifthenelse{\equal{#1}{3}}{\problemOneCX}{\ifthenelse{\equal{#1}{4}}{\problemOneDX}{\ifthenelse{\equal{#1}{0}}{\problemOneEX}{Rats! An error!}}}}}}
\newcommand{\booklet}{%
\setcounter{CMBpage}{\intcalcSub{\intcalcMul{\theCMBookletNumber}{4}}{3}}
{\ }
\begin{textblock}{2}(.5,.7)
{\color{red}\theBookletNumber}
\end{textblock}
\begin{textblock}{2}(2,1)
\Huge{\textbf{\theCMBookletNumber }}
\end{textblock}
\begin{textblock}{2}(2,1)
\includepdf[pages=\theCMBpage ]{dummy-Q7.pdf}
\end{textblock}
{\ }
\vskip20pt
\begin{center}
{\textbf{APM 346: \lec}}
\vskip 10pt
{\textbf{Quiz 7 (Week 12)}}
\vskip295pt
\end{center}
\newpage
\refstepcounter{CMBpage}
\problemOne{\theProblemVersion}
\begin{textblock}{2}(2,1)
\includepdf[pages=\theCMBpage ]{dummy-Q7.pdf}
\end{textblock}
\newpage
\refstepcounter{CMBpage}
{\ }
\begin{textblock}{2}(2,1)
\includepdf[pages=\theCMBpage ]{dummy-Q7.pdf}
\end{textblock}
\newpage
\refstepcounter{CMBpage}
{\ }
\begin{textblock}{2}(2,1)
\includepdf[pages=\theCMBpage ]{dummy-Q7.pdf}
\end{textblock}
\newpage
}
\newcommand{\bookletsetconf}{\setcounter{CMBookletNumber}{\theBookletSetNumber}}
\newcommand{\bookletset}{]
\bookletsetconf
\setcounter{BookletNumber}{\intcalcSub{\intcalcMul{\theBookletSetNumber}{5}}{4}}
\setcounter{ProblemVersion}{0}
\booklet
\refstepcounter{ProblemVersion}
\refstepcounter{BookletNumber}
\addtocounter{CMBookletNumber}{20}
\booklet
\refstepcounter{ProblemVersion}
\refstepcounter{BookletNumber}
\addtocounter{CMBookletNumber}{20}
\booklet
\refstepcounter{ProblemVersion}
\refstepcounter{BookletNumber}
\addtocounter{CMBookletNumber}{20}
\booklet
\refstepcounter{ProblemVersion}
\refstepcounter{BookletNumber}
\addtocounter{CMBookletNumber}{20}
\booklet
}
\begin{document}
\forloop{BookletSetNumber}{1}{\value{BookletSetNumber} < 17}{\bookletset}
\renewcommand{\lec}{LEC 0201}
\renewcommand\problemOne[1]{\ifthenelse{\equal{#1}{1}}%
{\problemOneAY}{\ifthenelse{\equal{#1}{2}}{\problemOneBY}{\ifthenelse{\equal{#1}{3}}{\problemOneCY}{\ifthenelse{\equal{#1}{4}}{\problemOneDY}{\ifthenelse{\equal{#1}{0}}{\problemOneEY}{Rats! An error!}}}}}}
\renewcommand{\bookletsetconf}{\setcounter{CMBookletNumber}{\intcalcAdd{\theBookletSetNumber}{80}}}
\forloop{BookletSetNumber}{21}{\value{BookletSetNumber} < 38}{\bookletset}
\end{document}
|
|