texlive[50319] Master: brandeis-problemset (10mar19)

commits+karl at tug.org commits+karl at tug.org
Sun Mar 10 22:01:45 CET 2019


Revision: 50319
          http://tug.org/svn/texlive?view=revision&revision=50319
Author:   karl
Date:     2019-03-10 22:01:45 +0100 (Sun, 10 Mar 2019)
Log Message:
-----------
brandeis-problemset (10mar19)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/brandeis-problemset/README.md
    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
    trunk/Master/tlpkg/libexec/ctan2tds

Added Paths:
-----------
    trunk/Master/texmf-dist/tex/latex/brandeis-problemset/brandeis-problemset.sty

Modified: trunk/Master/texmf-dist/doc/latex/brandeis-problemset/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/brandeis-problemset/README.md	2019-03-10 21:00:33 UTC (rev 50318)
+++ trunk/Master/texmf-dist/doc/latex/brandeis-problemset/README.md	2019-03-10 21:01:45 UTC (rev 50319)
@@ -1,6 +1,6 @@
 # The `brandeis-problemset` document class
 
-Brandeis University's computer science (“cosi”) courses often assign “problem
+Brandeis University's computer science (“COSI”) courses often assign “problem
 sets” which require fairly rigorous formatting. The `brandeis-problemset`
 document class, which extends `article`, provides a simple way to typeset these
 problem sets in LaTeX.
@@ -8,6 +8,7 @@
 File                        | Description
 ----------------------------|------------------------------
 brandeis-problemset.cls     | The brandeis-problemset document class
+brandeis-problemset.sty     | Support package providing commands for the document class
 brandeis-problemset.pdf     | Documentation (English)
 brandeis-problemset.tex     | Documentation source
 example.tex                 | Example problem set

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	2019-03-10 21:00:33 UTC (rev 50318)
+++ trunk/Master/texmf-dist/doc/latex/brandeis-problemset/brandeis-problemset.tex	2019-03-10 21:01:45 UTC (rev 50319)
@@ -63,7 +63,7 @@
 
 \author{Rebecca Turner\thanks{Brandeis University; \email{rebeccaturner at brandeis.edu}}}
 \title{The \bps\ Document Class}
-\date{2019/03/06 0.5.0}
+\date{2019/03/09 0.5.1}
 \begin{document}
 \maketitle
 \begin{abstract}
@@ -739,6 +739,9 @@
 	context-free grammars.
 \end{version}
 
