summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-10-25 21:34:13 +0000
committerKarl Berry <karl@freefriends.org>2018-10-25 21:34:13 +0000
commit4f28912f38990fab7aac77cdaba57f15b9d4bd0b (patch)
tree62e74a2663cdf348edf60d38944534b6e17fc066
parent9d1eb542f4a942d64b1d26d0887de84a56abde39 (diff)
brandeis-problemset (25oct18)
git-svn-id: svn://tug.org/texlive/trunk@48989 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/brandeis-problemset/brandeis-problemset-doc.sty29
-rw-r--r--Master/texmf-dist/doc/latex/brandeis-problemset/brandeis-problemset.pdfbin104892 -> 108407 bytes
-rw-r--r--Master/texmf-dist/doc/latex/brandeis-problemset/brandeis-problemset.tex58
-rw-r--r--Master/texmf-dist/doc/latex/brandeis-problemset/example.pdfbin47213 -> 209634 bytes
-rw-r--r--Master/texmf-dist/tex/latex/brandeis-problemset/brandeis-problemset.cls63
5 files changed, 134 insertions, 16 deletions
diff --git a/Master/texmf-dist/doc/latex/brandeis-problemset/brandeis-problemset-doc.sty b/Master/texmf-dist/doc/latex/brandeis-problemset/brandeis-problemset-doc.sty
index 130b5d232e4..27f88246a1d 100644
--- a/Master/texmf-dist/doc/latex/brandeis-problemset/brandeis-problemset-doc.sty
+++ b/Master/texmf-dist/doc/latex/brandeis-problemset/brandeis-problemset-doc.sty
@@ -9,6 +9,8 @@
\usepackage{textcomp} % needed for listings
\usepackage{xparse}
\usepackage{hologo} % xetex, etc. logos
+\usepackage{xkeyval}
+\usepackage{cprotect}
\newcommand{\email}[1]{\href{mailto:#1}{\texttt{#1}}}
\newcommand{\https}[1]{\href{https://#1}{\texttt{#1}}}
@@ -28,3 +30,30 @@
{\lstset{style=lstDemoStyleLaTeXCode}%
}
{}
+
+\define@cmdkeys{version}{author, version, date, changes}
+\define@key{version}{v}{\def\cmdKV@version@version{#1}}
+\presetkeys{version}{author={}, version={}, date={}, changes={}}{}
+\NewDocumentEnvironment{changelog}{}
+ {
+ \section{Changelog}
+ \NewDocumentEnvironment{version}{m}
+ {
+ \setkeys{version}{##1}
+ \item[\cmdKV@version@version] \cmdKV@version@author\
+ (\cmdKV@version@date)
+ \begin{itemize}
+ \NewDocumentCommand{\added}{}{\item Added\ }
+ }
+ {
+ \end{itemize}
+ }
+ \NewDocumentCommand{\shortversion}{m}{
+ \setkeys{version}{##1}
+ \item[\cmdKV@version@version] \cmdKV@version@author\
+ (\cmdKV@version@date) --- \cmdKV@version@changes}
+ \begin{description}
+ }
+ {
+ \end{description}
+ }
diff --git a/Master/texmf-dist/doc/latex/brandeis-problemset/brandeis-problemset.pdf b/Master/texmf-dist/doc/latex/brandeis-problemset/brandeis-problemset.pdf
index da6787d2818..69ca27ce664 100644
--- a/Master/texmf-dist/doc/latex/brandeis-problemset/brandeis-problemset.pdf
+++ b/Master/texmf-dist/doc/latex/brandeis-problemset/brandeis-problemset.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/brandeis-problemset/brandeis-problemset.tex b/Master/texmf-dist/doc/latex/brandeis-problemset/brandeis-problemset.tex
index 0bf25e08b0e..9a823c3cf3b 100644
--- a/Master/texmf-dist/doc/latex/brandeis-problemset/brandeis-problemset.tex
+++ b/Master/texmf-dist/doc/latex/brandeis-problemset/brandeis-problemset.tex
@@ -2,7 +2,7 @@
\usepackage{brandeis-problemset-doc}
\author{Rebecca Turner\thanks{Brandeis University; \email{rebeccaturner@brandeis.edu}}}
\title{The \bps\ Document Class}
-\date{2018-10-19}
+\date{2018-10-24}
\begin{document}
\maketitle
@@ -22,7 +22,7 @@
\note{The \bps\ document class should be considered experimental; the only
stable \textsc{api} is that of the \env{problem} environment.}
-\note{Browse the sources, contribute, or complain at
+\note{Browse the sources, contribute, or complain at \\
\https{github.com/9999years/brandeis-problemset}}
\tableofcontents
@@ -195,6 +195,11 @@ number & A problem number; if given, the problem-number counter
will not advance. The number must be robust, because it goes inside
a \cs{section}. \\
pagebreak & True/false (default: true). Add a pagebreak before the problem? \\
+label & Adds a custom label to the problem with \cs{label} that can be used
+ with \cs{ref} \\
+part & Indicates that this problem starts a new ``part'' of the assignment
+ \\
+partlabel & Adds a custom label to this part; see \option{label} \\
\end{Optionlist}
Vertical material is allowed in a~\env{problem}.
@@ -305,6 +310,9 @@ An environment for drawing Gantt charts indicating process scheduling. The
mandatory argument indicates how small the grid should be; \texttt{19}
subdivides the line into 19 cells.
+To use the \env{ganttschedule} environment, make sure to use the
+\option{gantt} package option.
+
Within a \env{ganttschedule}, use the \cs{burst} command to indicate an
active process (i.e.\ a process burst).
@@ -314,11 +322,25 @@ Draw a burst for process \marg{pid} of time length \meta{burst length}.
\note{These aren't really Gantt charts, but that's what Dr.\ Shrira calls
them, so that's what they're called here.}
-\note{Because \env{ganttschedule} relies on \ctan{tikz}, \ctan{fp}, and
- \ctan{calc}, it can add significantly to document compile times.
- If you intend to use the \env{ganttschedule}
- environment, make sure to use the \option{gantt} class option or set
- \option{gantt} in \cs{problemsetsetup}.}
+\cprotect\note{Because \env{ganttschedule} relies on \ctan{tikz}, \ctan{fp},
+ and \ctan{calc}, it can add significantly to document compile times. If
+ you intend to use the \env{ganttschedule} environment, make sure to use
+ the \option{gantt} class option or set \option{gantt} in
+ \cs{problemsetsetup}. If you fail to include the \option{gantt} option,
+ you will see an error message:
+
+\begin{latexcode}
+! Package brandeis-problemset Error: ganttschedule enviornment not loaded in preamble.
+
+See the brandeis-problemset package documentation for explanation.
+Type H <return> for immediate help.
+l.4 \burst
+ {1}{1}
+? H
+Did you mean to use the 'gantt' option for the brandeis-problemset document class?
+
+\end{latexcode}
+}
\begin{latexcode}
\begin{ganttschedule}{19}
@@ -432,4 +454,26 @@ $\Rm{Foo}(a, n)$ computes $a^n$, and will run in $O(n)$ time always.
\end{document}
\end{latexcode}
+\pagebreak
+\begin{changelog}
+\begin{version}{v=0.3.0, date=2018-10-24, author=Rebecca Turner}
+ \added changelog.
+ \added support for \cs{part}s and referencing problems.
+ \added options to \env{problem} environment: \option{part},
+ \option{label}, and \option{partlabel}.
+ \added \cs{maketitle} (contrast with \cs{maketitlepage}).
+\end{version}
+\begin{version}{v=0.2.0, date=2018-10-20, author=Rebecca Turner}
+ \item Renamed to \bps.
+ \added license header.
+ \added \env{ganttschedule} environment.
+ \added keywords to pseudocode environment: \texttt{and}, \texttt{or},
+ \texttt{nil}, and \texttt{len}.
+ \added \cs{ac} command for acronyms.
+ \added package example.
+\end{version}
+\shortversion{v=0.1.0, date=2018-10-19, author=Rebecca Turner,
+ changes=Initial beta as \ltxclass{problemset}.}
+\end{changelog}
+
\end{document}
diff --git a/Master/texmf-dist/doc/latex/brandeis-problemset/example.pdf b/Master/texmf-dist/doc/latex/brandeis-problemset/example.pdf
index a9855c0dd25..3df0c65a6b4 100644
--- a/Master/texmf-dist/doc/latex/brandeis-problemset/example.pdf
+++ b/Master/texmf-dist/doc/latex/brandeis-problemset/example.pdf
Binary files differ
diff --git a/Master/texmf-dist/tex/latex/brandeis-problemset/brandeis-problemset.cls b/Master/texmf-dist/tex/latex/brandeis-problemset/brandeis-problemset.cls
index d6aa05ae5a1..cb60b75857a 100644
--- a/Master/texmf-dist/tex/latex/brandeis-problemset/brandeis-problemset.cls
+++ b/Master/texmf-dist/tex/latex/brandeis-problemset/brandeis-problemset.cls
@@ -1,4 +1,4 @@
-\ProvidesClass{brandeis-problemset}[2018-10-20 0.2.0 COSI Problem sets at Brandeis University]
+\ProvidesClass{brandeis-problemset}[2018-10-24 0.3.0 COSI Problem sets at Brandeis University]
% Description: A document class for Brandeis University's computer science
% courses' problem sets
% License: GPL-3.0
@@ -267,17 +267,34 @@
\fancypagestyle{plain}{\fancyhead[L]{}}
\AtBeginDocument{\pagestyle{fancy}}
-\titleformat{\section}{}{}{0em}{\bfseries\large}[]
-\titleformat{\subsection}{}{}{0em}{\llap{\alph{subsection}.\hspace{1em}}}[]
+% {command}[shape]{format}{label}{sep}{before}[after]
+\titleformat{\part}[hang]{\bfseries\Large}{Part \thepart}{0em}{}[]
+\titleformat{\section}{\bfseries\large}{}{0em}{}[]
+\titleformat{\subsection}{\llap{\thesubsection.}}{}{1em}{}[]
+% {command}{left}{before}{after}[right]
+\titlespacing{\part}{0em}{-0.25in}{0em}[0em]
\titlespacing{\section}{0em}{1em}{0em}[0em]
\titlespacing{\subsection}{0em}{1em}{0em}[0em]
+\titlecontents{part}
+ [3.8em] % left
+ {\large\bfseries} % above-code
+ % numbered entry format
+ {\hspace*{-3.8em}\large\bfseries\contentspage\hspace*{3.8em}}
+ % numberless entry format
+ {\hspace*{-2.3em}}
+ % filler pg format
+ {}
+ % below code
+ []
+
\titlecontents{section}
- [3.8em] % ie, 1.5em (chapter) + 2.3em
+ [4.8em]
{}
{\hspace*{-3.8em}\contentspage\hspace*{3.8em}}
{\hspace*{-2.3em}}
{}
+ []
\newlength{\problemindent}
\setlength{\problemindent}{1in}
@@ -288,15 +305,29 @@
\define@boolkey{problem}{pagebreak}[true]{\ifKV@problem@pagebreak
\vfill\pagebreak
\else\fi}
-\define@cmdkey{problem}{number}{}
+\define@cmdkeys{problem}{number, label, partlabel}
+\define@cmdkey{problem}{part}[]{}
\presetkeys{problem}{pagebreak}{}
\NewDocumentEnvironment{problem}{O{}}{%
\setkeys{problem}{#1}%
- \ifx\cmdKV@problem@number\undefined\stepcounter{problemnumber}%
+ \@ifundefined{cmdKV@problem@number}{%
+ \stepcounter{problemnumber}%
\newcommand{\cmdKV@problem@number}{\arabic{problemnumber}}%
- \else\fi
- \section{Problem \cmdKV@problem@number\problem@title}
+ }%
+ \@ifundefined{cmdKV@problem@part}{}{%
+ \part{\cmdKV@problem@part}%
+ \@ifundefined{cmdKV@problem@partlabel}{}{%
+ \expandafter\label{\cmdKV@problem@partlabel}
+ }%
+ }
+ \section{Problem \cmdKV@problem@number\problem@title}%
+ % fix up ref commands
+ \edef\@currentlabel{\cmdKV@problem@number}%
+ \edef\@currentlabelname{Problem \cmdKV@problem@number\problem@title}%
+ \@ifundefined{cmdKV@problem@label}{}{%
+ \expandafter\label{\cmdKV@problem@label}%
+ }%
\begin{adjustwidth}{\problemindent}{0pt}}
{\end{adjustwidth}}
@@ -310,11 +341,25 @@
by & \@author \\
\if\relax\problemset@course\else course & \problemset@course \\\fi
\if\relax\problemset@instructor\else instructor & \problemset@instructor \\\fi
- \if\relax\problemset@due\else due & \problemset@due \\\fi
+ \if\relax\problemset@duedate\else due & \problemset@duedate \\\fi
\end{tabular}%
\end{center}%
\pagebreak}
+\renewcommand{\maketitle}{\thispagestyle{empty}%
+ %\vspace*{2in}%
+ \begin{center}%
+ \large\begin{tabular}{r|l}
+ \@ifundefined{problemset@assignment}{}{assignment & \problemset@assignment \\}
+ by & \@author \\
+ \@ifundefined{problemset@course}{}{course & \problemset@course \\}
+ \@ifundefined{problemset@instructor}{}{instructor & \problemset@instructor \\}
+ \@ifundefined{problemset@duedate}{}{due & \problemset@duedate \\}
+ \end{tabular}%
+ \end{center}%
+ \vspace*{2em}%
+ }
+
\NewDocumentEnvironment{ganttschedule}{m o} % total size, title
{\ifgantt@loaded
\else