diff options
author | Karl Berry <karl@freefriends.org> | 2015-09-08 21:27:03 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-09-08 21:27:03 +0000 |
commit | 1cbe6d526f871c46e2fa636611f1173b3e9411eb (patch) | |
tree | 4f93e29e34e5c6fa063b2599245e649e0f6204f9 /Master/texmf-dist/doc/latex/uassign/uassign.tex | |
parent | af86b79e62d0939454e4969229a28ac4392df64c (diff) |
uassign (8sep15)
git-svn-id: svn://tug.org/texlive/trunk@38326 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/uassign/uassign.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/uassign/uassign.tex | 114 |
1 files changed, 114 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/uassign/uassign.tex b/Master/texmf-dist/doc/latex/uassign/uassign.tex new file mode 100644 index 00000000000..20ef3bdfb83 --- /dev/null +++ b/Master/texmf-dist/doc/latex/uassign/uassign.tex @@ -0,0 +1,114 @@ +\documentclass[12pt]{article} + +\usepackage{uassign} +\usepackage{hyperref} +\usepackage[margin=1.0in]{geometry} +%\usepackage{bookmark} + +\hypersetup{ + colorlinks, + linkcolor={blue}, + linktoc=page +} + +\setcounter{secnumdepth}{0} + +\title{The \texttt{uassign} package} +\author{Nathan Esau} +\date{\today} + +\begin{document} + +\maketitle +\tableofcontents + +\section{Overview} + +The purpose of the \texttt{uassign} is to provide a simple question and solution environment for typesetting university assignments. Although there exist \LaTeX \ classes, such as the \texttt{exam} class, and packages, such as the \texttt{exercise} package, which could be used for this purpose, the \texttt{uassign} package was designed with the following objectives in mind: + +\begin{itemize} +\item \textit{Simplicity}: Two environments -- one for questions and one for solutions +\item \textit{Hide environments}: Ability to produce a question sheet (questions only, i.e. an assignment) and a solution sheet (solutions only, i.e. an answer key) or both. This is done by passing a \texttt{hidequestions} or \texttt{hideanswers} option to the package +\item \textit{Minimal dependencies}: Only the \textit{ifelse} package is needed. All environments, i.e. \texttt{tabular}, \texttt{figure}, etc. can be used within the question and solution environments. + +By default used within the \texttt{question} and \texttt{solution} environment. +\end{itemize}% see http://tex.stackexchange.com/questions/242036/multiline-code-listings-in-cweb +\def\beginlisting{% + \par\vskip\baselineskip% + \begingroup% + \tt\obeylines\obeyspaces% + \catcode`\{12\catcode`\}12% +} +\def\endlisting{% + \endgroup\par% + \vskip\baselineskip% +} + +The \texttt{question} and \texttt{solution} environments provide the following features: + +\begin{itemize} +\item Automatic question numbering. The question counter is called \texttt{questioncounter} and its value can be accessed using \verb|\thequestioncounter|. Likewise, the solution counter is called \texttt{solutioncounter} and its value can be accessed using \verb|\thesolutioncounter|. To set the value of the question counter use \verb|\setcounter{questioncounter}{5}| and the next question would be question \texttt{6.} +\item Indenting. The question numbers are right aligned in the left margin, and the entire question or solution is indented using a \verb|\list|. +\end{itemize} + +\section{Environments} + +\subsection{\texttt{question} environment} + +Simply use \verb|\begin{question} ... code ... \end{question}|. For example: + +\begin{verbatim} +\begin{question} +What is the answer to life and all its questions? +\end{question} +\end{verbatim} + +\noindent Which produces the following output: + +\begin{question} +What is the answer to life and all its questions? +\end{question} + +\bigskip +\noindent Notice that the question is automatically numbered. + +\subsection{\texttt{solution} environment} + +Simply use \verb|\begin{solution} ... code ... \end{solution}|. For example: + +\begin{verbatim} +\setcounter{questioncounter}{3} +\setcounter{solutioncounter}{3} + +\begin{question} +What is the answer to life and all it's questions? +\end{question} + +\begin{solution} +The answer is 42. +\end{solution} +\end{verbatim} + +\noindent Which produces the following output: + +\setcounter{questioncounter}{3} +\setcounter{solutioncounter}{3} + +\begin{question} +What is the answer to life and all it's questions? +\end{question} + +\begin{solution} +The answer is 42. +\end{solution} + +\bigskip\noindent +A \texttt{medskip} of spacing is used before each question and solution environment. + +\section{Hiding environments} + +To hide solutions use the \texttt{hideanswers} option. When you load the package, the code would be \verb|\usepackage[hideanswers]{uassign}|. Likewise, questions can be hided using the \texttt{hidequestions} option. + +If questions are hide, then solutions are numbered. If questions are shown and solutions are shown, then solutions will have the word \textbf{Solution:} at the start of the solution. + +\end{document} |