Debian Codegraph @

texmf-dist/doc/latex/studenthandouts/studenthandouts-doc.tex

raw
1 \documentclass[10pt,oneside,letterpaper]{article}
2
3 %
4 % TABLE OF CONTENTS STUFF
5 %
6 \usepackage{tocloft}
7 \tocloftpagestyle{empty}
8 \renewcommand{\cftsubsecfont}{\it}
9 \renewcommand{\cftsecleader}{\hspace{0.25cm}}%\textbullet\hspace{0.25cm}}
10 \renewcommand{\cftsecafterpnum}{\cftparfillskip}
11 \renewcommand{\cftsubsecleader}{\hspace{0.25cm}}%$\cdot$\hspace{0.25cm}}
12 \renewcommand{\cftsubsecafterpnum}{\cftparfillskip}
13 \renewcommand{\cftsubsubsecleader}{\hspace{0.25cm}}%$\cdot$\hspace{0.25cm}}
14 \renewcommand{\cftsubsubsecafterpnum}{\cftparfillskip}
15 \renewcommand{\cftpnumalign}{l}
16
17
18
19
20
21 %
22 % INDEXING STUFF
23 %
24 \usepackage{makeidx}
25 \usepackage[columns=1,initsep=20pt,totoc=true]{idxlayout}
26 \makeindex
27
28 \newcommand{\indexcommand}[1]{
29 \index{\texttt{#1}}%
30 \marginpar{\texttt{\textbackslash#1}}%
31 }
32 \renewcommand\indexname{Index of commands}
33
34
35 %
36 % TIKZ
37 %
38 \usepackage{tikz}
39 \usetikzlibrary{decorations.pathreplacing}
40
41
42 %
43 % HEADER AND FOOTER STYLING
44 %
45 \usepackage{fancyhdr}
46 \pagestyle{fancy}
47 \renewcommand{\headrulewidth}{0pt}
48 \fancyfoot{}
49 \fancyhead{}
50 \fancyhead[R]{\it The Student Handouts Package $\cdot$ \thepage}
51 \newcommand{\pdf}{\textsc{pdf} }
52 \newcommand{\Latex}{La\textsc{t}e\textsc{x} }
53
54
55
56
57 %
58 % FONT STUFF
59 %
60 \frenchspacing
61 \usepackage[oldstyle]{libertine}
62 \usepackage[T1]{fontenc}
63 \linespread{1.1}
64 \usepackage{verbatim}
65 %The mono spaced font
66 \usepackage{inconsolata}
67
68 \title{\vspace{-2\baselineskip}The Student Handouts Package}
69 \author{James Fennell\\{\normalsize [email protected]}}
70
71
72 \begin{document}
73
74
75 \maketitle
76
77 \noindent
78 The Student Handouts package, \texttt{studenthandouts}, is used to generate a single master document that contains a set of individual student handouts.
79
80
81 The package has two main functions.
82
83 First, it provides a simple framework for organizing handout source code, and supplies a set of
84 import management tools for selectively importing a subset of the handouts into the master document.
85 Selective import is convenient when compilation of all of the handouts is unnecessary, for example when working on a new handout.
86
87 As a secondary feature, the package defines a basic visual style for handouts.
88 This style can be easily changed.
89
90
91
92 \tableofcontents
93
94 %\section{Managing handouts with the studenthandouts package}
95
96
97
98
99
100 \vfill
101
102 \noindent
103 [\emph{Student handouts version 1.0; this documentation compiled \today.}]
104
105
106
107 \section{Basic usage of the package}
108
109
110
111 This package is used as an aid in managing and compiling student handouts.
112 When using this package, the \Latex source for the handouts project as a whole is divided between a
113 single master file and individual handout files, one for each handout.
114 This section describes the details of this structure and the basic method for importing handouts into the master document.
115 All of these features can be seen in the sample code that is distributed with the package.
116
117
118
119
120 The handouts master file, into which all of the handouts are imported during compilation, is a standard \Latex file that includes this
121 package.
122 Place the usual command in the preamble of this file:
123 \begin{verbatim}
124 \usepackage{studenthandouts}
125 \end{verbatim}
126 For options that may be passed through \texttt{usepackage}, see section \ref{sec:options} below.
127
128 The source for the handouts themselves is stored in a subdirectory of the directory containing the master document.
129 By default, this subdirectory is \texttt{./handouts/}.
130 This directory can be changed; see subsection \ref{sec:variables} below.
131
132 The package imposes a one-level organizational structure on the handouts.
133 Each handout is a member of a numbered \emph{unit} and within that unit has a unique handout number.
134 Handout 1.1 is the first handout in unit one.
135 The source for handout 1.1 is, by default, stored in
136 \begin{verbatim}
137 ./handouts/handout-1-1.tex
138 \end{verbatim}
139 Handout 3.4 is the fourth handout in unit three and its source is stored in
140 \begin{verbatim}
141 ./handouts/handout-3-4.tex
142 \end{verbatim}
143 The work `unit' is intentionally generic.
144 When working on a specific project units may represent, for example, individual lessons, or chapters in the textbook the handouts are based on.
145
146 The organizational structure is loose.
147 For example, there is no requirement that handouts begin at the beginning and proceed sequentially: the first handout can be handout 10.521 if desired.
148
149
150 The source file\indexcommand{sethandouttitle}%
151 for a specific handout begins with a \texttt{sethandouttitle} command and is followed by the \Latex code for the handout proper.
152 Place this line at the start:
153 \begin{verbatim}
154 \sethandoutitle{<Title of the handout>}
155 \end{verbatim}
156 If the handout does not have a title, execute the command with an empty argument:
157 \begin{verbatim}
158 \sethandouttitle{}
159 \end{verbatim}
160 %The command \texttt{handouttitle} must be executed in all cases.
161
162
163 Once\indexcommand{importhandout}%
164 there is a source file for handout \emph{n.m}, it is imported into the master document through the \texttt{importhandout} command. % in the master document.
165 Place this command in the master document at the point the handout is to appear:
166 \begin{verbatim}
167 \importhandout{n}{m}
168 \end{verbatim}
169 Again, \emph{n} is the unit number and \emph{m} is the unique number of the handout within the unit.
170
171
172 \section{Handout import management}
173
174
175 After writing a number of handouts, the master document will have many handout import commands.
176 However at a given time it may not be desirable to compile all of the handouts in the project.
177 For example, if working on a new handout it is faster to only compile the new work when error checking.
178 If collaborating, it may be necessary to compile just a certain subset of the handouts to share.
179
180 The import management tools are designed for these situations.
181 The basic mechanism is that when handout \emph{n.m} is set to be imported the package first checks, based on previous instructions, whether
182 unit \emph{n} is to be imported, and if so whether handout \emph{n.m} specifically is to be imported.
183 By default all units and handouts are imported.
184
185 The instructions for which handouts are to be imported are given through the commands that follow.
186 The instructions may be changed at any point in the master file, even after some of the handouts have already been imported.
187
188 \begin{itemize}
189
190 \item \verb$\importall$ \indexcommand{importall}
191
192 Import all handouts.
193 This is the default behavior.
194 The \texttt{importall} command is used to reset to the default behavior after other instructions have been given.
195
196 \item \verb$\importnone$ \indexcommand{importnone}
197
198 Import none of the handouts.
199
200 \item \verb$\importonlyunits{$\emph{<unit numbers>}\verb$}$ \indexcommand{importonlyunits}
201
202 Import only those units whose unit numbers appear in \emph{<unit numbers>}. The argument \emph{<unit numbers>} is a comma separated list of numbers with no spaces.
203 Example usage:
204 \begin{verbatim}
205 \importonlyunits{1,2,4}
206 \end{verbatim}
207
208
209 \item \verb$\importallunits$ \indexcommand{importallunits}
210
211 Reverse the last command by removing any unit importing restrictions.
212 The difference between this command and \texttt{importall} is that if any specific handout restrictions have been imposed then
213 those restrictions still stand.
214
215
216 \item \verb$\importonlyhandouts{$\emph{<handout numbers>}\verb$}$ \indexcommand{importonlyhandouts}
217
218 Import only those handouts whose full handout number \emph{n.m} appears in \emph{<unit numbers>}.
219 The argument \emph{<unit numbers>} is a comma separated list of handout numbers with no spaces.
220 Example usage:
221 \begin{verbatim}
222 \importonlyhandouts{5.2,6.5,6.6}
223 \end{verbatim}
224
225
226 \item \verb$\importallhandouts$ \indexcommand{importallhandouts}
227
228 Reverse the last command by removing any specific handout importing restrictions.
229 The difference between this command and \texttt{importall} is that if any specific unit restrictions have been imposed then
230 those restrictions still stand.
231
232
233 \end{itemize}
234
235 An important feature is that the import instructions can be changed on the fly.
236 For example with the following code
237 \begin{verbatim}
238 \importnone
239 \importhandout{1}{1}
240 \importhandout{1}{2}
241 \importonlyhandouts{1.3,2.1}
242 \importhandout{1}{3}
243 \importhandout{2}{1}
244 \importhandout{2}{2}
245 \importhandout{2}{3}
246 \importall
247 \importhandout{2}{4}
248 \end{verbatim}
249 handouts 1.3, 2.1 and 2.4 will be imported.
250
251 In particular, in the import context the \texttt{importnone} and \texttt{importall} commands work similarly to
252 \verb$\begin{comment}$ and \verb$\end{comment}$ respectively.
253
254
255 \section{Options and variables}
256
257
258 \subsection{The blanks option}
259
260 \label{sec:options}
261
262
263 The package has one option: \texttt{blanks} or \texttt{noblanks}, with \texttt{blanks} as default.
264
265 The \texttt{blanks} option places a blank page after every handout that has an odd number of pages.
266 That way, the compiled handouts document can be printed double sided, and handouts with an odd number of pages will still be on their own sheet.
267
268 To see how the \texttt{blanks} options achieves this, see Figure \ref{fig:blanks}.
269 In this example there are three handouts: 1.1 with one page, 1.2 with two pages, and 1.3 with one page.
270 It is required that 1.2 be distributed double-sided.
271
272
273 In the first case in Figure \ref{fig:blanks}, the handouts are compiled one after another with the \texttt{noblanks} option.
274 If the resulting document is printed at once double-sided,
275 the back of handout 1.1 will contain the first page of handout 1.2, and the next sheet will contain the second page of handout 1.2 with handout 1.3 on the reverse.
276 In order to print the handouts correctly with this \pdf file, separate print calls for each of the three handouts are required.
277
278 On the other hand, with the \texttt{blanks} option, the resulting \pdf document can just be printed double sided at once.
279 The first sheet will contain handout 1.1 on the front, and the blank page after 1.1 on the back.
280 The next sheet will have the two pages of handout 1.2 back-to-back, and the last sheet will have handout 1.3 by itself.
281
282
283
284
285
286 \newcommand{\handoutimage}[3]{
287 \draw[white] #1 -- ++(-0.05,0.15) coordinate(hib) -- ++(-0.03,1) coordinate(hia) {};
288 \draw[white] #1 -- ++(0.5,0.8) coordinate (hic) {};
289 \node[anchor=west] at (hia) {\footnotesize #2};
290 \node[anchor=west] at (hib) {\tiny p.#3};
291 %\draw (hic) rectangle ++ (0.5,0.5);
292 \draw #1 rectangle ++ (1,1.3);
293 }
294
295
296 \newcommand{\handoutimageb}[3]{
297 \draw[white] #1 -- ++(-0.05,0.15) coordinate(hib) -- ++(-0.03,1) coordinate(hia) {};
298 \draw[white] #1 -- ++(0.5,0.8) coordinate (hic) {};
299 %\draw (hic) rectangle ++ (0.5,0.5);
300 \draw #1 rectangle ++ (1,1.3);
301 }
302
303
304 \newcommand{\handoutimagedbl}[5]{
305 \draw[white] #1 -- ++(-0.05,0.15) coordinate(hib) -- ++(-0.03,1) coordinate(hia) {};
306 \draw[white] #1 -- ++(0.5,1.3) coordinate (hic) {};
307
308 \node[anchor=west] at (hia) {\footnotesize #2};
309 \node[anchor=west] at (hib) {\tiny p.#3};
310
311
312 \node[anchor=west,rotate around={65:(hic)}] at (hia) {\footnotesize #4};
313 %\node[anchor=west,rotate around={65:(hic)}] at (hib) {\tiny p.#5};
314
315 \fill[white] (hic) -- ++(0.5,-0.75) -- ++(0,0.75) -- cycle;
316
317 \draw (hic) -- ++(0.5,-0.75);
318 %\draw #1 -- ++(1,0) -- ++(0,0.1) -- ++(-0.85,0.85) -- ++(0.35,0.35) -- ++(-0.5,0) -- cycle;
319 \draw #1 -- ++(1,0) -- ++(0,0.55) -- ++(-0.725,0.30) -- ++(0.225,0.45) -- ++(-0.5,0) -- cycle;
320 }
321
322 \begin{figure}
323 \begin{tikzpicture}[scale=0.95]
324 %\draw[blue] (0,0) grid (12,5);
325
326 \handoutimage{(0,3)}{1.1}{1}
327 \handoutimage{(1.2,3)}{1.2}{1}
328 \handoutimagedbl{(0.6,1)}{1.1}{1}{1.2}{1}
329
330
331 \handoutimage{(2.4,3)}{1.2}{2}
332 \handoutimage{(3.6,3)}{1.3}{1}
333 \handoutimagedbl{(3,1)}{1.2}{2}{1.3}{1}
334
335 \handoutimage{(5.4,3)}{1.1}{1}
336 \handoutimageb{(6.6,3)}{}{1}
337 \handoutimagedbl{(6,1)}{1.1}{1}{}{}
338
339 \handoutimage{(7.8,3)}{1.2}{1}
340 \handoutimage{(9,3)}{1.2}{2}
341 \handoutimagedbl{(8.4,1)}{1.2}{1}{1.2}{2}
342
343
344 \handoutimage{(10.2,3)}{1.3}{1}
345 \handoutimageb{(11.4,3)}{}{}
346 \handoutimagedbl{(10.8,1)}{1.3}{1}{}{}
347
348 \draw [decorate,decoration={brace,amplitude=6pt}] (2.2,2.8) -- (0,2.8) node {};
349 \draw [decorate,decoration={brace,amplitude=6pt}] (4.6,2.8) -- (2.4,2.8) node {};
350
351 \draw [decorate,decoration={brace,amplitude=6pt}] (7.6,2.8) -- (5.4,2.8) node {};
352 \draw [decorate,decoration={brace,amplitude=6pt}] (10,2.8) -- (7.8,2.8) node {};
353 \draw [decorate,decoration={brace,amplitude=6pt}] (12.4,2.8) -- (10.2,2.8) node {};
354
355 \node at (2.3,4.8){\texttt{noblanks}};
356 \node at (8.8,4.8){\texttt{blanks}};
357 \end{tikzpicture}
358 \caption{Comparison of the outcome of printing the compiled handouts document double-sided.
359 On the left is the handouts document compiled with the option \texttt{noblanks}; on the right
360 is the same document compiled with the option \texttt{blanks}.}
361 \label{fig:blanks}
362 \end{figure}
363
364 \subsection{Variables}
365 \subsubsection{The handouts subdirectory}
366
367 \label{sec:variables}
368
369 By default
370 \indexcommand{thehandoutsdirectory}%
371 the handouts are stored in the subdirectory \texttt{handouts/} of the directory that contains the master document.
372 Change this be redefining
373 % the variable
374 \texttt{thehandoutsdirectory}:
375 \begin{verbatim}
376 \renewcommand{\thehandoutsdirectory}{worksheets/}
377 \end{verbatim}
378 It is necessary to place a forward slash at the end.
379
380 If the handouts files are to be stored in the same directory as the master file, set the variable \texttt{thehandoutsdirectory} to be empty:
381 \begin{verbatim}
382 \renewcommand{\thehandoutsdirectory}{}
383 \end{verbatim}
384
385
386 \subsubsection{The handouts label}
387
388 \label{sec:label}
389 By default
390 \indexcommand{thehandoutslabel}%
391 the package deals with `handouts', and uses that word in the handouts output itself.
392 For example, the default style prints `Handout 1.1' in the header of handout 1.1.
393 A different term like `Student worksheet' might be desired instead.
394 To achieve this, redefine the variable \texttt{thehandoutlabel}:
395 \begin{verbatim}
396 \renewcommand{\thehandoutlabel}{Student worksheet}
397 \end{verbatim}
398
399
400 \subsubsection{The credit/copyright line}
401 \label{sec:credit}
402 \indexcommand{thehandoutscredit}
403 The default handouts style contains a space in left side of the footer where a credit or copyright line can appear.
404 By default it is empty.
405 Set it by redefining the variable \texttt{thehandoutcredit}:
406 \begin{verbatim}
407 \renewcommand{\thehandoutcredit}{NYU Calulus I; Summer 2015}
408 \end{verbatim}
409
410
411
412
413 \section{Auxiliary package features}
414
415 \subsection{A table of contents for the compiled document}
416
417 While each handout has its own page numbering -- the first page of a handout is always page one --
418 having a table of contents which references the page numbers of the handouts as they appear in the compiled \pdf document
419 can be convenient for determining which pages of the \pdf document need to be printed to get certain handouts.
420
421 To generate this type of table of contents in the compiled document, place usual command in the master file:
422 \begin{verbatim}
423 \tableofcontents
424 \end{verbatim}
425 The resulting table of contents will have some custom styling defined by the package.
426
427
428
429 \subsection{Setting unit titles}
430
431 When
432 using this package handouts are organized under generic `units'.
433 In a given project these units might represent something concrete;
434 for example, each unit might refer to a specific chapter in a book.
435 In this case individual units might also have titles, like
436 `Introduction to Differentiation',
437 and it may be useful to use these titles in the handouts.
438
439 \indexcommand{setunittitle}
440 Set the title of a unit with the command\texttt{setunittitle}:
441 \begin{verbatim}
442 \setunittitle{<unit number>}{<unit title>}
443 \end{verbatim}
444
445 When changing the handout style, or writing a specific handout, the title of the current unit may be printed with the command \verb$\theunittitle$.
446 If the current unit's title is not set, \verb$\theunittitle$ will do nothing.
447
448 In addition, if the title of a unit is set, the title will appear in the compiled document's table of contents.
449 This will likely make the compiled \pdf easier to navigate, and for this reason alone it is worth setting unit titles if they're available.
450
451
452
453 \section{Modifying the handout style}
454
455
456
457
458 The package defines a basic handouts style.
459 The style is implemented by changing the page margins (using the \texttt{geometry} package)
460 and editing the headers and footers of the handouts (using the \texttt{fancyhdr} package).
461
462
463 \subsection{Editing the page layout}
464
465 When
466 \indexcommand{thehandoutsgeometry}%
467 a new handout is loaded the page layout is temporarily changed using the \texttt{geometry} package.
468 In general handouts do not have large paragraphs of text, so by default the margins are made smaller so that the whole page can be more efficiently used.
469
470 When the package needs to change the page layout to that of the handouts it calls the command
471 \begin{verbatim}
472 \thehandoutsgeometry
473 \end{verbatim}
474 By default, the command \texttt{thehandoutsgeomtry} calls the command \texttt{newgeometry} \linebreak(from the \texttt{geometry} package)
475 which implements the desired changes.
476 The exact command that the command \texttt{thehandoutsgeometry} executes by default is
477 \begin{verbatim}
478 \newgeometry{top=3cm,left=2cm,right=2cm,bottom=2.5cm}
479 \end{verbatim}
480 Any desired geometry for the handouts can thus be achieved by setting the command $\texttt{thehandoutsgeometry}$
481 to execute the \texttt{newgeometry} command with appropriate options.
482 The possible options that can be sent to \texttt{newgeometry} are extensive and
483 may be discovered in the documentation for the \texttt{geometry} package.
484
485 For example, to have uniform margins of four centimeters, use the following:
486 \begin{verbatim}
487 \renewcommmand{\thehandoutsgeometry}{
488 \newgeometry{margins=4cm}
489 }
490 \end{verbatim}
491
492 To make no changes to the geometry -- that is, to have the handouts use the same layout as the rest of the document --
493 just set the command to do nothing:
494 \begin{verbatim}
495 \renewcommmand{\thehandoutsgeometry}{}
496 \end{verbatim}
497
498
499
500 \subsection{Editing the header and footers}
501
502
503 The design of the handouts is implemented by editing the headers and footers using the \texttt{fancyhdr} package.
504 All of the handouts are within the \texttt{studenthandout} fancy page style.
505 This way, the headers and footers of the handouts can be styled without affecting the rest of the document.
506
507 To change the default handout style, use the appropriate commands from the \texttt{fancyhdr} package.
508 Make the changes to the fancy page style \texttt{studenthandout}.
509 For example, the following code removes the horizontal lines of the headers and footers and removes
510 all of the handout information, except for the handout's full title which is placed in the center of the header.
511 \begin{verbatim}
512 \fancypagestyle{studenthandout}{
513 \renewcommand{\headrulewidth}{0pt}
514 \renewcommand{\footrulewidth}{0pt}
515 \fancyhf{}
516 \fancyhead[C]{\thehandoutfulltitle}
517 }
518 \end{verbatim}
519 When changing the handout style the handout output commands in the next section will likely be needed.
520
521 \subsection{Handout output commands}
522 When editing the style there are a number of commands available that print information such as the current handout's title.
523 None of these commands take an argument.
524 As is commonplace in \Latex{}, using a command with no argument can result in the whitespace that follows being gobbled up.
525 If this happens use the command with braces after; for example \verb$\thehandoutnumber{}$.
526
527
528 \vspace{\baselineskip}
529 \noindent
530 The commands that print information specific to a given handout are as follows.
531 \begin{itemize}
532
533 \item \verb$\thehandoutnumber$ \indexcommand{thehandoutnumber}
534
535 Print the number of the current handout.
536 This is the unique number of the handout within the unit.
537 To print the full handout number, write
538
539 \begin{verbatim}
540 \theunitnumber.\thehandoutnumber
541 \end{verbatim}
542
543 \item \verb$\thehandoutitle$ \indexcommand{thehandouttitle}
544
545 Print the title of the current handout.
546 \item \verb$\thehandoutfulltitle$ \indexcommand{thehandoutfulltitle}
547
548 Print the full title of the current handout.
549 This will read something like `Handout 3.4: Handout Title', or, if the handout has no title, simply `3.4'.
550
551 \item \verb$\thehandoutpage$ \indexcommand{thehandoutpage}
552
553 Print the current handout page number.
554 This is distinct from the document page number as each handout begins at Page 1.
555 To print the document page number use the usual command \verb$\thepage$.
556
557 \end{itemize}
558
559 \vspace{\baselineskip}
560 \noindent
561 The commands that print information about the current unit or the handouts as a whole are as follows.
562 \begin{itemize}
563 \item \verb$\theunitnumber$ \indexcommand{theunitnumber}
564
565 Print the number of the current unit.
566
567 \item \verb$\theunittitle$ \indexcommand{theunittitle}
568
569 Print the title of the current unit, as set through the \texttt{setunittitle} command.
570 If the current unit's title has not been set, this command will do nothing.
571
572 \item \verb$\theunitfulltitle$ \indexcommand{theunitfulltitle}
573
574 Print the full title of the current unit.
575 This will read something like `1: Unit Title'.
576 If the unit's title has not been set the full title will just read `1`.
577
578 \item \verb$\thehandoutslabel$ \indexcommand{thehandoutslabel}
579
580 Print the handouts label -- that is, the word or phrase that says what the handouts are.
581 By default this is `Handout' but it can be changed;
582 see section \ref{sec:label} above.
583
584 \item \verb$\thehandoutscredit$ \indexcommand{thehandoutscredit}
585
586 Print the handouts credit.
587 This is by default blank but may be set to include information like the teacher's name or the institution's name; see section \ref{sec:credit} above.
588 \end{itemize}
589
590 \vspace{\baselineskip}
591 \noindent
592 Finally, the package provides a command
593 \indexcommand{fullhandoutinfo}
594 \begin{verbatim}
595 \fullhandoutinfo
596 \end{verbatim}
597 which outputs a table containing all nine pieces of information from above, as well as the output of the command \verb$thepage$.
598 This command is intended for debugging and is not designed to be used in the final document.
599
600
601
602 \newpage
603
604 \printindex
605
606
607
608
609 \end{document}
610
611
612
613
614