texlive[48989] Master/texmf-dist: brandeis-problemset (25oct18)

commits+karl at tug.org commits+karl at tug.org
Thu Oct 25 23:34:13 CEST 2018


Revision: 48989
          http://tug.org/svn/texlive?view=revision&revision=48989
Author:   karl
Date:     2018-10-25 23:34:13 +0200 (Thu, 25 Oct 2018)
Log Message:
-----------
brandeis-problemset (25oct18)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/brandeis-problemset/brandeis-problemset-doc.sty
    trunk/Master/texmf-dist/doc/latex/brandeis-problemset/brandeis-problemset.pdf
    trunk/Master/texmf-dist/doc/latex/brandeis-problemset/brandeis-problemset.tex
    trunk/Master/texmf-dist/doc/latex/brandeis-problemset/example.pdf
    trunk/Master/texmf-dist/tex/latex/brandeis-problemset/brandeis-problemset.cls

Modified: trunk/Master/texmf-dist/doc/latex/brandeis-problemset/brandeis-problemset-doc.sty
===================================================================
--- trunk/Master/texmf-dist/doc/latex/brandeis-problemset/brandeis-problemset-doc.sty	2018-10-25 21:33:56 UTC (rev 48988)
+++ trunk/Master/texmf-dist/doc/latex/brandeis-problemset/brandeis-problemset-doc.sty	2018-10-25 21:34:13 UTC (rev 48989)
@@ -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 at cmdkeys{version}{author, version, date, changes}
+\define at key{version}{v}{\def\cmdKV at version@version{#1}}
+\presetkeys{version}{author={}, version={}, date={}, changes={}}{}
+\NewDocumentEnvironment{changelog}{}
+	{
+	\section{Changelog}
+	\NewDocumentEnvironment{version}{m}
+		{
+		\setkeys{version}{##1}
+		\item[\cmdKV at version@version] \cmdKV at version@author\
+			(\cmdKV at version@date)
+		\begin{itemize}
+			\NewDocumentCommand{\added}{}{\item Added\ }
+		}
+		{
+		\end{itemize}
+		}
+	\NewDocumentCommand{\shortversion}{m}{
+		\setkeys{version}{##1}
+		\item[\cmdKV at version@version] \cmdKV at version@author\
+			(\cmdKV at version@date) --- \cmdKV at version@changes}
+	\begin{description}
+	}
+	{
+	\end{description}
+	}

Modified: trunk/Master/texmf-dist/doc/latex/brandeis-problemset/brandeis-problemset.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/brandeis-problemset/brandeis-problemset.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/brandeis-problemset/brandeis-problemset.tex	2018-10-25 21:33:56 UTC (rev 48988)
+++ trunk/Master/texmf-dist/doc/latex/brandeis-problemset/brandeis-problemset.tex	2018-10-25 21:34:13 UTC (rev 48989)
@@ -2,7 +2,7 @@
 \usepackage{brandeis-problemset-doc}
 \author{Rebecca Turner\thanks{Brandeis University; \email{rebeccaturner at 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 @@
 	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 @@
 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,13 +322,27 @@
 
 \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}
 	\burst{2}{1}
 	\burst{4}{1}
@@ -432,4 +454,26 @@
 \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}

Modified: trunk/Master/texmf-dist/doc/latex/brandeis-problemset/example.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/tex/latex/brandeis-problemset/brandeis-problemset.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/brandeis-problemset/brandeis-problemset.cls	2018-10-25 21:33:56 UTC (rev 48988)
+++ trunk/Master/texmf-dist/tex/latex/brandeis-problemset/brandeis-problemset.cls	2018-10-25 21:34:13 UTC (rev 48989)
@@ -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 at boolkey{problem}{pagebreak}[true]{\ifKV at problem@pagebreak
 		\vfill\pagebreak
 	\else\fi}
-\define at cmdkey{problem}{number}{}
+\define at cmdkeys{problem}{number, label, partlabel}
+\define at cmdkey{problem}{part}[]{}
 \presetkeys{problem}{pagebreak}{}
 
 \NewDocumentEnvironment{problem}{O{}}{%
 	\setkeys{problem}{#1}%
-	\ifx\cmdKV at problem@number\undefined\stepcounter{problemnumber}%
+	\@ifundefined{cmdKV at problem@number}{%
+		\stepcounter{problemnumber}%
 		\newcommand{\cmdKV at problem@number}{\arabic{problemnumber}}%
-	\else\fi
-	\section{Problem \cmdKV at problem@number\problem at title}
+	}%
+	\@ifundefined{cmdKV at problem@part}{}{%
+		\part{\cmdKV at problem@part}%
+		\@ifundefined{cmdKV at problem@partlabel}{}{%
+			\expandafter\label{\cmdKV at problem@partlabel}
+		}%
+	}
+	\section{Problem \cmdKV at problem@number\problem at title}%
+	% fix up ref commands
+	\edef\@currentlabel{\cmdKV at problem@number}%
+	\edef\@currentlabelname{Problem \cmdKV at problem@number\problem at title}%
+	\@ifundefined{cmdKV at problem@label}{}{%
+		\expandafter\label{\cmdKV at problem@label}%
+	}%
 	\begin{adjustwidth}{\problemindent}{0pt}}
 	{\end{adjustwidth}}
 
@@ -310,11 +341,25 @@
 	by & \@author \\
 	\if\relax\problemset at course\else course & \problemset at course \\\fi
 	\if\relax\problemset at instructor\else instructor & \problemset at instructor \\\fi
-	\if\relax\problemset at due\else due & \problemset at due \\\fi
+	\if\relax\problemset at duedate\else due & \problemset at duedate \\\fi
 	\end{tabular}%
 	\end{center}%
 	\pagebreak}
 
+\renewcommand{\maketitle}{\thispagestyle{empty}%
+	%\vspace*{2in}%
+	\begin{center}%
+	\large\begin{tabular}{r|l}
+	\@ifundefined{problemset at assignment}{}{assignment & \problemset at assignment \\}
+	by & \@author \\
+	\@ifundefined{problemset at course}{}{course & \problemset at course \\}
+	\@ifundefined{problemset at instructor}{}{instructor & \problemset at instructor \\}
+	\@ifundefined{problemset at duedate}{}{due & \problemset at duedate \\}
+	\end{tabular}%
+	\end{center}%
+	\vspace*{2em}%
+	}
+
 \NewDocumentEnvironment{ganttschedule}{m o} % total size, title
 	{\ifgantt at loaded
 	\else



More information about the tex-live-commits mailing list