From 72dc156cb5ac86df57a1d2d49c1446744be53395 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 9 Jan 2019 22:45:39 +0000 Subject: mi-solns (9jan19) git-svn-id: svn://tug.org/texlive/trunk@49651 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/mi-solns/README.md | 14 + .../doc/latex/mi-solns/docs/mi-solns.pdf | Bin 0 -> 276191 bytes .../doc/latex/mi-solns/docs/mi-solnsman.pdf | Bin 0 -> 223143 bytes .../doc/latex/mi-solns/docs/mi-solnsman.tex | 406 +++++++++++++++++++++ .../doc/latex/mi-solns/examples/create-db.tex | 92 +++++ .../doc/latex/mi-solns/examples/mi-solns-eq.tex | 159 ++++++++ .../doc/latex/mi-solns/examples/mi-solns-eqe.tex | 202 ++++++++++ .../doc/latex/mi-solns/examples/use-db.tex | 23 ++ 8 files changed, 896 insertions(+) create mode 100644 Master/texmf-dist/doc/latex/mi-solns/README.md create mode 100644 Master/texmf-dist/doc/latex/mi-solns/docs/mi-solns.pdf create mode 100644 Master/texmf-dist/doc/latex/mi-solns/docs/mi-solnsman.pdf create mode 100644 Master/texmf-dist/doc/latex/mi-solns/docs/mi-solnsman.tex create mode 100644 Master/texmf-dist/doc/latex/mi-solns/examples/create-db.tex create mode 100644 Master/texmf-dist/doc/latex/mi-solns/examples/mi-solns-eq.tex create mode 100644 Master/texmf-dist/doc/latex/mi-solns/examples/mi-solns-eqe.tex create mode 100644 Master/texmf-dist/doc/latex/mi-solns/examples/use-db.tex (limited to 'Master/texmf-dist/doc/latex') diff --git a/Master/texmf-dist/doc/latex/mi-solns/README.md b/Master/texmf-dist/doc/latex/mi-solns/README.md new file mode 100644 index 00000000000..3148e4ca1b7 --- /dev/null +++ b/Master/texmf-dist/doc/latex/mi-solns/README.md @@ -0,0 +1,14 @@ +The mi-solns Package +Author: D. P. Story +Dated: 2018/12/18 + +This package is designed to mark a solution environment of an exercise or +quiz and insert it into the same or a different document. Solutions are +ones created by either the exerquiz or eqexam package. + +All PDF creators are supported. + +D. P. Story +www.acrotex.net +dpstory@uakron.edu +dpstory@acrotex.net diff --git a/Master/texmf-dist/doc/latex/mi-solns/docs/mi-solns.pdf b/Master/texmf-dist/doc/latex/mi-solns/docs/mi-solns.pdf new file mode 100644 index 00000000000..3d0e0f6e314 Binary files /dev/null and b/Master/texmf-dist/doc/latex/mi-solns/docs/mi-solns.pdf differ diff --git a/Master/texmf-dist/doc/latex/mi-solns/docs/mi-solnsman.pdf b/Master/texmf-dist/doc/latex/mi-solns/docs/mi-solnsman.pdf new file mode 100644 index 00000000000..5f21c1545e9 Binary files /dev/null and b/Master/texmf-dist/doc/latex/mi-solns/docs/mi-solnsman.pdf differ diff --git a/Master/texmf-dist/doc/latex/mi-solns/docs/mi-solnsman.tex b/Master/texmf-dist/doc/latex/mi-solns/docs/mi-solnsman.tex new file mode 100644 index 00000000000..a7a7ca588bf --- /dev/null +++ b/Master/texmf-dist/doc/latex/mi-solns/docs/mi-solnsman.tex @@ -0,0 +1,406 @@ +\documentclass{article} +\usepackage[fleqn]{amsmath} +\usepackage[ + web={centertitlepage,designv,forcolorpaper,tight*,latextoc,pro}, + exerquiz={nosolutions},eforms,aebxmp +]{aeb_pro} +\let\protected\relax +\usepackage{mi-solns} +%\usepackage{eq-save} +%\usepackage[ImplMulti]{dljslib} +%\usepackage{graphicx,array,fancyvrb} +\usepackage{aeb_mlink} +%\usepackage{myriadpro} +%\usepackage{calibri} + +\usepackage[altbullet]{lucidbry} + +\def\hardspace{{\fontfamily{cmtt}\selectfont\symbol{32}}} +\newif\ifmiswitch \miswitchfalse + +\usepackage{acroman} + +\usepackage[active]{srcltx} + +\urlstyle{tt} + + + +\def\STRUT{\rule{0pt}{14pt}} +%\useBeginQuizButton[\CA{Begin}] +%\useEndQuizButton[\CA{End}] +\def\SOL{\textsf{SOL}} +\def\QSL{\textsf{QSL}} + +\makeatletter +\def\eExmpl{\eq@fititin{\mbox{\exrtnlabelformatwp}}} +\newcount\hesheCnt \hesheCnt=-1 +\def\heshe{\@ifstar{\heshei}{\global\advance\hesheCnt\@ne\heshei}} +\def\heshei{\ifodd\hesheCnt she\else he\fi} +\def\HeShe{\@ifstar{\HeShei}{\global\advance\hesheCnt\@ne\HeShei}} +\def\HeShei{\ifodd\hesheCnt She\else He\fi} +\def\hisher{\@ifstar{\hisheri}{\global\advance\hesheCnt\@ne\hisheri}} +\def\hisheri{\ifodd\hesheCnt her\else his\fi} +\def\himher{\@ifstar{\himheri}{\global\advance\hesheCnt\@ne\himheri}} +\def\himheri{\ifodd\hesheCnt her\else him\fi} +\makeatother + +\DeclareDocInfo +{ + university={\AcroTeX.Net}, + title={The \textsf{mi-solns} Package}, + author={D. P. Story}, + email={dpstory@acrotex.net}, + subject=Documentation for the mi-solns package, + talksite={\url{www.acrotex.net}}, + version={0.6, 2018/12/29}, + Keywords={LaTeX, AeB, exercises, quizzes, mark and insert solutions}, + copyrightStatus=True, + copyrightNotice={Copyright (C) \the\year, D. P. Story}, + copyrightInfoURL={http://www.acrotex.net} +} + +\universityLayout{fontsize=Large} +\titleLayout{fontsize=LARGE} +\authorLayout{fontsize=Large} +\tocLayout{fontsize=Large,color=aeb} +\sectionLayout{indent=-62.5pt,fontsize=large,color=aeb} +\subsectionLayout{indent=-31.25pt,color=aeb} +\subsubsectionLayout{indent=0pt,color=aeb} +\subsubDefaultDing{\texorpdfstring{$\bullet$}{\textrm\textbullet}} + +\chngDocObjectTo{\newDO}{doc} +\begin{docassembly} +var titleOfManual="The mi-solns Package"; +var manualfilename="Manual_BG_Print_mi-solns.pdf"; +var manualtemplate="Manual_BG_Brown.pdf"; // Blue, Green, Brown +var _pathToBlank="C:/Users/Public/Documents/ManualBGs/"+manualtemplate; +var doc; +var buildIt=false; +if ( buildIt ) { + console.println("Creating new " + manualfilename + " file."); + doc = \appopenDoc({cPath: _pathToBlank, bHidden: true}); + var _path=this.path; + var pos=_path.lastIndexOf("/"); + _path=_path.substring(0,pos)+"/"+manualfilename; + \docSaveAs\newDO ({ cPath: _path }); + doc.closeDoc(); + doc = \appopenDoc({cPath: manualfilename, oDoc:this, bHidden: true}); + f=doc.getField("ManualTitle"); + f.value=titleOfManual; + doc.flattenPages(); + \docSaveAs\newDO({ cPath: manualfilename }); + doc.closeDoc(); +} else { + console.println("Using the current "+manualfilename+" file."); +} +var _path=this.path; +var pos=_path.lastIndexOf("/"); +_path=_path.substring(0,pos)+"/"+manualfilename; +\addWatermarkFromFile({ + bOnTop:false, + bOnPrint:false, + cDIPath:_path +}); +\executeSave(); +\end{docassembly} + + +\begin{document} + +\maketitle + +\selectColors{linkColor=black} +\tableofcontents +\selectColors{linkColor=webgreen} + + +\section{Introduction} + +The name of the package is \pkg{mi-solns}, where `m' is for `mark' and `i' is +for `insert'. So the \pkg{mi-solns} package can mark and insert solutions +(created by the \pkg{exerquiz} and \pkg{eqexam} packages). + +The \pkg{exerquiz} +(\href{https://www.ctan.org/pkg/acrotex}{ctan.org/pkg/acrotex}) and +\pkg{eqexam} (\href{https://www.ctan.org/pkg/eqexam}{ctan.org/pkg/eqexam}) +packages are capable of creating questions and solutions to exercises and +quizzes. The purpose of this package is to present commands for marking, and +for inserting any marked solution---for whatever reason---into the body of +the document.\footnote{A solution may be inserted into anohter solution, but +may not be inserted into itself.} To accomplish this goal, recent versions +of \pkg{exerquiz} and \pkg{eqexam} are required (dated 2018/12/13 or later); +also required is the \pkg{shellesc} package +(\href{https://ctan.org/pkg/shellesc}{ctan.org/pkg/shellesc}). + +While the document is being compiled, the solution files (\SOL{} and \QSL) are +being written to, so we cannot input them or read them. What we do is to make +a copy of the solution files from within the operating system, and input the +copy back into the body of the document when required. Consequently, it is +necessary to activate the feature of executing an OS script from within the +compiling operation. To activate the feature, the document needs to be +compiled with the \texttt{-{}-shell-escape} switch (for +\app{latex}, \app{pdflatex}, \app{lualatex}, or \app{xelatex}, depending on +your workflow). + +\paragraph*{Description of workflow.} The procedure is simple and short: (1) +mark a solution for insertion (\cs{mrkForIns\darg{\ameta{name}}}), just above +the \env{solution} environment; and (2) insert the solution with +\cs{insExSoln\darg{\ameta{name}}}, \cs{insSqSoln\darg{\ameta{name}}}, or +\cs{insQzSoln\darg{\ameta{name}}}, depending on whether the solution came +from an \env{exercise}, \env{shortquiz}, or \env{quiz} environment. + +\paragraph*{Demo files.} There are four demonstration files. +\begin{itemize} + \item \texttt{mi-solns-eq.tex} uses \pkg{exerquiz} to test the features + of \pkg{mi-solns}. + \item \texttt{mi-solns-eqe.tex} uses \pkg{eqexam} to test the features + of \pkg{mi-solns}. + \item \texttt{create-db.tex} part of a novel idea, it is an application for changing + the output file names. Compiling this file creates \texttt{poems.lst}, which is a very small database + of poetic quotations. + \item \texttt{use-db.tex} is the companion file to + \texttt{create-db.tex}. Once \texttt{poems.lst} is created, compile + \texttt{use-db.tex}, which will input \texttt{poems.lst} and + display the quotations. +\end{itemize} + +\section{Copying the \texorpdfstring{\SOL\space and \QSL}{SOL and QSL} files} + +Assuming you have determined how to compile using the +\texttt{-{}-shell-escape} switch, when you compile a \pkg{mi-solns} document, +the files \cs{jobname.sol} and \cs{jobname.qsl} are copied at the end of the +document. The destination filenames are \cs{jobname-cpy.sol} and +\cs{jobname-cpy.qsl} by default, but these names can be changed through the +commands \cs{declSOLOut} and \cs{declQSLOut}. +\bVerb\takeMeasure{\string\declSOLOut\darg{\ameta{sol-out}}}% +\setlength\aebscratch{\bxSize}% +\def\1{\makebox[0pt][l]{\hspace{\aebscratch}\enspace\makebox[0pt][l]{\normalfont(\cs{declSOLIn\darg{\string\jobname.sol}})}}}% +\def\2{\makebox[0pt][l]{\hspace{\aebscratch}\enspace\makebox[0pt][l]{\normalfont(\cs{declSOLOut\darg{\string\jobname-cpy.sol}})}}}% +\def\3{\makebox[0pt][l]{\hspace{\aebscratch}\enspace\makebox[0pt][l]{\normalfont(\cs{declQSLIn\darg{\string\jobname.qsl}})}}}% +\def\4{\makebox[0pt][l]{\hspace{\aebscratch}\enspace\makebox[0pt][l]{\normalfont(\cs{declQSLOut\darg{\string\jobname-cpy.qsl}})}}}% +\begin{dCmd}[commandchars=!(),commentchar=\%]{\bxSize} +%!1\declSOLIn{!ameta(sol-in)} +!2\declSOLOut{!ameta(sol-out)} +%!3\declQSLIn{!ameta(qsl-in)} +!4\declQSLOut{!ameta(qsl-out)} +\end{dCmd} +\eVerb At the end of the document, the following OS operations occur: +\begin{itemize} + \item Copy \cs{jobname.sol} to \ameta{sol-out} (\cs{jobname.sol} to \cs{jobname-cpy.sol}) + \item Copy \cs{jobname.qsl} to \ameta{qsl-out} (\cs{jobname.qsl} to \cs{jobname-cpy.qsl}) +\end{itemize} +Freely change the names of the output files according to your own whims. + +\paragraph*{The copy commands.} The following two commands expand the run-time scripts for +copying one file to another. +\bVerb\takeMeasure{\string\newcommand\darg{\string\copyfileCmdEx}\darg{copy \string\jobname.sol \string\misolout}}% +\setlength\aebscratch{\bxSize}% +\begin{dCmd}[commandchars=!()]{\bxSize} +\newcommand{\copyfileCmdEx}{copy \jobname.sol \misolout} +\newcommand{\copyfileCmdQz}{copy \jobname.qsl \miqslout} +\end{dCmd} +\eVerb where \cs{misolout} and \cs{miqslout} expand to the names assigned by +the declarations \cs{declSOLOut} and \cs{declQSLOut}, respectively. These are +the definitions for \app{Windows} OS, it might be necessary to redefine these +commands corresponding to the OS in which you reside. + +\paragraph*{Turn copying on and off.} The SOL and QSL files are automatically copied, by default; +however, this operation can be turned off. +\bVerb\takeMeasure{\string\copySolnsOn\qquad\string\copySolnsOff}% +\setlength\aebscratch{\bxSize}% +\def\1{\makebox[0pt][l]{\hspace{\aebscratch}\enspace\makebox[0pt][l]{\sffamily(preamble only)}}}% +\def\2{\makebox[0pt][l]{\hspace{\aebscratch}\enspace\makebox[0pt][l]{\sffamily(anywhere)}}}% +\begin{dCmd}[commandchars=!()]{\bxSize} +!1\copySolnsOn!qquad\copySolnsOff +!2\readSolnsOn!qquad\readSolnsOff +\end{dCmd} +\eVerb \cs{copySolnsOn} is the default, it causes the solutions to be copied +at the end of the document; \cs{copySolnsOff} turns off the copying. Why +would you do this? Well, if you have completed composing your solutions and +you are concentrating on the other content of the document, there is no need +to repeatedly copy the solution files. Perhaps turn it on for the final +\emph{two compiles}. Yes, you read correctly, two compiles. Since the +solution files are copied at the end of the document, the refreshed +\ameta{sol-out} and \ameta{qsl-out} files do not get read until the next +compile. + +\cs{readSolnsOn} is initially expanded by the package, so it is the default. If you expand \cs{readSolnsOff}, the commands +\cs{insExSoln}, \cs{insSqSoln}, and \cs{insQzSoln} do not input their target file; instead +\cs{miReadOffMsg} is typeset. The default definition of this command is, +\begin{Verbatim}[xleftmargin=\parindent] +\newcommand\miReadOffMsg{(\textbf{?? read is off ??})} +\end{Verbatim} +This command may be redefined as desired. + +\section{Marking a solution} + +The first step is to mark a solution you wish to insert elsewhere in the document. +\bVerb\takeMeasure{\string\mrkForIns\darg{\ameta{name}}}% +\setlength\aebscratch{\bxSize}% +\begin{dCmd}[commandchars=!()]{\bxSize} +\mrkForIns{!ameta(name)} +\end{dCmd} +\eVerb The placement is just above the targeted \env{solution} environment. +\begin{Verbatim}[xleftmargin=\parindent,commandchars=!()] +!textbf(\mrkForIns{!ameta(name)}) +\begin{solution}[!ameta(options)] +!quad!ameta(solution) +\end{solution} +\end{Verbatim} +Here, \ameta{name} is a word consisting of only ASCII characters. As the \ameta{sol-out} file is read in, +a simple string comparison is performed. If \pkg{mi-solns} is not displaying the solution you want to insert, +this could be the problem; simplify the word(s) used for the \ameta{name} argument. + +%\insExSoln[\ignoreques]{dps} + +Below is a simple example we'll work with throughout the rest of this documentation. + +\begin{exercise}\label{ex:First} +\begin{cq}An intelligent question.\end{cq} +\mrkForIns{myIQ} +\begin{solution} +A brilliant answer to the intelligent question. +\ifmiswitch(D. P. Story)\fi +\end{solution} +\end{exercise} +The verbatim listing is, +\begin{Verbatim}[xleftmargin=\parindent,commandchars={!@^}] +\newif\ifmiswitch \miswitchfalse %!sffamily@ used in Example 4^ +... +\begin{exercise} +\begin{cq}An intelligent question.\end{cq} +!textbf@\mrkForIns{myIQ}^ +\begin{solution} +A brilliant answer to the intelligent question. +\ifmiswitch(D. P. Story)\fi +\end{solution} +\end{exercise} +\end{Verbatim} +Continue to the next section for information on how to insert the solution +into the document. + +\section{Inserting a solution} + +The second step is to insert the solution into the document. There are three +commands for inserting marked content back in the document. +\bVerb\takeMeasure{\string\insExSoln[\ameta{inserts}]\darg{\ameta{name}}}% +\setlength\aebscratch{\bxSize}% +\setlength\aebscratch{\bxSize}% +\def\1{\makebox[0pt][l]{\hspace{\aebscratch}\enspace\makebox[0pt][l]{\sffamily(for \env{exercise} env.)}}}% +\def\2{\makebox[0pt][l]{\hspace{\aebscratch}\enspace\makebox[0pt][l]{\sffamily(for \env{shortquiz} env.)}}}% +\def\3{\makebox[0pt][l]{\hspace{\aebscratch}\enspace\makebox[0pt][l]{\sffamily(for \env{quiz} env.)}}}% +\begin{dCmd}[commandchars=!()]{\bxSize} +!1\insExSoln[!ameta(inserts)]{!ameta(name)} +!2\insSqSoln[!ameta(inserts)]{!ameta(name)} +!3\insQzSoln[!ameta(inserts)]{!ameta(name)} +\end{dCmd} +\eVerb where, \ameta{name} must match up with the \ameta{name} argument of a +\cs{mrkForIns} command somewhere in the document. For solution content to +appear correctly, the choice of the insertion command must match the +environment that has been marked. If you marked a solution to an exercise, +then use \cs{insExSoln} to insert that solution. This is possible error +point, if the \ameta{name} does not match up with the correct insertion +command. + +The \ameta{inserts} optional parameter can be most anything that does not +disrupt the expansion of the \cs{ins??Soln} commands. \emph{It is placed +within a group.}\marginpar{\small\raggedleft\slshape\ameta{inserts} placed in +a group} This may be an interesting, useful, and significant feature, +depending on your imagination to use it. One command designed for the +\ameta{inserts} option for an exercise is \cs{ignoreques}. This is +discussed in \textbf{Example~2} below. + +\paragraph*{Example~1.} Insert the solution to \textsc{\hyperref[ex:First]{Exercise~\ref*{ex:First}}}: \insExSoln{myIQ} +\begin{Verbatim}[xleftmargin=\parindent,commandchars=!()] +(!sffamily(Insert the solution to !ameta(link removed):)) !textbf(\insExSoln{myIQ}) +\end{Verbatim} +The above is the verbatim listing. It's just that simple! However, the +question to the problem also appears! Continue this problem with +\textbf{Example~2}.\eExmpl + +\paragraph*{Example~2.} \textsc{\hyperref[ex:First]{Exercise~\ref*{ex:First}}} has its question +enclosed in the \env{cq} environment. This environment passes +the question along with the solution. If we don't want to include the +question, pass a special command \cs{ignoreques} in the optional +\ameta{inserts} argument. The expansion of +\verb~``\insExSoln[\ignoreques]{myIQ}''~ is +``\insExSoln[\ignoreques]{myIQ}''\eExmpl + +\def\myFmt{\declCQPre{\emph{\textcolor{blue}{\cqQStr}:}\space}% +\declCQPost{\par\medskip\noindent\emph{\textcolor{blue}{\cqSStr}:}\space\ignorespaces}} + +\paragraph*{Example~3.} Again referring to \textsc{\hyperref[ex:First]{Exercise~\ref*{ex:First}}}, the +\env{cq} environment (defined in \pkg{exerquiz} and \pkg{eqexam}) has certain +formatting controls. We can pass some formatting commands through the +\ameta{inserts} argument without affecting other \env{cq} environments in the +document. For example, +\par\medskip\noindent +\insExSoln[\myFmt]{myIQ} +\begin{Verbatim}[xleftmargin=\parindent,commandchars=!(),fontsize=\small] +\newcommand\myFmt{\declCQPre{\emph{\textcolor{blue}{\cqQStr}:}\space}% + \declCQPost{\par\medskip\noindent + \emph{\textcolor{blue}{\cqSStr}:}\space\ignorespaces}} +\end{Verbatim} +Verbatim listing: +{\let\leftmargini\parindent +\begin{quote} +\textsf{For example,}\texttt{\cs{par}\string\medskip\string\noindent\textbf{\string\insExSoln[\string\myFmt]\darg{myIQ}}} +\end{quote}}\noindent +Be sure not to introduce any spurious spaces.\eExmpl + +\paragraph*{Example~4.} (\textbf{Conditional content}) The \ameta{solution} can have conditional content, which +may be controlled locally by passing the state of a Boolean switch through the \ameta{inserts} argument. +\begin{Verbatim}[xleftmargin=\parindent,commandchars=!(),fontsize=\small] +\newif\ifmiswitch \miswitchfalse +... +(!normalfont!sffamily(This code results in ))``!textbf(\insExSoln[\ignoreques\miswitchtrue]{myIQ})'' +\end{Verbatim} +This code results in ``\insExSoln[\ignoreques\miswitchtrue]{myIQ}''\eExmpl + +\paragraph*{Example~5.} (\textbf{Changing \ameta{sol-out}}) There is a file \texttt{poems.lst} produced by +the demo file \texttt{create-db.tex}; here, we insert one of the verses by +changing the \ameta{sol-out} file.\medskip \bVerb +\begin{minipage}[t]{2in+20pt} +\begin{flushleft}\setlength{\baselineskip}{0pt}\setlength{\leftmargini}{15pt} +\textbf{The Lama} by \textbf{Ogden Nash} +\insExSoln[\declSOLOut{poems.lst}]{The Lama} +\end{flushleft} +\end{minipage}\hfill +\begin{minipage}[t]{\linewidth-2in-20pt} +Verbatim listing of the poem:\\[3pt] +{\ttfamily\small\string\insExSoln[\textbf{\string\declSOLOut\darg{poems.lst}}]\darg{The Lama}} +\end{minipage}\medskip +\eVerb Refer to demo files \texttt{create-db.tex} and \texttt{use-db.tex}.\eExmpl + +\section{Building the solution sets} + +We can extract the solution to a problem only if the solution file is fully +built. Generally, the solution sets are fully built when the solutions appear +at the end of the file, but that is not the only situation. The following +list summarizes the options for which the solution files are created in their +entirety. +\begin{itemize} + \item For the \pkg{exerquiz} package, any option other than \texttt{solutionsafter}. + This includes the following options: \texttt{nosolutions}, \texttt{noquizsolutions}, + \texttt{vspacewithsolns}, and no solution-related option at all + (\verb~\usepackage{exerquiz}~). Hidden solutions are not displayed. + \item For the \pkg{eqexam} package, any option other than + \texttt{solutionsafter} and \texttt{answerkey}. This includes the + following options: \texttt{nosolutions}, + \texttt{vspacewithsolns}, and no solution-related option at all + (\verb~\usepackage{eqexam}~). Hidden solutions are not displayed. +\end{itemize} +You can insert solutions even when the \texttt{answerkey} or +\texttt{solutionsafter} option is in effect. First compile with +\texttt{vspaceiwithsolns},\footnote{This creates fully built \ameta{sol-out} +and \ameta{qsl-out} files.} for example, then place \cs{copySolnsOff} in the +preamble and compile again with the \texttt{answerkey} or +\texttt{solutionsafter} option. The insertions will then appear on the next +compile. + +\section{My retirement} + +Now, I simply must get back to it. \dps + +\end{document} diff --git a/Master/texmf-dist/doc/latex/mi-solns/examples/create-db.tex b/Master/texmf-dist/doc/latex/mi-solns/examples/create-db.tex new file mode 100644 index 00000000000..2a55c1e8e8b --- /dev/null +++ b/Master/texmf-dist/doc/latex/mi-solns/examples/create-db.tex @@ -0,0 +1,92 @@ +\documentclass{article} +\usepackage[designiv,forcolorpaper]{web} +\usepackage{exerquiz} + +\usepackage{mi-solns} +\declSOLOut{poems.lst} + +%\copySolnsOff + +% This formatting is optional, the purpose of this file is to create +% the poems.lst file, which is to be input by another file. +\renewcommand\exlabel{Poet} +\renewcommand\exlabelformat{{\scshape\exlabel:}} +\renewcommand\exsllabelformat{\protect\textbf{\exlabelsol\ \currentpoet}} +\renewcommand\exsllabelformatwp + {\protect\textbf{\currentpoet: \currenttitle}} +\renewcommand\exsectitle{List of \exlabel s and their Poems} +\partsformat{} +\def\currentPoet#1{\def\currentpoet{#1}} +\def\currentTitle#1{\def\currenttitle{#1}} +\partsitemsep{6pt} + +\begin{document} + +\currentPoet{Ogden Nash} +\begin{exercise*} +\textbf{Ogden Nash} +\begin{parts} +\item \currentTitle{First Limerick}\textbf{First Limerick} +\insExSoln{First Limerick} +\mrkForIns{First Limerick} +\begin{solution}[] +\begin{quote}\obeylines +An old person of Troy +Is so prudish and coy +That it doesn't know yet +If it's a girl or a boy. +\end{quote} +\end{solution} + +\item \currentTitle{The Lama}\textbf{The Lama} +\insExSoln{The Lama} +\mrkForIns{The Lama} +\begin{solution}[] +\begin{quote}\obeylines +The one-l lama, +He's a priest, +The two-l llama, +He's a beast. +And I will bet +A silk pajama +There isn't any +Three-l lllama\footnote{\raggedright The author here is referring to a three-alarm fire, called a ``three-alarmer''.} +\end{quote} +\end{solution} +\end{parts} +\end{exercise*} + +\currentPoet{Edward R. Sill} +\begin{exercise*} +\textbf{Edward R. Sill} +\begin{parts} +\item \currentTitle{Opportunity}\textbf{Opportunity} +\insExSoln{Opportunity} +\mrkForIns{Opportunity} +\begin{solution}[] +\begin{quote}\obeylines +This I beheld, or dreamed it in a dream:--- +There spread a cloud of dust along a plain; +And underneath the cloud, or in it, raged +A furious battle, and men yelled, and swords +Shocked upon swords and shields. A prince's banner +Wavered then staggered backward, hemmed by foes.\vspace{\baselineskip} + +A craven hung along the battle's edge, +And thought, ``Had I a sword of keener steal--- +That blue blade that the king's son bears---but this +Blunt thing!''---he snapped and flung it from his hand. +And lowering crept away and left the field.\vspace{\baselineskip} + +Then came the king's son, wounded, sore bestead, +And weaponless, and saw the broken sword, +Hilt-buried in the dry and trodden sand, +And ran and snatched it, and with battle-shout, +Lifted afresh he hewed his enemy down, +And saved a great cause that heroic day. +\end{quote} +\end{solution} +\end{parts} +\end{exercise*} + +\end{document} diff --git a/Master/texmf-dist/doc/latex/mi-solns/examples/mi-solns-eq.tex b/Master/texmf-dist/doc/latex/mi-solns/examples/mi-solns-eq.tex new file mode 100644 index 00000000000..d6cc6b31ab8 --- /dev/null +++ b/Master/texmf-dist/doc/latex/mi-solns/examples/mi-solns-eq.tex @@ -0,0 +1,159 @@ +\documentclass{article} +\usepackage[designiv,forcolorpaper]{web} +\usepackage{exerquiz} +\usepackage{mi-solns} + +\def\cs#1{\texttt{\char`\\#1}} +\let\pkg\textsf +\let\env\texttt + +%\copySolnsOff +%\readSolnsOff + +\noSolnOpt + +\declCQSolStr{\textit{Solution}}\declCQQuesStr{\textit{Question}} + +\begin{document} + +\section{Introduction} + +\noindent +\textbf{The Problem.} For a document that uses \pkg{exerquiz} or \pkg{eqexam}, can a solution +that is marked in some way be reproduced in another part of the +document?\medskip + +\noindent\textbf{The Solution.} We require copies of \cs{jobname.sol} and +\cs{jobname.qsl} be made; these are named \cs{jobname-cpy.sol} and +\cs{jobname-cpy.qsl} (default names), and they are created at the end of each +compile. This file is closed when you compile again and hence can be input. +The switch for the compiler must be \texttt{--shell-escape} for those using +MiK\TeX. When a copy of a solution is needed, one of these two files are +input with the appropriate redefinitions. The solution has been formalized +into a new package \pkg{ci-solns}. + +\section{Exercises} + +Below are two extracted solutions from the exercises in this section. +\begin{itemize} + + \item The solution to Exercise~2 is\\[6pt]\textsl{\insExSoln{dps}} True this! + + \item The question of Exercise~2 is enclosed in the \env{cq} environment. + The question to the solution is typeset automatically, as above. The solution to + Exercise~2 again, this time without the question, we pass the special command + \cs{ignoreterminex}: \textsl{\insExSoln[\ignoreterminex]{dps}} + + \item J\"{u}rgen's solution is \textsl{\insExSoln{j-mon}} + +\end{itemize} + +\begin{exercise}\label{ex:one} +Solve this tricky one +\begin{solution} +1) That was a tricky one, can't do it. +\end{solution} +\end{exercise} + +\begin{exercise}\label{ex:two}\begin{cq} +Solve this tricky one.\end{cq} + +\mrkForIns{dps} +\begin{solution} +\ifwithinsoldoc +2) That was a tricky one, can't do it. \else whatever!\fi + +Pass some verbatim content as a test: \verb~$&%$^^%&~. +\end{solution} +\end{exercise} + +\begin{exercise}\label{ex:three} +Solve this tricky one +\begin{solution} +3) That was a tricky one, can't do it. +\end{solution} +\end{exercise} + +\begin{exercise*} +\begin{parts} + \item This is the part (a) question. +\begin{solution} +This is the part (a) solution. +\end{solution} + + \item (J\"{u}rgen's little q) This is the part (b) question. +\mrkForIns{j-mon} +\begin{solution} +This is the part (b) solution. +\end{solution} + + \item This is the part (b) question. +\begin{solution} +This is the part (b) solution. +\end{solution} + +\end{parts} +\end{exercise*} + +\newpage + +\section{Quizzes} + +In this section are two quizzes, generated by the \env{shortquiz} and \env{quiz} environments. + +\begin{itemize} + +\item Alex's solution is \textsl{\insSqSoln{aps}} Check for spurious spaces. + +\item Topi's solution is \textsl{\insQzSoln{topi}} Check for spurious spaces. +\end{itemize} + +\begin{shortquiz} +Solve each +\begin{questions} +\item \begin{answers}*{4} +\Ans0 False &\Ans1 True +\end{answers} +\begin{solution} +The answer is True +\end{solution} + +\mrkForIns{aps} +\item (Alex's question) $\cos(\pi) = \RespBoxMath{-1}*{1}{.0001}{[2,4]}\cgBdry\kern1bp\CorrAnsButton{-1}$ +\begin{solution} +Of course, everyone knows that $\cos(\pi) = -1 $. +\end{solution} +\end{questions} +\end{shortquiz} + +\useBeginQuizButton +\useEndQuizButton + +\begin{quiz*}{mathquiz} Answer each of the following. Passing +is 100\%. + +\begin{questions} + +\mrkForIns{topi} +\item (Topi's question) If $\lim_{x\to a} f(x) = f(a)$, then we say that $f$ is\dots +\begin{answers}*{3} +\Ans0 differentiable &\Ans1 continuous &\Ans0 integrable +\end{answers} + +\begin{solution} +A function $f$ is said to be continuous at $x=a$ if $x\in\mbox{Dom}(f)$, +$\lim_{x\to a} f(x) $ exists and $\lim_{x\to a} f(x) = f(a)$. +\end{solution} + +\item $\cos(\pi) = \RespBoxMath{-1}*{1}{.0001}{[2,4]}\cgBdry\kern1bp\CorrAnsButton{-1}$ +\begin{solution} +Of course, everyone knows that $\cos(\pi) = -1 $. +\end{solution} + +\end{questions} +\end{quiz*}\quad\ScoreField\currQuiz\olBdry\eqButton\currQuiz + +\noindent +Answers: \AnswerField\currQuiz + +\end{document} diff --git a/Master/texmf-dist/doc/latex/mi-solns/examples/mi-solns-eqe.tex b/Master/texmf-dist/doc/latex/mi-solns/examples/mi-solns-eqe.tex new file mode 100644 index 00000000000..a17be61f012 --- /dev/null +++ b/Master/texmf-dist/doc/latex/mi-solns/examples/mi-solns-eqe.tex @@ -0,0 +1,202 @@ +% +% This is a modified version of selectversion_tst.tex, which is distributed with eqexam +% +\documentclass{article} +\usepackage[fleqn]{amsmath} +\usepackage[pointsonleft,nototals,forcolorpaper, +% Select exactly one of the next three options +% nosolutions, +% answerkey, + vspacewithsolns, + obeylocalversions +]{eqexam} + +\usepackage{mi-solns} + +\university +{% + NORTHWEST FLORIDA STATE COLLEGE\\ + Department of Mathematics +} +\email{storyd@nwfsc.edu} + +\examNum{1}\numVersions{5}\forVersion{e} +\subject[CA]{College Algebra} +\longTitleText + {Test~{\nExam} A} + {Test~{\nExam} B} + {Test~{\nExam} C} + {Test~{\nExam} D} + {Test~{\nExam} E} +\endlongTitleText +\shortTitleText + {T\nExam-A} + {T\nExam-B} + {T\nExam-C} + {T\nExam-D} + {T\nExam-E} +\endshortTitleText +\title[\sExam]{\Exam} +\author{Dr.\ D. P. Story} +\date{\thisterm, \the\year} +\duedate{09/30/09} +\keywords{MAC 1105, Exam \nExam, {\thisterm} semester, \theduedate, at NWFSC} + +\newcommand{\cs}[1]{\texttt{\char`\\#1}} +\solAtEndFormatting{\eqequesitemsep{3pt}} +\turnContAnnotOn + +%\copySolnsOff + +\begin{document} + +\maketitle + +\medskip\noindent +This is a modified version of \texttt{selectversion\_tst.tex}, which is +distributed with \textsf{eqexam}, see that file for more details on producing +a document with multiple versions. + +\ifanswerkey When \texttt{answerkey} option is taken, the SOL file is not +written to include the solutions to the problem, as a result, the solutions +not available; however, by saying \cs{SolutionsAtEnd} you can locally turn on +writing the solutions and off writing with \cs{SolutionsAfter}.\fi +\par\medskip\noindent +dps: \textsl{\insExSoln[\ignoreterminex]{dps}}\medskip\par\noindent +kaf: \textsl{\insExSoln[\ignoreterminex]{kaf}} + +\begin{exam}[Part 1]{P1} + +\writeToSolnFile{\par\medskip + This comment is written to the solution file, but it should appear + when a solution is input using \protect\cs{insExSoln}, at least I hope so.\par\medskip} + +\selectVersion{}{3} +\begin{problem}\relax +\verb!\selectVersion{}{3}! \begin{cq}This problem is version \vA{A}\vB{B}\vC{C} of 3.\end{cq} + +\mrkForIns{dps} +\begin{solution} +The first problem, version \vA{A}\vB{B}\vC{C} of 3. +\end{solution} +\end{problem} + +\begin{problem*}[2ea] +Multi-part question. + \begin{parts} +\selectVersion{}{4} + \item \verb!\selectVersion{}{4}! This is problem, version \vA{A}\vB{B}\vC{C}\vD{D} of 4. +\begin{solution} +This is version \vA{A}\vB{B}\vC{C}\vD{D} + +The answer is: +\begin{verA} +This is version A +\end{verA} +\begin{verB} +This is version B +\end{verB} +\begin{verC} +This is version C +\end{verC} +\begin{verD} +This is version D +\end{verD} +\end{solution} + +\selectVersion{}{3} + \item \verb!\selectVersion{}{3}! This is a problem, version \vA{A}\vB{B}\vC{C} of 3. +\begin{verA} +This is A +\end{verA} +\begin{verB} +This is version B +\end{verB} +\begin{verE} +This is version E +\end{verE} + +\mrkForIns{kaf} +\begin{solution} +This is version \vA{A}\vB{B}\vC{C}\vD{D} + +The answer is: +\begin{verA} +This is version A +\end{verA} +\begin{verB} +This is version B +\end{verB} +\begin{verC} +This is version C +\end{verC} +\begin{verD} +This is version D +\end{verD} +\end{solution} + +\pushProblem % this closes the group +\begin{eqComments} +We insert a new page command so we can see the shortened titles on the next page +to verify that the new system of title management is working correctly. +\end{eqComments} +\emitMessageNearBottom*[.75\textheight]{% + \vfill\hfill\textbf{Problem~{\eqeCurrProb} continues on next page}} +\popProblem % this begins a group + +\selectVersion{}{5} + \item \verb!\selectVersion{}{5}! This is a problem, version \vA{A}\vB{B}\vC{C}\vD{D}\vE{E} of 5. +\begin{verB} +This is version B +\end{verB} +\begin{verE} +This is version E +\end{verE} +\begin{solution} +This is version \vA{A}\vB{B}\vC{C}\vD{D}\vE{E} + +The answer is: +\begin{verB} +This is version B +\end{verB} +\begin{verE} +This is version E +\end{verE} +\end{solution} + +\selectVersion{}{4} + \item \verb!\selectVersion{}{4}! This is a problem, version \vA{A}\vB{B}\vC{C}\vD{D} of 4. +\begin{verA} +This is A +\end{verA} +\begin{verB} +This is version B +\end{verB} +\begin{verE} +This is version E +\end{verE} +\begin{solution} +This is version \vA{A}\vB{B}\vC{C}\vD{D}\vE{E}. + +The answer is: +\begin{verA} +This is version A +\end{verA} +\begin{verB} +This is version B +\end{verB} +\begin{verC} +This is version C +\end{verC} +\begin{verD} +This is version D +\end{verD} +\begin{verE} +This is version E +\end{verE} +\end{solution} +\end{parts} +\end{problem*} + +\end{exam} +\end{document} diff --git a/Master/texmf-dist/doc/latex/mi-solns/examples/use-db.tex b/Master/texmf-dist/doc/latex/mi-solns/examples/use-db.tex new file mode 100644 index 00000000000..c743f721388 --- /dev/null +++ b/Master/texmf-dist/doc/latex/mi-solns/examples/use-db.tex @@ -0,0 +1,23 @@ +\documentclass{article} +\usepackage[forcolorpaper]{web} + +\usepackage{exerquiz} + +\usepackage{mi-solns} + +\copySolnsOff + + +\begin{document} + +%\noindent\textbf{Ogden Nash: First Limerick} +%\insExSoln[\declSOLOut{poems.lst}]{First Limerick}\medskip + +\noindent\textbf{Ogden Nash: The Lama} +\insExSoln[\declSOLOut{poems.lst}]{The Lama}\medskip + +\noindent\textbf{Edward R. Sill: Opportunity} +\insExSoln[\declSOLOut{poems.lst}]{Opportunity}\medskip + + +\end{document} -- cgit v1.2.3