diff options
author | Karl Berry <karl@freefriends.org> | 2019-03-07 22:25:45 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-03-07 22:25:45 +0000 |
commit | 2915b13b4b4cd9a3c35eae7122d2b8604cd8b494 (patch) | |
tree | 47ed6313605b8c6927c7ca8a5e76863de22bd849 /Master/texmf-dist/doc/latex | |
parent | ac3543b34cf8626d011a6befdc4c9a9ffaefda5c (diff) |
brandeis-problemset (7mar19)
git-svn-id: svn://tug.org/texlive/trunk@50279 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex')
-rw-r--r-- | Master/texmf-dist/doc/latex/brandeis-problemset/README.md | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/brandeis-problemset/brandeis-problemset.pdf | bin | 64099 -> 81699 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/brandeis-problemset/brandeis-problemset.tex | 475 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/brandeis-problemset/example.pdf | bin | 49206 -> 49709 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/brandeis-problemset/example.tex | 37 |
5 files changed, 383 insertions, 131 deletions
diff --git a/Master/texmf-dist/doc/latex/brandeis-problemset/README.md b/Master/texmf-dist/doc/latex/brandeis-problemset/README.md index 1c8c654713e..00af4ab0311 100644 --- a/Master/texmf-dist/doc/latex/brandeis-problemset/README.md +++ b/Master/texmf-dist/doc/latex/brandeis-problemset/README.md @@ -13,4 +13,4 @@ brandeis-problemset.tex | Documentation source example.tex | Example problem set example.pdf | Example problem set README.md | This file -LICENSE.txt | LPPL v1.3c +LICENSE.txt | LPPL 1.3c diff --git a/Master/texmf-dist/doc/latex/brandeis-problemset/brandeis-problemset.pdf b/Master/texmf-dist/doc/latex/brandeis-problemset/brandeis-problemset.pdf Binary files differindex bc5bcfa7cc1..d3893baaafa 100644 --- a/Master/texmf-dist/doc/latex/brandeis-problemset/brandeis-problemset.pdf +++ b/Master/texmf-dist/doc/latex/brandeis-problemset/brandeis-problemset.pdf 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 433dfb83c5a..e17ac3e4028 100644 --- a/Master/texmf-dist/doc/latex/brandeis-problemset/brandeis-problemset.tex +++ b/Master/texmf-dist/doc/latex/brandeis-problemset/brandeis-problemset.tex @@ -1,16 +1,58 @@ +\PassOptionsToPackage{inline}{enumitem} \documentclass{ltxguidex} +\usepackage{fontspec} +\usepackage[pseudocode, solution, assembly, tabu]{brandeis-problemset} + +\usepackage{xkeyval} +\usepackage{xparse} \usepackage{textcomp} % needed for listings \usepackage{hologo} % xetex, etc. logos \usepackage{changelog} \newcommand{\bps}{\ltxclass{brandeis-problemset}} \newcommand{\fontspecok}{\hologo{XeLaTeX} or \hologo{LuaTeX}} -\newcommand{\cosi}[1]{\textsc{cosi}~#1} +\newcommand{\unicode}[1]{\textsc{u+#1}} +\NewDocumentCommand{\cosi}{o m}{\textsc{cosi}~#2\IfValueT{#1}{ (#1)}} \newnotice{todo}{To-do} -\usepackage{fontspec} +\newcommand{\reqopt}[1]{Requires the \texttt{\color{magenta}#1} option.\par} +\newcommand{\dep}[1]{{\noticestyle Warning:} deprecated since #1.\par} +\newcommand{\withopt}[1]{\fbox{With the \option{#1} option:}} + +\makeatletter +\renewcommand{\SX@explpreset}{ + language=[LaTeX]TeX, + numbers=none, +} +\define@cmdkeys{joinlist}{sep, wrapper} +\define@cmdkey{joinlist}{last}{\KV@joinlist@oxfordfalse} +\define@boolkey{joinlist}{oxford}[true]{} +\define@boolkey{joinlist}{and}[true]{\ifKV@joinlist@and\def\cmdKV@joinlist@last{and}\fi} +\define@boolkey{joinlist}{or} [true]{\ifKV@joinlist@or \def\cmdKV@joinlist@last{or}\fi} +\presetkeys{joinlist}{sep={,}, last=and, oxford, wrapper=\relax}{} +\NewDocumentCommand{\joinlist}{O{} >{\SplitList{,}} m} + {{\setkeys{joinlist}{#1}% + \newcommand{\joinlist@wrapper}[1]{\item\cmdKV@joinlist@wrapper{##1}}% + \begin{itemize*}[ + label={}, + itemjoin={\cmdKV@joinlist@sep}, + itemjoin*={\ifKV@joinlist@oxford\cmdKV@joinlist@sep\ \fi + \cmdKV@joinlist@last}]% + \ProcessList{#2}{\joinlist@wrapper}% + \end{itemize*}}} +\makeatother + +\makeatletter +\NewDocumentCommand{\withopts}{m} + {\fbox{With any of the \joinlist[or, wrapper=\option]{#1} options:}} +\makeatother +\newcommand{\onlyclass}{Only available in the \bps\ document class.} +\newcommand{\optenables}[2]{If \option{#1} is set, then \option{#2} is +automatically enabled.} + \setmainfont{Tiempos Text} \usepackage{FiraSans} \usepackage{FiraMono} +\lstset{basewidth=0.6em} \lstnewenvironment{latexfile}[1] {\lstset{ @@ -21,7 +63,7 @@ \author{Rebecca Turner\thanks{Brandeis University; \email{rebeccaturner@brandeis.edu}}} \title{The \bps\ Document Class} -\date{2019/02/14 0.4.4} +\date{2019/03/06 0.5.0} \begin{document} \maketitle \begin{abstract} @@ -47,12 +89,19 @@ \https{github.com/9999years/brandeis-problemset} \end{note} +\begin{note} + In roughly May 2021 I will graduate from Brandeis University and + this package will become unmaintained. Although I'd like the + computer science department to adopt this package, I'm not sure any + professors have an interest in that maintenance. If you care about + the extended future of this package, send some emails! +\end{note} + \tableofcontents \vfill \pagebreak \section{Default behavior} - \bps\ provides packages and well-formatted constructs (notably the |problem| environment) for problem-set writers. \bps\ will always render its body copy as a Times variant (\ctan{stix} for plain \LaTeX\ or @@ -61,18 +110,25 @@ contains the page number, author's name, course, instructor, and assignment due date). \subsection{Default packages loaded} +In general, \bps\ will only load a feature if it's useful in more than one +class; features like Gantt charts, Scheme code, assembly code, and so on, +are loaded on demand. \begin{enumerate} \item \ctan{hyperref}, for a nicely-linked table of contents; |\href||{url}{label}|. -\item \ctan{listings}, for verbatim code listings (including the - |assembly|, |java|, and |pseudocode| environments). -\item \ctan{xcolor}, for gray line numbers in code listings (and perhaps - colored listings in the future); e.g.\ |\color||{gray}|. +\item \ctan{geometry} for page size and margins. \item \ctan{enumitem} for better control over the margins and spacing of the |enumerate|, |itemize|, and |description| environments. -\item Math packages: \begin{enumerate} +\item \withopts{listings, scheme, pseudocode, assembly} +\begin{enumerate} + \item \ctan{listings}, for verbatim code listings (including the + |assembly|, |java|, and |pseudocode| environments). + \item \ctan{xcolor}, for colored identifiers, strings, comments, and + line numbers in listings; e.g.\ |\color||{gray}|. +\end{enumerate} +\item \withopt{math} \begin{enumerate} \item \ctan{amsmath} for tons of useful math commands, including |\text|, |\intertext|, and |\boxed| as well as the |bmatrix|, |multiline|, |gather|, |align|, and @@ -81,11 +137,14 @@ due date). Guide for the \package{amsmath} Package''} for a more complete listing. \item \ctan{mathtools} for other useful/utilitarian commands. + \item With \fontspecok, \ctan{unicode-math} to allow equations to be + copy-pasted. + \item The \ctan{stix2-otf} math fonts. \end{enumerate} -\item Table packages: \begin{enumerate} +\item \withopt{tabu} \begin{enumerate} \item \ctan{multirow} for cells spanning multiple rows. - \item \ctan{booktabs} for good-by-default tables and the |\cline| - macro. + \item \ctan{booktabs} for beautiful-by-default tables and the + |\cline| macro. \item \ctan{tabu}, the best table package with dynamically resizable columns, easy creation of new column types, and more. \end{enumerate} @@ -97,25 +156,78 @@ due date). Class options are limited to configuration options which require the loading of fonts or other packages; ``string'' settings like the assignment's due -date are configured either with the |\problemsetsetup| command or the -commands described in section~\ref{sss:configcommands}. +date are configured with the |\bpsset| command. + +All class options can be negated with |no<option>|; e.g.\ \option{scheme} +can be disabled with \option{noscheme}. Later options override previous +ones. \begin{keys} - \key{gantt} Load packages for the |ganttschedule| environment. - \key{scheme} Define the |scheme| language for the \ctan{listings} - package as well as the |scheme| shorthand environment. - \key{antonella} Use Dr.\ Antonella DiLillio's preferred styles (Courier - for code) - \key{solutions} Include |solution| environments in compiled - document. + \key{antonella} \onlyclass\ Use Dr.\ Antonella DiLillio's preferred + styles (Courier for code) + \key{tabu} \onlyclass\ Loads useful packages and defines commands for + typesetting tables. + \key{math} \onlyclass\ Loads utilities for typesetting mathematics. + Because mathematics requires specialized fonts\footnote{The + \textsc{stix2} math font that this package loads weighs in + at 740kb!} as well as several other specialized + packages,\footnote{Including \ctan{amsmath}, + \ctan{mathtools}, and, with \fontspecok, + \ctan{unicode-math}.} this is disabled by default. Although + I find myself needing mathematics fonts frequently, I know + many students do not. + \key[default=true]{listings} Enables code listings and enables + default styles for colored keywords, pretty line numbers, + and so on. While only this option enables the |java| + environment, the \option{scheme}, \option{assembly}, and + \option{pseudocode} options also load and style the + \ctan{listings} package. + \key{scheme} Enable Scheme language support, in particular for the + \textsc{r5rs} dialect. Additionally, provides the |scheme| + environment. + \key{pseudocode} Enables the |pseudocode| environment, notably + useful for \cosi[data structures]{21b}. + \key{assembly} Enables the |assembly| environment, notably useful + for \cosi[operating systems]{131a}. + \key{solution} Show the content of |solution| environments; by + default, they are excluded from compilation using the + \ctan{comment} package. + \key{gantt} Loads the |ganttschedule| environment. + \key[default=true]{maketitle} Redefines |\maketitle| and defines + |\maketitlepage| to include information about the course, + instructor, assignment, and due date. + \optenables{maketitle}{option}. + \key[default=true]{header} Adds a header to the top of every page including + information about the author, assignment, due date, and + instructor. \optenables{header}{option}. + \key[default=true]{config} Enables document metadata like the + assignment's due date, name/number, instructor, and course + through the |\bpsset| command, which supports |\maketitle|, + page headers, and so on. \end{keys} -\subsection{Setting options after loading \bps} +\subsubsection{Class options or keyval options?} +There's trade-offs to be made either way; class options greatly simplify the +code (we don't have to worry about loading packages and defining commands in +more than one place, for the most part), but are much less flexible and +difficult to interface with when the package loading is hidden. At the +moment, package/class options provide commands and keyval options define +document-configuration data (like names, due dates, and the like; see +section~\ref{s:config} for more information). +\subsection{Configuring \bps\ after loading}\label{s:config} \begin{desc} -|\problemsetsetup{<options>}| +|\bpsset{<options>}| \end{desc} -Sets global \bps\ options. +Sets global \bps\ options. Mnemonic: \textbf{B}randeis \textbf{p}roblem +\textbf{s}et \textbf{set}up (this should feel familiar to users of the +\ctan{listings} package). + +\begin{note} + |\bpsset| was renamed from |\problemsetsetup| in version 0.5.0. The + |\problemsetsetup| command is deprecated and will be removed in a + future release. +\end{note} \begin{keys} \key{course}[\m{course name}] @@ -131,7 +243,8 @@ Sets global \bps\ options. \href{https://en.wikipedia.org/wiki/ISO_8601}{\textsc{iso} 8601 dates} are highly recommended. \key{instructor}[\m{course instructor}] - Course instructor. + Course instructor. With the \option{antonella} class-option, this is + automatically set to |Dr.~Antonella DiLillio|. \key{author}[\m{your name}] Alternate interface for the |\author| command. \key{date}[\m{document date}] @@ -140,37 +253,13 @@ Sets global \bps\ options. With \fontspecok, pass the given font to |\setmonofont| and enable Unicode shortcuts for the |pseudocode| environment. (If you need to specify options to |\setmonofont|, use |\setcodefont|.) -\key{gantt}[\bool][false] - Load packages for the |ganttschedule| environment. -\key{antonella}[\bool][false] - Use Dr.\ Antonella DiLillio's preferred styles (Courier for code) -\key{solutions}[\bool][false] - Include |solution| environments in compiled document. \end{keys} -\subsubsection{Configuration commands}% -\label{sss:configcommands} - -\bps\ additionally provides a number of configuration commands for setting a -single opption with similar interfaces as the \TeX\ macros |\author|, -|\title|, and |\date|. - -\begin{desc}|\duedate{<date>}|\end{desc} Sets the due date in full. -\begin{desc}|\instructor{<name>}|\end{desc} Sets the instructor name. -\begin{desc}|\course{<name>}|\end{desc} Sets the course name in full. -\begin{desc}|\coursenumber{<number>}|\end{desc} Sets the course name by - number; e.g. |\coursenumber{21a}| gives a course of ``\cosi{21a}''. -\begin{desc}|\assignment{<name>}|\end{desc} Sets the assignment name in - full. -\begin{desc}|\problemsetnumber{<number>}|\end{desc} Sets the assignment name - by number; e.g. |\problemsetnumber{3}| gives an assignment of - ``Problem Set 3''. - \begin{desc} |\setcodefont[<fontspec options>]{<fontspec font name>}| \end{desc} -Sets the monospaced font to \meta{font name} and uses it for shortcuts in -the |pseudocode| environment. +Sets the monospaced font to \meta{fontspec font name} and uses it for +shortcuts in the |pseudocode| environment. \subsection{Practical usage} @@ -180,14 +269,18 @@ makes sense for them to live in the same directory as the problem set source files. For instance, \filename{cosi21a.cls} might read: \begin{latexfile}{cosi21a.cls} -\LoadClass[antonella]{brandeis-problemset} +\LoadClass[antonella, pseudocode]{brandeis-problemset} + +% pass all unknown options to brandeis-problemset +\DeclareOption*{\PassOptionsToClass + {\CurrentOption}{brandeis-problemset}} +\ProcessOptions\relax % set course/author data -\problemsetsetup{ - instructor=Dr.\ Antonella DiLillio, +\bpsset{ coursenumber=21a, + author=Rebecca Turner, } -\author{Rebecca Turner} % get a prettier code font -- these can be pretty big so they're not % loaded by default @@ -203,14 +296,18 @@ and then \filename{ps1.tex} might read: \begin{latexfile}{ps1.tex} \documentclass{cosi21a} % stuff specific to this assignment -\problemsetnumber{1} -\duedate{2018-10-29} +\bpsset{ + number=1, + duedate=2018-10-29, +} \begin{document} % etc. \end{document} \end{latexfile} -See section~\ref{sec:example} for a more complete example. +Note that you could use e.g.~|\documentclass[math]{cosi21a}| to add a +specific per-document option. See section~\ref{sec:example} for a more +complete example. \section{User commands and environments} @@ -221,7 +318,16 @@ See section~\ref{sec:example} for a more complete example. \end{desc} Defines a problem. A problem is set 1~inch from the left margin (although this amount may be customized by modifying the |\problemindent| length) and -begins a new page. |<options>| may include: +begins a new page. + +\begin{note} + The |problem| and |subproblem| environments are typeset using + |\section| and |\subsection| respectively, and as such can be + customized with styling packages like \ctan{titlesec}; note, + however, that they ignore and hide the usual section counters. +\end{note} + +|<options>| may include: \begin{keys} \key{title}[\m{problem title}] Displayed after ``Problem'' and the problem's number. @@ -234,6 +340,8 @@ begins a new page. |<options>| may include: Adds a custom label to the problem with |\label| that can be used with |\ref|. I recommend prefixing your problem labels with |p:| as in |p:big-o-proofs|. +\key{toc}[\bool][true] + Include this problem in the table of contents? \key{part}[\m{part name}] Indicates that this problem starts a new ``part'' of the assignment; actually calls |\part| under the hood. @@ -245,6 +353,41 @@ begins a new page. |<options>| may include: Vertical material is allowed in a~|problem|. \begin{desc} +|\begin{subproblem}[<options>]...\end{subproblem}| +\end{desc} +Defines a subproblem. A subproblem is set 1~inch from the left margin +(although this amount may be customized by modifying the |\subproblemindent| +length) and begins a new page. Valid |<options>| are identical to the +|problem| environment's, with the following exceptions: +\begin{keys} +\key[default=false]{pagebreak} + False by default. +\key{part} +\key{partlabel} + Not available in the |subproblem| environment. +\end{keys} + +\begin{example} + Note that although these examples are too short to display them, + vertical material --- including listings --- is allowed in the + |problem| and |subproblem| environments. +\end{example} +\begin{LTXexample}[preset={ + \presetkeys{problem}{toc=false}{} + \presetkeys{subproblem}{toc=false}{} + }] +\begin{problem} + This is a problem in an assignment. +\end{problem} + +Some solution here\dots + +\begin{subproblem} + This is a subproblem. +\end{subproblem} +\end{LTXexample} + +\begin{desc} |\begin{solution}...\end{solution}| \end{desc} @@ -260,18 +403,33 @@ assignment prompt and an answer key. |\solutionstyle|; it's defined to |\color{blue}| by default. \end{note} -\begin{desc} -|\subproblem[<problem description>]| -\end{desc} -Prints a sub-problem, i.e.\ a |\subsection|. It doesn't do very much at the -moment. +\begin{example} + The default solution style is shown below; note, however, that this + document is compiled with the \option{solution} option passed to + \bps; without it, the typeset solution is entirely blank. +\end{example} +\begin{LTXexample} +\begin{solution} + Some solution here\dots +\end{solution} +\end{LTXexample} \begin{desc} |\Th[<column spec>]{<header text>}| \end{desc} Typesets a table header in bold-face. |<column spec>| defaults to |l|. -Useful for when a column is wrapped in a math environment. +Useful for when a column is wrapped in a math environment; if you have a +column |>>{\ttfamily}l|, using |\Th| will not print the header in +|\ttfamily|. + +\begin{LTXexample} +\begin{tabular}{ll} +\Th{Server} & \Th{\textsc{ip}} \\ +juice & 1.1.1.1 \\ +dogs & 2.2.2.2 \\ +\end{tabular} +\end{LTXexample} \begin{desc} |\begin{pseudocode}[<keywords>]...\end{pseudocode}| @@ -280,7 +438,7 @@ Prints pseudocode.\footnote{Designed for \cosi{21a} as taught by Dr.\ Antonella DiLillo} Several ``shortcuts,'' which replace a source-code sequence like -\texttt{->} with a symbol like $\rightarrow$, are shown in +\texttt{->} with a symbol like \texttt{→}, are shown in table~\ref{tab:pseudocode}. These shortcuts display in |\pseudocodesymbolfont| (default: @@ -290,53 +448,50 @@ you use the \option{antonella} option with \fontspecok, \bps\ will load \ctan{lm-math} and display the symbols seen in table~\ref{tab:pseudocode}, which look significantly better with Courier than \ctan{stix}' symbols. +The following words are treated as keywords in pseudocode, and will be +bolded as appropriate: |Input|, |Output|, |Complexity|, |while|, |do|, +|return|, |for|, |to|, |if|, |then|, |else|, |True|, |False|, |None|, |and|, +|or|, |nil|, and |len|. + \begin{table}[h] \centering \caption{Shortcuts provided by the \texttt{pseudocode} environment}% \label{tab:pseudocode} - \begin{tabular}{lll} - \Th{Input} & \Th{Display} & \Th{Codepoint} \\ - \ttfamily <- & $\leftarrow$ & U+2190 \\ - \ttfamily -> & $\rightarrow$ & U+2192 \\ - \ttfamily (/) & $\emptyset$ & U+2205 \\ - \ttfamily inf & $\infty$ & U+221E \\ - \ttfamily != & $\ne$ & U+2260 \\ - \ttfamily >= & $\ge$ & U+2265 \\ - \ttfamily <= & $\le$ & U+2264 \\ + \begin{tabular}{llll} + \Th{Input} & \Th{Command} & \Th{Display} & \Th{Codepoint} \\ + \ttfamily <- & |\pseudocodeleftarrow| & \pseudocodeleftarrow & \unicode{2190} \\ + \ttfamily -> & |\pseudocoderightarrow| & \pseudocoderightarrow & \unicode{2192} \\ + \ttfamily (/) & |\pseudocodeemptyset| & \pseudocodeemptyset & \unicode{2205} \\ + \ttfamily inf & |\pseudocodeinfty| & \pseudocodeinfty & \unicode{221e} \\ + \ttfamily != & |\pseudocodene| & \pseudocodene & \unicode{2260} \\ + \ttfamily >= & |\pseudocodege| & \pseudocodege & \unicode{2265} \\ + \ttfamily <= & |\pseudocodele| & \pseudocodele & \unicode{2264} \\ \end{tabular} \end{table} -\begin{todo} - Improve the font selection mechanism; maybe provide a command for - each symbol? -\end{todo} - -\begin{todo} - If your \TeX\ engine doesn't support \textsc{utf}-8 input, the - shortcuts might appear totally blank or garbled. Good luck! It will - surely work with \fontspecok. -\end{todo} - -\begin{latexcode} -% the optional [Bar] makes [Bar] bold like the other keywords +\begin{example} + Note how the option |[Bar]| argument makes |Bar| appear bold like + any other keyword in the typeset listing. +\end{example} +\begin{LTXexample}[rframe=] \begin{pseudocode}[Bar] Bar(a, n) Input: two integers, a and n Output: a^n - k <- n # k is a counter - b <- 1 + k <- n # k is a counter + b <- inf c <- a - while k > 0 do + while k >= 0 do if k mod 2 = 0 then - k <- k/2 + k <- k / 2 c <- c * c else k <- k - 1 b <- b * c return b \end{pseudocode} -\end{latexcode} +\end{LTXexample} \begin{desc} |\begin{assembly}[<listings options>]...\end{assembly}| @@ -350,23 +505,27 @@ instructions are treated as keywords and styled appropriately. |<listings options>| is passed directly to the \ctan{listings} package. -\begin{latexcode} +\begin{LTXexample}[rframe=, wide, + explpreset={basicstyle=\small\ttfamily, basewidth=0.575em,}, + preset=\lstset{numbers=left, basicstyle=\small\ttfamily, basewidth=0.575em,},] \begin{assembly} - LOAD R4, $200 ; sum addr - LOAD R1, =0 ; sum - LOAD R2, =0 ; i - LOAD R3, =0 ; j - BR OUTER ; we know i < 10 -INNER: ADD R1, R3 ; sum += j - INC R3 ; j++ -OUTER: BLT R3, R2, INNER ; while j < i goto inner - INC R2 ; i++ - LOAD R3, =0 ; j = 0 - BLT R2, =10, OUTER ; while i < 10 - STORE R1, @R4 ; store sum into sum address - HALT +LOAD R4, $200 ; sum addr +LOAD R1, =0 ; sum +LOAD R2, =0 ; i +LOAD R3, =0 ; j +BR OUTER ; we know i < 10 +INNER: +ADD R1, R3 ; sum += j +INC R3 ; j++ +OUTER: +BLT R3, R2, INNER ; while j < i goto inner +INC R2 ; i++ +LOAD R3, =0 ; j = 0 +BLT R2, =10, OUTER ; while i < 10 goto outer +STORE R1, @R4 ; store sum +HALT \end{assembly} -\end{latexcode} +\end{LTXexample} \begin{desc} |\begin{java}[<listings options>]...\end{java}| @@ -407,13 +566,19 @@ active process (i.e.\ a process burst). \end{desc} Draw a burst for process |<pid>| of time length |<burst length>|. +\begin{note} + The Gantt chart packages (notably \ctan{tikz}) don't play nicely + with \ctan{ltxguidex}, the package this documentation is written in; + for a typeset example, see section~\ref{sec:example}. +\end{note} + \begin{latexcode} \begin{ganttschedule}{19} - \burst{2}{1} - \burst{4}{1} - \burst{3}{2} - \burst{5}{5} - \burst{1}{10} + \pid{2}{1} + \pid{4}{1} + \pid{3}{2} + \pid{5}{5} + \pid{1}{10} \end{ganttschedule} \end{latexcode} @@ -422,7 +587,7 @@ Draw a burst for process |<pid>| of time length |<burst length>|. \ctan{calc}, it can add significantly to document compile times. If you intend to use the |ganttschedule| environment, make sure to use the \option{gantt} class option or set \option{gantt} in - |\problemsetsetup|. If you fail to include the \option{gantt} + |\bpsset|. If you fail to include the \option{gantt} option, you will see an error message: \begin{latexcode} @@ -441,6 +606,26 @@ Did you mean to use the 'gantt' option for the brandeis-problemset document clas \subsection{General formatting commands} \begin{desc} +|\newacronym[<command>]{<acronym text>}|\\ +|\newacronyms{<acronym list>}| +\end{desc} + +Creates a new acronym. If |<command>| isn't given, the text of the macro +will be used instead; |\newacronym{cfg}| would define a command |\cfg| which +typesets as ``\ac{cfg}''. If the +resulting command already exists, it will be redefined. For |\newacronyms|, the +|<acronym list>| is a comma-delimited list of acronyms. + +\begin{LTXexample} +\newacronym[\xyz]{cfg} +A \xyz\ describes a context-free language\dots + +\newacronyms{sparc, cpu} +The \sparc\ had a unique \cpu\dots +\end{LTXexample} + + +\begin{desc} |\ac{<acronym>}| \end{desc} Typesets an acronym. The |<acronym>| should be lowercase (e.g.\ |\ac{cpu}| @@ -463,6 +648,13 @@ An abbreviation for |\textit|. \begin{desc}|\Tt{<text>}|\end{desc} An abbreviation for |\texttt|. +\section{A class and a package} +As a user, you'll likely only need the \bps\ document class. However, +a \emph{package} named \bps\ is also provided. The class styles an entire +document, while the package only provides commands. This allows --- for +example --- loading the package for the examples in this document without +messing up our titles, headers, and so on. + \section{Example}\label{sec:example} A brief example usage of \bps\ follows. For a longer, more in-depth example, @@ -473,7 +665,7 @@ in the \bps\ repository.} \begin{latexcode} \documentclass[gantt]{brandeis-problemset} \author{Rebecca Turner} -\problemsetsetup{ +\bpsset{ coursenumber=21a, instructor=Dr.\ Liuba Shrira, duedate=2018-10-20, @@ -531,16 +723,59 @@ $\Rm{Foo}(a, n)$ computes $a^n$, and will run in $O(n)$ time always. \end{problem} \begin{ganttschedule}{19} - \burst{2}{1} - \burst{4}{1} - \burst{3}{2} - \burst{5}{5} - \burst{1}{10} + \pid{2}{1} + \pid{4}{1} + \pid{3}{2} + \pid{5}{5} + \pid{1}{10} \end{ganttschedule} \end{document} \end{latexcode} \begin{changelog}[author=Rebecca Turner] +\begin{version}[v=Coming soon\dots] +\added + \item Support for \cosi{130b}, including regular expressions and + context-free grammars. +\end{version} + +\begin{version}[v=0.5.0, date=2019-03-06] +\added + \item |\newacronym| and |\newacronyms| commands. + \item Added \option{toc} option to the |problem| and |subproblem| + environments. +\changed + \item Cleaned up internals; improved option system, split \bps\ into + a class and a package, renamed commands and lengths to use the + |bps@| prefix more consistently. + \item \bps\ now has a modular and much more conservative approach; + far fewer packages are loaded and features are loaded only upon + request to a much greater extent. + \item |subproblem| is now an environment, not a command, with an + interface matching the |problem| environment. + \item The \option{assembly} and \option{pseudocode} options now + define languages for the \ctan{listings} package, rather than just + providing environments to use the languages. +\removed + \item The following commands have been removed in favor of the + |\bpsset| command, which encompasses their functionality + entirely: + |\duedate{<date>}|, + |\instructor{<name>}|, + |\course{<name>}|, + |\coursenumber{<number>}|, + |\assignment{<name>}|, and + |\problemsetnumber{<number>}|. + \item Removed dependencies: \ctan{environ} and \ctan{titlesec}. No + longer unconditionally loaded: \ctan{hyperref}, + \ctan{xcolor}, \ctan{comment}, \ctan{listings}, + \ctan{multirow}, \ctan{booktabs}, \ctan{longtable}, + \ctan{tabu}. +\deprecated + \item The |\problemsetsetup| command, which has been renamed + |\bpsset|. +\end{version} + \begin{version}[v=0.4.4, date=2019-02-14] \changed \item Changed Times body copy font from \ctan{tex-gyre}'s Termes to diff --git a/Master/texmf-dist/doc/latex/brandeis-problemset/example.pdf b/Master/texmf-dist/doc/latex/brandeis-problemset/example.pdf Binary files differindex 4a3c0913b6f..fda3fa7ad81 100644 --- a/Master/texmf-dist/doc/latex/brandeis-problemset/example.pdf +++ b/Master/texmf-dist/doc/latex/brandeis-problemset/example.pdf diff --git a/Master/texmf-dist/doc/latex/brandeis-problemset/example.tex b/Master/texmf-dist/doc/latex/brandeis-problemset/example.tex index 820da555ef2..4391fa2a38e 100644 --- a/Master/texmf-dist/doc/latex/brandeis-problemset/example.tex +++ b/Master/texmf-dist/doc/latex/brandeis-problemset/example.tex @@ -1,23 +1,39 @@ -\documentclass[gantt, scheme]{brandeis-problemset} -\author{Rebecca Turner} -\problemsetsetup{ +\documentclass[ + gantt, + scheme, + assembly, + math, + pseudocode, + tabu +]{brandeis-problemset} +\bpsset{ coursenumber=21a, + author=Rebecca Turner, instructor=Dr.\ Liuba Shrira, duedate=2018-10-20, number=3, } -\newcommand{\io}{\ac{io}} -\newcommand{\cpu}{\ac{cpu}} +\newacronyms{io, cpu} \begin{document} - \maketitle -\Bf{Note:} This example document is provided for illustrative purposes. The -solutions below are not guaranteed to be correct, complete, or relevant. +\Bf{Note:} This example document is provided to demonstrate the capability +and visual style of the +\href{https://ctan.org/pkg/brandeis-problemset}{\Tt{brandeis-problemset}} +document class. The solutions below are not guaranteed to be correct, +complete, or relevant. + +The source code for this document is available at +\begin{quote} + \href{http://mirrors.ctan.org/macros/latex/contrib/brandeis-problemset/example.tex}{\Tt{/macros/latex/contrib/brandeis-problemset/example.tex}} +\end{quote} +on \href{https://ctan.org/}{\textsc{ctan}} (or, if you have +\Tt{brandeis-problemset} installed, in your \TeX\ distribution's +documentation directory). \tableofcontents -\begin{problem}[part] +\begin{problem}[part=Textbook problems] An assembly language program implements the following loop: \begin{lstlisting}[language=c] @@ -104,7 +120,8 @@ LOOP: STORE R2, @R1 ; *A = i An example equation which defines $e$: \begin{equation} - \exists! e \in \Re \left(\int_1^e \frac{1}{t} dt = 1\right). + \exists! e \in \Re \text{ such that } + \int_1^e \frac{1}{t} dt = 1. \end{equation} The definition of the Mandelbrot set: |