Debian Codegraph @

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

raw
1 \documentclass{ltxdockit}[2011/03/25]
2 \usepackage{btxdockit}
3 \usepackage{fontspec}
4 \usepackage[mono=false]{libertine}
5 \usepackage{microtype}
6 \usepackage[american]{babel}
7 \usepackage[strict]{csquotes}
8 \setmonofont[Scale=MatchLowercase]{DejaVu Sans Mono}
9 \usepackage{shortvrb}
10 \usepackage{pifont}
11 \usepackage{minted}
12 \usepackage{bidi}
13 % Meta-datas
14 \titlepage{%
15 title={Making handout},
16 subtitle={to support your talk},
17 email={maieul <at> maieul <dot> net},
18 author={Maïeul Rouquette},
19 revision={1.6.0},
20 date={21/04/2017},
21 url={https://github.com/maieul/handout}}
22
23
24 \begin{document}
25
26 \printtitlepage
27 \tableofcontents
28
29 \section{Introduction}
30 \subsection{Goal}
31
32 In some fields of schol­ar­ship, a beamer does not of­fer good sup­port when giv­ing a talk. For ex­am­ple, in clas­si­cal philol­ogy, the main sources are text, and it will be bet­ter to dis­tribute a hand­out to the au­di­ence with ex­tracts of the texts about which we will talk.
33
34 The pack­age sup­ports prepa­ra­tion of such hand­outs when writ­ing the talk.
35
36 \subsection{Credits}
37
38 This package was created for Maïeul Rouquette's PHD\footnote{\url{http://apocryphes.hypothese.org}.} in 2014. It is licenced under the \emph{\LaTeX\ Project Public Licence}.\footnote{\url{http://latex-project.org/lppl/lppl-1-3c.html}.}
39
40 All issues can be submitted, in French or English, on the GitHub issues page.\footnote{\url{https://github.com/maieul/handout/issues}.}
41
42 \subsection{French tutorial}
43
44 As the idea for the package behavior came from French \LaTeX\ users\footnote{\url{http://fr.comp.text.tex.narkive.com/pXMop2kE/fabrication-d-un-exemplier}.}, and as the package's author speaks French as a native language, a French tutorial is available in \url{http://geekographie.maieul.net/136}.
45
46 All files in the examples’ folder are in French, but the effect of the commands they use should still be clear. They have to be run with \XeLaTeX.
47
48 \section{Basis}
49
50 The package can be loaded very quickly with the standard command \cs{usepackage}
51
52 \begin{minted}{tex}
53 \usepackage{handout}
54 \end{minted}
55 +The idea of the this package is to prepare a handout during the writing of a paper. When you want to add something to your handout, just write it in an external file, and call this external file with the command \cs{handout}:
56
57 \begin{minted}{tex}
58 Your text
59 \handout{folder/example}
60 Your text
61 \end{minted}
62
63 The PDF output will contain two parts:
64 \begin{enumerate}
65 \item Your paper.
66 \item The handout.
67 \end{enumerate}
68
69 You have just to split your pdf in two parts to obtain your handout for your audience.
70 See example~1.
71
72 \section{Code to be run at the beginning / at the end of the handout}
73
74 You can execute any code at the beginning of the handout by defining a command \cmd{beforehandout}. For example, to suppress the extra margins of the \env{quotation} environment:
75 \begin{minted}{tex}
76 \newcommand{\beforehandout}{%
77 \renewenvironment{quotation}{}{}%
78 }
79 \end{minted}
80 See example~2.
81
82 Note that some actions are always performed before the handout:
83 \begin{itemize}
84 \item Start a new page.
85 \item Reset page, footnote, table and figure counters.
86 \item Disable \cmd{index} and \cmd{label} command.
87 \end{itemize}
88
89 You can also execute any code at the end of the handout by defining a command \cmd{afterhandout}.
90 For example, if you want to add additional remarks on your handout, but not in your main text.
91 \begin{minted}{tex}
92 \newcommand{\afterhandout}{%
93 Additional remarks.
94 }
95 \end{minted}
96 \section{Putting all your examples in a single folder}
97
98 In most cases, all your external files will be in a single folder. So you can fix this folder with the package's option \opt{dir}:
99 \begin{minted}{tex}
100 \usepackage[dir=folder]{handout}
101 ...
102 Your text
103 \handout{example}
104 Your text
105 \end{minted}
106
107 See example~3.
108
109 \section{Recopying the sectioning commands in the handout}
110
111 If you want your handout be organized with the same sectioning commands as your main paper, you can use the option \opt{sectioning} when loading the package. See example~4.
112
113 \section{Numbering the examples}
114
115 The package option \opt{numbering} automatically numbers the examples. Each example's number is by default printed in the margin, in a frame. See example~5.
116
117 To customize number's presentation, you can redefine three commands:
118 \begin{enumerate}
119 \item \cmd{thehandoutnumber} to redefine the way the number is displayed. Standard is:
120 \begin{minted}{tex}
121 \renewcommand{\thehandoutnumber}{\fbox{\arabic{handoutnumber}}}
122 \end{minted}
123 See \LaTeX\ documentation on counter's appearance.
124 \item \cmd{handoutnumber} to redefine the position of the number. Standard is:
125 \begin{minted}{tex}
126 \newcommand{\handoutnumber}[1]{\marginpar{#1}}
127 \end{minted}
128 \item \cmd{handoutnumberintxt}, to redefine the position of the number in the main text. Standard is:
129 \begin{minted}{tex}
130 \newcommand{\handoutnumberintxt}[1]{\handoutnumber{#1}}
131 \end{minted}
132 \end{enumerate}
133
134 \section{Temporarily disabling the handout generation}
135
136 The package option \opt{disabled} allows you to disable the handout's generation.
137
138 \label{enablehandout}You can also disable it for only some parts of the text: use \cmd{disablehandout} to disable the handout's generation from the current point and \cmd{enablehandout} to enable it from the current point.
139
140 \label{printing} You can also use \opt{printing=false}, which makes \LaTeX\ number the examples without producing the handout.
141
142 \section{Advanced use}
143 \subsection{Conditional code}
144
145 The argument of a \cmd{onlyhandout} command will be printed only in the handout. Conversely, the argument of a command \cmd{nothandout} will be printed only in the main text. See example~6.
146
147 \subsection{Insert code in the handout}
148 \subsubsection{\cmd{forhandout} and \cmd{forhandout*}}\label{forhandout}
149 The argument of the \cmd{forhandout} command will be added to the handout, even if used outside any included file.
150
151 All the commands inside will be expanded, except the one which starts argument..
152
153
154 The \cmd{forhandout} command is quite complex to manage, but can be useful if you want to insert bibliographic references automatically into your handout. If you use \emph{biblatex} to manage your bibliography, you can define a \cmd{citehandout} command with this code:
155
156
157 \begin{minted}{tex}
158 \newcommand{\citehandout}{%
159 \AtNextCitekey{%
160 \forhandout{%
161 \beforehandoutref%
162 }%
163 \forhandout{%
164 \cite[\strfield{postnote}]{\strfield{entrykey}}%
165 }%
166 \forhandout{%
167 \afterhandoutref%
168 }%
169 }%
170 }
171 \newcommand{\beforehandoutref}{\par\noindent\hspace{-2\parindent}}
172 \newcommand{\afterhandoutref}{\par\vskip0.25\baselineskip}
173 \end{minted}
174
175 You can call the \cmd{citehandout} command before citation commands when you want the reference to be copied to the handout. See example~7 and the \emph{biblatex} handbook.
176
177
178 Note that the citation tracker is automatically reset at the beginning of the handout.
179
180 The starred version of \cmd{citehandout} command will not expand any macro inside the argument. For example, if you need to write instructions for readers:
181 \begin{minted}{latex}
182 \forhandout{Read the three following texts, looking for:
183 \begin{itemize}
184 \item Places.
185 \item Topics.
186 \item Characters.
187 \end{itemize}
188 }
189 \end{minted}
190 \subsubsection{\cmd{AtEveryHandout}}\label{forhandout}
191 You can also add define a \cs{AtEveryHandout} command to be executed in the handout, before each content added to the handout.
192 \section{Change history}
193
194 \begin{changelog}
195 \begin{release}{1.6.0}{2017-04-21}
196 \item Add starred version of \cs{forhandout} macro \see{forhandout}.
197 \end{release}
198
199 \begin{release}{1.5.0}{2016-11-15}
200 \item Reset automatically table and figure counters before typesetting handout.
201 \end{release}
202
203 \begin{release}{1.4.0}{2016-10-24}
204 \item Add possibility to add additional content before every element of an handout.
205 \end{release}
206
207 \begin{release}{1.3.0}{2016-10-13}
208 \item Add possibility to add additional content at the end of the handout.
209 \end{release}
210
211 \begin{release}{1.2.1}{2015-01-06}
212 \item Optimize performance with \opt{sectioning} option.
213 \end{release}
214
215 \begin{release}{1.2.0}{2015-01-06}
216 \item Add new option printing. \see{printing}
217 \item Optimize performance.
218 \end{release}
219
220 \begin{release}{1.1.0}{2014-12-15}
221 \item Add \cmd{enablehandout} and \cmd{disablehandout}. \see{enablehandout}
222 \end{release}
223
224 \begin{release}{1.0.1}{2014-05-23}
225 \item Also disable indexing in the handout when using multiple index.
226 \end{release}
227
228 \begin{release}{1.0.0}{2014-03-20}
229 \item First public release.
230 \end{release}
231 \end{changelog}
232 \end{document}