+\shortversion{v=0.5.1, date=2019-03-09, changes={Distribution erroneously
+	excluded \filename{brandeis-problemset.sty}.}}
+
 \begin{version}[v=0.5.0, date=2019-03-06]
 \added
 	\item |\newacronym| and |\newacronyms| commands.

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	2019-03-10 21:00:33 UTC (rev 50318)
+++ trunk/Master/texmf-dist/tex/latex/brandeis-problemset/brandeis-problemset.cls	2019-03-10 21:01:45 UTC (rev 50319)
@@ -1,4 +1,4 @@
-\ProvidesClass{brandeis-problemset}[2019/03/06 0.5.0 COSI problem sets at
+\ProvidesClass{brandeis-problemset}[2019/03/09 0.5.1 COSI problem sets at
 	Brandeis University]
 \NeedsTeXFormat{LaTeX2e}
 % Description: A document class for Brandeis University's computer science

Added: trunk/Master/texmf-dist/tex/latex/brandeis-problemset/brandeis-problemset.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/brandeis-problemset/brandeis-problemset.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/brandeis-problemset/brandeis-problemset.sty	2019-03-10 21:01:45 UTC (rev 50319)
@@ -0,0 +1,423 @@
+\ProvidesPackage{brandeis-problemset}[2019/03/09 0.5.1 Commands for COSI
+	problem sets at Brandeis University]
+\NeedsTeXFormat{LaTeX2e}
+
+% utility
+\RequirePackage{xparse}
+\RequirePackage{xkeyval}
+
+\RequirePackage{kvoptions}
+\SetupKeyvalOptions{
+	family=bps,
+	prefix=bps@,
+}
+
+% initializes complementary #1 and no#1 options
+\NewDocumentCommand{\bps at comploption}{O{false} m}{%
+	\DeclareBoolOption[#1]{#2}%
+	\DeclareComplementaryOption{no#2}{#2}}
+
+\bps at comploption{scheme}
+\bps at comploption{pseudocode}
+\bps at comploption{assembly}
+\bps at comploption{gantt}
+\bps at comploption{solution}
+\bps at comploption{maketitle}
+\bps at comploption{header}
+\bps at comploption{tabu}
+\bps at comploption{listings}
+\bps at comploption{config}
+\ProcessKeyvalOptions*
+
+\let\bps at comploption\relax
+
+\RequirePackage{changepage}
+
+\newif\iffontspec at ok
+\fontspec at okfalse
+\ExplSyntaxOn
+\sys_if_engine_luatex:T
+{
+	\fontspec at oktrue
+}
+\sys_if_engine_xetex:T
+{
+	\fontspec at oktrue
+}
+\ExplSyntaxOff
+
+\newif\ifbps at listingssetup
+\newcommand{\bps at setuplistings}{%
+	\ifbps at listingssetup
+	\else
+		\RequirePackage{listings}%
+		\lstset{
+			basicstyle=\ttfamily,
+			numbers=left,
+			numberstyle=\color{gray}\ttfamily,
+			aboveskip=1em,
+			belowskip=0.5em,
+			breaklines,
+			breakatwhitespace=true,
+			tabsize=4,
+			keywordstyle={\bf\ttfamily\color[rgb]{0,.3,.7}},
+			commentstyle={\color[rgb]{0.133,0.545,0.133}},
+			stringstyle={\color[rgb]{0.75,0.49,0.07}},
+		}%
+		\RequirePackage{xcolor}%
+		\bps at listingssetuptrue
+	\fi
+}
+
+\ifbps at listings
+	\bps at setuplistings
+	\lstnewenvironment{java}[1][]
+		{\lstset{language=java, #1}}
+		{}
+\fi
+
+\ifbps at scheme
+	\bps at setuplistings
+	% Language definition by Rebecca Turner and Andreas Stuhlmüller.
+	\lstdefinelanguage[R5RS]{Scheme}{
+		morekeywords={*,/,<=,<,=>,=,>=,>,+,-,%
+			% ``These procedures are compositions of car and cdr \dots\
+			% Arbitrary compositions, up to four deep, are provided. There are
+			% twenty-eight of these procedures in all.'' (6.3.2)
+			car,cbr,caar,cabr,cbar,cbbr,caaar,caabr,cabar,cabbr,cbaar,%
+			cbabr,cbbar,cbbbr,caaaar,caaabr,caabar,caabbr,cabaar,cababr,%
+			cabbar,cabbbr,cbaaar,cbaabr,cbabar,cbabbr,cbbaar,cbbabr,cbbbar,%
+			cbbbbr,%
+			% Define the rest of the primitives, from R5RS'
+			% \href{https://schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-15.html#%_chap_Temp_11}{``Alphabetic
+			% Index of Definitions of Concepts, Keywords, and Procedures''}
+			abs,acos,and,angle,append,apply,asin,assoc,%
+			assq,assv,atan,begin,boolean?,%
+			call-with-current-continuation,call-with-input-file,%
+			call-with-output-file,call-with-values,case,%
+			ceiling,char->integer,char-alphabetic?,char-ci<=?,char-ci<?,%
+			char-ci=?,char-ci>=?,char-ci>?,char-downcase,char-lower-case?,%
+			char-numeric?,char-ready?,char-upcase,char-upper-case?,%
+			char-whitespace?,char<=?,char<?,char=?,char>=?,char>?,char?,%
+			close-input-port,close-output-port,complex?,cond,cons,cos,%
+			current-input-port,current-output-port,define,define-syntax,delay,%
+			denominator,display,do,dynamic-wind,else,eof-object?,eq?,%
+			equal?,eqv?,eval,even?,exact->inexact,exact?,exp,expt,floor,%
+			for-each,force,gcd,if,imag-part,inexact->exact,inexact?,%
+			input-port?,integer->char,integer?,interaction-environment,lambda,%
+			lcm,length,let,let*,let-syntax,letrec,letrec-syntax,list,%
+			list->string,list->vector,list-ref,list-tail,list?,load,log,%
+			magnitude,make-polar,make-rectangular,make-string,make-vector,%
+			map,max,member,memq,memv,min,modulo,negative?,newline,not,%
+			null-environment,null?,number->string,number?,numerator,odd?,%
+			open-input-file,open-output-file,or,output-port?,pair?,peek-char,%
+			port?,positive?,procedure?,quasiquote,quote,quotient,rational?,%
+			rationalize,read,read-char,real-part,real?,remainder,reverse,%
+			round,scheme-report-environment,set!,set-car!,set-cdr!,setcar,%
+			sin,sqrt,string,string->list,string->number,string->symbol,%
+			string-append,string-ci<=?,string-ci<?,string-ci=?,string-ci>=?,%
+			string-ci>?,string-copy,string-fill!,string-length,string-ref,%
+			string-set!,string<=?,string<?,string=?,string>=?,string>?,%
+			string?,substring,symbol->string,symbol?,syntax-rules,tan,%
+			transcript-off,transcript-on,truncate,values,vector,vector->list,%
+			vector-fill!,vector-length,vector-ref,vector-set!,vector?,%
+			with-input-from-file,with-output-to-file,write,write-char,zero?},
+		otherkeywords={\#b,\#o,\#d,\#x,\#e,\#i,\#t,\#f,%
+			',`,{,},\,\@,...},
+		alsoletter={!\$\%&*/:<=>?@^_~+-},
+		alsodigit={.},
+		sensitive=true,
+		morecomment=[l]{;},
+		morecomment=[s]{\#|}{|\#},
+		morestring=[b]",
+		upquote=true,
+		literate=*{`}{{`}}{1}
+	}[keywords,comments,strings]
+	\lstset{
+		defaultdialect=[R5RS]Scheme
+	}
+	\lstnewenvironment{scheme}[1][]
+		{\lstset{language=Scheme, #1}}
+		{}
+\fi
+
+\ifbps at assembly
+	\bps at setuplistings
+	\lstdefinelanguage{assembly}{
+		keywords={LOAD,STORE,ADD,SUB,MUL,DIV,INC,SKIP,BR,BLT,BGT,BLEQ,BGEQ,
+			BEQ,BNEQ,READ,WRITE,HALT},
+		firstnumber=-3,
+		numberstyle={\color{gray}\ttfamily\addtocounter{lstnumber}{3}x +\ },
+		morecomment=[l]{;},
+	}
+	\lstnewenvironment{assembly}[1][]
+		{\lstset{language=assembly, #1}}{}
+\fi
+
+\ifbps at gantt
+	\RequirePackage{tikz}
+	\RequirePackage{fp}
+	\RequirePackage{calc}
+	\newcounter{bps at gantt@time}
+	\newcounter{bps at gantt@time at after}
+	\newlength{\bps at gantt@unit}
+	\NewDocumentEnvironment{ganttschedule}{m o} % total size, title
+		{\setlength{\bps at gantt@unit}{\linewidth / \real{#1}}%
+		\setcounter{bps at gantt@time}{0}%
+		\DeclareDocumentCommand{\burst}{m m} % pid, burst
+			{\setcounter{bps at gantt@time at after}{\value{bps at gantt@time}}%
+			\addtocounter{bps at gantt@time at after}{##2}%
+			\FPeval\gantthalf{(\arabic{bps at gantt@time}
+				+ \arabic{bps at gantt@time at after}) / 2}%
+
+			\draw (\value{bps at gantt@time}, 0) rectangle
+				(\value{bps at gantt@time at after}, 1);
+			\node at (\gantthalf, 0.5) {$P_{##1}$};
+			\draw [|<->|] (\value{bps at gantt@time} + 0.05, 1.25)
+				-- node[above=1mm] {##2}
+				(\value{bps at gantt@time at after} - 0.05, 1.25);
+
+			\setcounter{bps at gantt@time}{\value{bps at gantt@time at after}}}%
+
+		\IfValueT{#2}{\begin{center} #2 \end{center}}%
+		\begin{tikzpicture}[x=\bps at gantt@unit]}
+		{\end{tikzpicture}}
+\else
+	\NewDocumentEnvironment{ganttschedule}{m o}
+		{\PackageError{brandeis-problemset}{ganttschedule enviornment
+			not loaded in preamble}{Did you mean to use the 'gantt'
+			option for the brandeis-problemset package/document
+			class?}}{}
+\fi
+
+\let\pseudocodesymbolfont\ttfamily
+\ifbps at pseudocode
+	\bps at setuplistings
+	% pseudocode commands
+	\iffontspec at ok
+		% use unicode shortcuts
+		\newcommand{\bps at pcsym}[2]
+			{\expandafter\providecommand
+				\csname pseudocode#1\endcsname
+				{\pseudocodesymbolfont #2}}
+		\bps at pcsym{leftarrow} {←}
+		\bps at pcsym{rightarrow}{→}
+		\bps at pcsym{le}        {≤}
+		\bps at pcsym{ge}        {≥}
+		\bps at pcsym{emptyset}  {∅}
+		\bps at pcsym{ne}        {≠}
+		\bps at pcsym{infty}     {∞}
+		\@ifundefined{lmmath}{\@ifundefined{newfontface}{}{%
+			\newfontface{\lmmath}{latinmodern-math.otf}%
+		}}{}%
+		\@ifundefined{lmmath}{}{%
+			\let\pseudocodesymbolfont\lmmath
+		}%
+	\else
+		% use math-mode fallbacks
+		\newcommand{\bps at pcsym}[2]
+			{\expandafter\providecommand
+				\csname pseudocode#1\endcsname
+				{\ensuremath{#2}}}
+		\bps at pcsym{leftarrow} {\leftarrow}
+		\bps at pcsym{rightarrow}{\rightarrow}
+		\bps at pcsym{le}        {\le}
+		\bps at pcsym{ge}        {\ge}
+		\bps at pcsym{emptyset}  {\emptyset}
+		\bps at pcsym{ne}        {\ne}
+		\bps at pcsym{infty}     {\infty}
+	\fi
+
+	\lstdefinelanguage{Pseudocode}{
+		keywords={Input,Output,Complexity,while,do,return,for,to,if,then,else,True,False,None,and,or,nil,len},
+		literate={<-}{{\pseudocodeleftarrow}}2
+			{->} {{\pseudocoderightarrow}}2
+			{(/)}{{\pseudocodeemptyset}}2
+			{inf}{{\pseudocodeinfty}}3
+			{!=} {{\pseudocodene}}2
+			{>=} {{\pseudocodege}}2
+			{<=} {{\pseudocodele}}2,
+		morecomment=[l]{\#},
+	}
+
+	\lstnewenvironment{pseudocode}[1][]
+		{\lstset{
+			language=Pseudocode,
+			morekeywords={#1},
+		}}{}
+\fi
+
+\let\bps at setuplistings\relax
+
+% tables
+\ifbps at tabu
+	\ProvideExpandableDocumentCommand{\Th}{O{l} m}
+		{\multicolumn{1}{#1}{\Bf{#2}}}
+\fi
+
+\newcommand{\solutionstyle}{\color{blue}}
+\ifbps at solution
+	\newenvironment{solution}
+		{\solutionstyle}
+		{}
+\else
+	\RequirePackage{comment}
+	\excludecomment{solution}
+\fi
+
+\ifbps at maketitle
+	\bps at configtrue
+\fi
+\ifbps at header
+	\bps at configtrue
+\fi
+
+\ifbps at config
+	% config commands
+	\define at cmdkeys{bps}[bps@]{duedate, instructor, course, assignment}
+	% wrappers
+	\define at key{bps}{author}{\author{#1}}
+	\define at key{bps}{date}{\date{#1}}
+
+	% helpers
+	\define at key{bps}{number}{\def\bps at assignment{Problem Set #1}}
+	\define at key{bps}{coursenumber}{\def\bps at course{\textsc{cosi} #1}}
+	\define at key{bps}{codefont}{\setcodefont{#1}}
+	\newcommand{\bpsset}[1]{\setkeys{bps}{#1}}
+	\let\problemsetsetup\bpsset
+\fi
+
+\ifbps at maketitle
+	\NewDocumentCommand{\bps at titlerow}{o m}{\@ifundefined{bps@#2}{}%
+		{\IfValueTF{#1}{#1}{#2} & \csname bps@#2\endcsname \\}}
+
+	\renewcommand{\maketitle}{\thispagestyle{empty}%
+		\begin{center}%
+			\Large\begin{tabular}{r|l}
+			\bps at titlerow{assignment}%
+			by & \@author \\
+			\bps at titlerow{course}%
+			\bps at titlerow{instructor}%
+			\bps at titlerow[due]{duedate}%
+		\end{tabular}%
+		\end{center}%
+		\vspace*{2em}}
+
+	\newcommand{\maketitlepage}{\thispagestyle{empty}%
+		\vspace*{2in}%
+		\maketitle
+		\pagebreak}
+\fi
+
+\ifbps at header
+	% page headers
+	\RequirePackage{fancyhdr}
+	\fancyhf{}
+	\lhead{\@author
+		\hfill
+		\@ifundefined{bps at assignment}{}{\bps at assignment}%
+		\@ifundefined{bps at duedate}{}{\ (due \bps at duedate)}\hfill
+		\@ifundefined{bps at instructor}{}{\bps at instructor\hfill}%
+		\thepage}
+	\setlength{\headheight}{24pt}
+	\fancypagestyle{plain}{\fancyhead[L]{}}
+	\AtBeginDocument{\pagestyle{fancy}}
+\fi
+
+\let\ac\textsc
+
+\ProvideDocumentCommand{\newacronym}{o m}
+	{\IfValueTF{#1}%
+		{\def#1{\ac{#2}}}%
+		{\expandafter\def\csname #2\endcsname{\ac{#2}}}}
+
+\ProvideDocumentCommand{\newacronyms}{>{\SplitList{,}} m}
+	{\ProcessList{#1}{\newacronym}}
+
+% #1: env name
+% #2: pagebreak default
+\newcommand{\bps at problemkeys}[2]{%
+	\expandafter\newlength\csname bps@#1indent\endcsname
+	\expandafter\setlength\csname bps@#1indent\endcsname{1in}%
+	\expandafter\def\csname bps@#1 at title\endcsname{}%
+	\expandafter\def\csname bps@#1 at number\endcsname{\arabic{#1number}}%
+	\define at key{#1}{title}{%
+		\expandafter\renewcommand{\csname bps@#1 at title\endcsname}{: #1}}%
+	\expandafter\def\csname bps@#1pagebreak\endcsname{%
+		\csname ifKV@#1 at pagebreak\endcsname
+			\vfill\pagebreak
+		\fi}%
+	\define at boolkey{#1}{pagebreak}[true]{\csname bps@#1pagebreak\endcsname}%
+	\expandafter\def\csname bps@#1 at tocstar\endcsname{%
+		\csname ifKV@#1 at toc\endcsname
+		\else
+			*%
+		\fi}%
+	\define at boolkey{#1}{toc}[true]{}%
+	\define at cmdkeys{#1}{number, label}%
+	\presetkeys{#1}{pagebreak=#2, toc}{}%
+}
+
+\newcounter{problemnumber}
+\newcounter{subproblemnumber}[problemnumber]
+\bps at problemkeys{problem}{true}
+\bps at problemkeys{subproblem}{false}
+\define at cmdkeys{problem}{partlabel}
+\define at cmdkey{problem}{part}[]{%
+	\part{\cmdKV at problem@part}%
+	\@ifundefined{cmdKV at problem@partlabel}{}{%
+		\expandafter\label{\cmdKV at problem@partlabel}%
+	}%
+}
+
+% common code for subproblem and problem envs
+% #1: env name
+% #2: @currentlabel code
+% #3: sectioning command
+\newcommand{\bps at problem@}[3]{%
+	% define problem number based on user input (or lack thereof)
+	\@ifundefined{cmdKV@#1 at number}{%
+		\stepcounter{#1number}%
+	}{%
+		\expandafter\let\csname bps@#1 at number\expandafter\endcsname
+			\csname cmdKV@#1 at number\endcsname
+	}%
+	% define labels for \ref and the like
+	\edef\@currentlabel{#2}%
+	\edef\bps at problem@title@{Problem \@currentlabel\csname bps@#1 at title\endcsname}
+	\edef\@currentlabelname{\bps at problem@title@}%
+	% no spaces or numbers before the \section command
+	\renewcommand{\@seccntformat}[1]{}%
+	\typeout{\@currentlabelname}
+	\csname ifKV@#1 at toc\endcsname
+		\def\bps at problem@section{#3}%
+	\else
+		\def\bps at problem@section{#3*}%
+	\fi
+	% make the section (#3 is \section or something)
+	% NOTE: If you use \@currentlabelname for the title, the document
+	% will pause on compilation on this line; I don't know why this is,
+	% but it goes away if hyperref isn't loaded (my guess is that
+	% hyperref redefines \@currentlabelname to do something weird and
+	% possibly-recursive with \@currentlabel). Either way, defining an
+	% alternate command for the title works here.
+	\bps at problem@section{\bps at problem@title@}%
+	% fix up ref commands
+	\@ifundefined{cmdKV@#1 at label}{}{%
+		\expandafter\label{\csname cmdKV@#1 at label\endcsname}%
+	}%
+}
+
+\NewDocumentEnvironment{problem}{O{}}{%
+	\setkeys{problem}{#1}%
+	\@ifundefined{cmdKV at problem@number}{}{\setcounter{subproblemnumber}{0}}%
+	\bps at problem@{problem}{\bps at problem@number}{\section}%
+	\begin{adjustwidth}{\bps at problemindent}{0pt}}
+	{\end{adjustwidth}}
+
+% make sure to keep this code in sync with the problem env code
+\NewDocumentEnvironment{subproblem}{O{}}{%
+	\setkeys{subproblem}{#1}%
+	\bps at problem@{subproblem}{\bps at problem@number.\bps at subproblem@number}{\subsection}%
+	\begin{adjustwidth}{\bps at subproblemindent}{0pt}}
+	{\end{adjustwidth}}


Property changes on: trunk/Master/texmf-dist/tex/latex/brandeis-problemset/brandeis-problemset.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/libexec/ctan2tds
===================================================================
--- trunk/Master/tlpkg/libexec/ctan2tds	2019-03-10 21:00:33 UTC (rev 50318)
+++ trunk/Master/tlpkg/libexec/ctan2tds	2019-03-10 21:01:45 UTC (rev 50319)
@@ -1661,7 +1661,6 @@
  'blockdraw_mp','NULL',                 # skip .sty's
  'booktabs-de', 'NULL',                 # doc package
  'booktabs-fr', 'NULL',                 # doc package
- 'brandeis-problemset', '\.cls',	# not *-doc.sty
  'breqn',       '\.sty|\.sym',
  'c-pascal',    '^[^d].*\.tex|' . $standardtex, # not demo*.tex
  'calxxxx',     'cal.*\.tex',



More information about the tex-live-commits mailing list