summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/uassign/uassign.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-09-25 23:12:52 +0000
committerKarl Berry <karl@freefriends.org>2015-09-25 23:12:52 +0000
commit536b6d675a9ee412a5056db0d953012a0f03fcbe (patch)
tree9eedaaa875d3d3223b0499e70a2890ec787d3f95 /Master/texmf-dist/tex/latex/uassign/uassign.sty
parent7b3caccd5a070d5419779041629ae27d7a4a3db9 (diff)
uassign (25sep15)
git-svn-id: svn://tug.org/texlive/trunk@38459 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/uassign/uassign.sty')
-rw-r--r--Master/texmf-dist/tex/latex/uassign/uassign.sty162
1 files changed, 141 insertions, 21 deletions
diff --git a/Master/texmf-dist/tex/latex/uassign/uassign.sty b/Master/texmf-dist/tex/latex/uassign/uassign.sty
index 28d1c4f758e..07befed26f0 100644
--- a/Master/texmf-dist/tex/latex/uassign/uassign.sty
+++ b/Master/texmf-dist/tex/latex/uassign/uassign.sty
@@ -1,21 +1,44 @@
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{uassign}[2015/09/04 University assignments package]
+\ProvidesPackage{assign}[2015/09/23 v1.01 University assignments package]
% Author: Nathan Esau
-% Date: September 6, 2015
-% Version: 1.0
+%
+% Packages included: ifthen, hyperref, bookmark, color, enumerate,
+% amsmath, fancyhdr, titlesec
+% Options: notesheader, links, hideanswers, hidequestions,
+% assignheader
+% Environments: question, solution, example, exsolution, definition
+% Commands: ientry
+
+%% Project Public License, as described in lppl.txt in the base
+%% LaTeX distribution, either version 1.2 or (at your option)
+%% any later version.
\RequirePackage{ifthen}
+\RequirePackage{hyperref}
+\RequirePackage{bookmark}
+\RequirePackage{color}
+\RequirePackage{enumerate}
+\RequirePackage{amsmath}
+\RequirePackage{fancyhdr}
+\RequirePackage{titlesec}
+\RequirePackage{amsthm}
\makeatletter
+% Commands
+\newcommand{\ebox}[1]{%
+\hfill$\qed$
+}
+
+\newcommand{\ientry}[1]{%
+\index{#1}\textbf{#1}}
+
+
% Counters
\newcounter{questioncounter}
\newcounter{solutioncounter}
-% For printing "# " OR "Solution: " for answers
-\newboolean{questionsandanswers}
-
% For hiding question environment
\newboolean{showquestions}
\setboolean{showquestions}{true}
@@ -27,10 +50,65 @@
\DeclareOption{hideanswers}{\setboolean{showanswers}{false}}
\DeclareOption{hidequestions}{\setboolean{showquestions}{false}}
-\DeclareOption*{\PackageWarning{assn}{Unknown ‘\CurrentOption’}}
+\DeclareOption{assignheader}{%
+ \pagestyle{fancy}
+ \fancyhf{}
+ \renewcommand{\headrulewidth}{0pt}
+ % Define rhead, lhead in assignment
+
+ %\usepackage[margin=1.0in,headheight=27.18335pt]{geometry}
+ \setlength{\headheight}{27.18335pt}
+ \cfoot{\thepage}
+}
+
+\DeclareOption{notesheader}{%
+
+% Format header
+\pagestyle{fancy}
+\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
+\fancyhf{}
+\renewcommand{\headrulewidth}{0pt}
+\fancyhead[CE]{\textit{\nouppercase{\leftmark}}}
+\fancyhead[CO]{\textit{\nouppercase{\rightmark}}}
+\fancyhead[LE,RO]{\thepage}
+\cfoot{}
+
+% Format chapter
+\titleformat{\chapter}[display]
+{\bfseries\filcenter}
+{\huge\thechapter}
+{1ex}
+{
+\vspace{2ex}%
+\LARGE}
+[\vspace{0.5ex}%
+{\titlerule[1.0pt]}
+\vspace{10.0ex}
+]
+\titlespacing*{\chapter}{0pt}{-30pt}{40pt}
+
+% Format section
+\titleformat*{\section}{\centering\large\bfseries}
+\titleformat*{\subsection}{\centering\normalsize\bfseries\itshape}
+}
+
+\DeclareOption{links}{%
+
+% Hyper link setup
+\hypersetup{
+ colorlinks,
+ linkcolor={blue},
+ linktoc=page,
+ urlcolor=blue
+}
+
+%
+}
+
+\DeclareOption*{\PackageWarning{uassign}{Unknown ‘\CurrentOption’}}
\ProcessOptions\relax
-% For hiding
+% For hiding question and solution environments
\newsavebox{\trashcan}
% Question environment
@@ -38,22 +116,27 @@
% show the questions
\newenvironment{question}{%
%
- \medskip
+ \bigskip
\refstepcounter{questioncounter}
\vspace{-5mm}
\list{\thequestioncounter .}{%
\settowidth{\leftmargin}{10. \hskip\labelsep}%
\labelwidth\leftmargin\advance\labelwidth-\labelsep
\partopsep=0pt\bigskip
- \item
- }}{\endlist}}%
+ \item
+ \begingroup
+ }%
+ \endgroup
+ }{\endlist}}%
{%
% don't show the questions
\newenvironment{question}{%
- \begin{lrbox}{\trashcan}}%
- {\end{lrbox}}%
-\question Hello
-\endgroup
+ \begin{lrbox}{\trashcan}
+ \begin{minipage}{5cm}
+ }%
+ {%
+ \end{minipage}
+ \end{lrbox}}%
}
% Solution environment
@@ -61,7 +144,7 @@
% show the answers
\newenvironment{solution}[1][1.5em]{%
%
- \medskip
+ \bigskip
\refstepcounter{solutioncounter}
\vspace{-5mm}
\list{\ifthenelse{\boolean{showquestions}}{}{\thesolutioncounter .}}{%
@@ -69,14 +152,51 @@
\labelwidth\leftmargin\advance\labelwidth-\labelsep
\partopsep=0pt\bigskip
\ifthenelse{\boolean{showquestions}}{%
- \medskip \item[] \qquad \ \textbf{Solution: } \vspace{-3mm} \item[]}
+ \bigskip \item[] \textbf{Solution: } \medskip \item[]}
{\item}%
- }}{\endlist}}%
+ \begingroup
+ }%
+ \endgroup
+ }{\endlist}}%
{%
% don't show the answers
\newenvironment{solution}{%
- \begin{lrbox}{\trashcan}}%
- {\end{lrbox}}%
+ \begin{lrbox}{\trashcan}
+ \begin{minipage}{5cm}
+ }%
+ {%
+ \end{minipage}
+ \end{lrbox}}%
}
+
+\newcounter{examplecounter}
+%\numberwithin{examplecounter}{chapter}
+\newcounter{exsolutioncounter}
+%\numberwithin{solutioncounter}{chapter}
+\newcounter{defcounter}
+%\numberwithin{defcounter}{chapter}
+
+% Example environment
+\newenvironment{example}{
+\bigskip
+ \refstepcounter{examplecounter}
+ \noindent\textbf{Example \theexamplecounter}
+}{}
+
+% Solution environment
+\newenvironment{exsolution}{
+\bigskip
+ \refstepcounter{exsolutioncounter}
+ \noindent\textbf{Solution \theexsolutioncounter}
+ \begingroup
+ \endgroup
+}{}
+
+% Definition environment
+\newenvironment{definition}{
+\bigskip
+ \refstepcounter{defcounter}
+ \noindent\textbf{Definition \thedefcounter}
+}{}
-\makeatother \ No newline at end of file
+\makeatother