summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/handout
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/handout
Initial commit
Diffstat (limited to 'macros/latex/contrib/handout')
-rw-r--r--macros/latex/contrib/handout/README4
-rw-r--r--macros/latex/contrib/handout/examples/example.bib15
-rw-r--r--macros/latex/contrib/handout/examples/example1-minimal.pdfbin0 -> 11485 bytes
-rw-r--r--macros/latex/contrib/handout/examples/example1-minimal.tex14
-rw-r--r--macros/latex/contrib/handout/examples/example2-cancel-quotation.pdfbin0 -> 11478 bytes
-rw-r--r--macros/latex/contrib/handout/examples/example2-cancel-quotation.tex16
-rw-r--r--macros/latex/contrib/handout/examples/example3-defined-path.pdfbin0 -> 12763 bytes
-rw-r--r--macros/latex/contrib/handout/examples/example3-defined-path.tex20
-rw-r--r--macros/latex/contrib/handout/examples/example4-sectioning.pdfbin0 -> 16967 bytes
-rw-r--r--macros/latex/contrib/handout/examples/example4-sectioning.tex22
-rw-r--r--macros/latex/contrib/handout/examples/example5-numbering.pdfbin0 -> 19829 bytes
-rw-r--r--macros/latex/contrib/handout/examples/example5-numbering.tex24
-rw-r--r--macros/latex/contrib/handout/examples/example6-not-and-only.pdfbin0 -> 24200 bytes
-rw-r--r--macros/latex/contrib/handout/examples/example6-not-and-only.tex24
-rw-r--r--macros/latex/contrib/handout/examples/example7-biblatex.pdfbin0 -> 37801 bytes
-rw-r--r--macros/latex/contrib/handout/examples/example7-biblatex.tex42
-rw-r--r--macros/latex/contrib/handout/examples/latexmkrc2
-rw-r--r--macros/latex/contrib/handout/examples/makefile5
-rw-r--r--macros/latex/contrib/handout/examples/txt/Preau1583-not-and-only.tex4
-rw-r--r--macros/latex/contrib/handout/examples/txt/Preau1583.tex4
-rw-r--r--macros/latex/contrib/handout/examples/txt/Preau1583b.tex4
-rw-r--r--macros/latex/contrib/handout/examples/txt/Richard_Simon_NT.tex4
-rw-r--r--macros/latex/contrib/handout/handout.pdfbin0 -> 72229 bytes
-rw-r--r--macros/latex/contrib/handout/handout.sty157
-rw-r--r--macros/latex/contrib/handout/handout.tex232
-rw-r--r--macros/latex/contrib/handout/latexmkrc2
-rw-r--r--macros/latex/contrib/handout/makefile21
27 files changed, 616 insertions, 0 deletions
diff --git a/macros/latex/contrib/handout/README b/macros/latex/contrib/handout/README
new file mode 100644
index 0000000000..39eec8370f
--- /dev/null
+++ b/macros/latex/contrib/handout/README
@@ -0,0 +1,4 @@
+Create handout for auditors of a speech.
+
+Copyright 2014-… Maïeul Rouquette
+LLPL 1.3 http://www.latex-project.org/lppl.txt \ No newline at end of file
diff --git a/macros/latex/contrib/handout/examples/example.bib b/macros/latex/contrib/handout/examples/example.bib
new file mode 100644
index 0000000000..f2eb05e99d
--- /dev/null
+++ b/macros/latex/contrib/handout/examples/example.bib
@@ -0,0 +1,15 @@
+@book{Simon1689,
+ Address = {Rotterdam},
+ Author = {Richard Simon},
+ Publisher = {Reinier Leers},
+ Title = {Histoire critique du texte du Nouveau Testament, Où l'on établit la Verité des Actes sur lesquels la Religion Chrétienne est fondée},
+ Year = {1689}}
+
+@book{Preau1583,
+ Address = {Paris},
+ Author = {Gabriel du Preau},
+ Pagination = {folio},
+ Publisher = {Jacques Keruer},
+ Title = {Histoire de l'Estat et succes de l'Eglise dressee en forme de chronique generalle et universelle},
+ Volume = {1},
+ Year = {1583}}
diff --git a/macros/latex/contrib/handout/examples/example1-minimal.pdf b/macros/latex/contrib/handout/examples/example1-minimal.pdf
new file mode 100644
index 0000000000..02e809f3c5
--- /dev/null
+++ b/macros/latex/contrib/handout/examples/example1-minimal.pdf
Binary files differ
diff --git a/macros/latex/contrib/handout/examples/example1-minimal.tex b/macros/latex/contrib/handout/examples/example1-minimal.tex
new file mode 100644
index 0000000000..e60ce1f2d4
--- /dev/null
+++ b/macros/latex/contrib/handout/examples/example1-minimal.tex
@@ -0,0 +1,14 @@
+\documentclass[a4paper]{article}
+\usepackage{polyglossia,fontspec}
+\setmainlanguage{french}
+\usepackage{handout}
+
+\begin{document}
+
+Dans son \emph{Histoire critique du texte du Nouveau Testament}, Richard~Simon écrit:
+\handout{txt/Richard_Simon_NT.tex}
+Des commentaires sur ce passage.
+
+\end{document}
+
+
diff --git a/macros/latex/contrib/handout/examples/example2-cancel-quotation.pdf b/macros/latex/contrib/handout/examples/example2-cancel-quotation.pdf
new file mode 100644
index 0000000000..b20e2f83f4
--- /dev/null
+++ b/macros/latex/contrib/handout/examples/example2-cancel-quotation.pdf
Binary files differ
diff --git a/macros/latex/contrib/handout/examples/example2-cancel-quotation.tex b/macros/latex/contrib/handout/examples/example2-cancel-quotation.tex
new file mode 100644
index 0000000000..bce2792d57
--- /dev/null
+++ b/macros/latex/contrib/handout/examples/example2-cancel-quotation.tex
@@ -0,0 +1,16 @@
+\documentclass[a4paper]{article}
+\usepackage{polyglossia,fontspec}
+\setmainlanguage{french}
+\usepackage{handout}
+\newcommand{\beforehandout}{%
+ \renewenvironment{quotation}{}{}
+}
+\begin{document}
+
+Dans son \emph{Histoire critique du texte du Nouveau Testament}, Richard~Simon écrit:
+\handout{txt/Richard_Simon_NT.tex}
+Des commentaires sur ce passage.
+
+\end{document}
+
+
diff --git a/macros/latex/contrib/handout/examples/example3-defined-path.pdf b/macros/latex/contrib/handout/examples/example3-defined-path.pdf
new file mode 100644
index 0000000000..c9ab4c9c8c
--- /dev/null
+++ b/macros/latex/contrib/handout/examples/example3-defined-path.pdf
Binary files differ
diff --git a/macros/latex/contrib/handout/examples/example3-defined-path.tex b/macros/latex/contrib/handout/examples/example3-defined-path.tex
new file mode 100644
index 0000000000..de1b979f56
--- /dev/null
+++ b/macros/latex/contrib/handout/examples/example3-defined-path.tex
@@ -0,0 +1,20 @@
+\documentclass[a4paper]{article}
+\usepackage{polyglossia,fontspec}
+\setmainlanguage{french}
+\usepackage[dir=txt]{handout}
+\newcommand{\beforehandout}{%
+ \renewenvironment{quotation}{}{}
+}
+\begin{document}
+
+L'historien catholique Gabriel du Preau ce sert de l'épisode lorsqu'il est question de Matthieu:
+\handout{Preau1583.tex}
+Des commentaires sur ce passage
+
+Dans son \emph{Histoire critique du texte du Nouveau Testament}, Richard~Simon écrit:
+\handout{Richard_Simon_NT.tex}
+Des commentaires sur ce passage.
+
+\end{document}
+
+
diff --git a/macros/latex/contrib/handout/examples/example4-sectioning.pdf b/macros/latex/contrib/handout/examples/example4-sectioning.pdf
new file mode 100644
index 0000000000..fa80671d51
--- /dev/null
+++ b/macros/latex/contrib/handout/examples/example4-sectioning.pdf
Binary files differ
diff --git a/macros/latex/contrib/handout/examples/example4-sectioning.tex b/macros/latex/contrib/handout/examples/example4-sectioning.tex
new file mode 100644
index 0000000000..fc667e9c64
--- /dev/null
+++ b/macros/latex/contrib/handout/examples/example4-sectioning.tex
@@ -0,0 +1,22 @@
+\documentclass[a4paper]{article}
+\usepackage{polyglossia,fontspec}
+\setmainlanguage{french}
+\usepackage[dir=txt,sectioning]{handout}
+\newcommand{\beforehandout}{%
+ \renewenvironment{quotation}{}{}
+}
+\begin{document}
+
+\section{Au temps des guerre de religions}
+L'historien catholique Gabriel du Preau ce sert de l'épisode lorsqu'il est question de Matthieu:
+\handout{Preau1583.tex}
+Des commentaires sur ce passage
+
+\section{Les conflits autour de l'œuvre de Richard~Simon}
+Dans son \emph{Histoire critique du texte du Nouveau Testament}, Richard~Simon écrit:
+\handout{Richard_Simon_NT.tex}
+Des commentaires sur ce passage.
+
+\end{document}
+
+
diff --git a/macros/latex/contrib/handout/examples/example5-numbering.pdf b/macros/latex/contrib/handout/examples/example5-numbering.pdf
new file mode 100644
index 0000000000..d38d4a94a1
--- /dev/null
+++ b/macros/latex/contrib/handout/examples/example5-numbering.pdf
Binary files differ
diff --git a/macros/latex/contrib/handout/examples/example5-numbering.tex b/macros/latex/contrib/handout/examples/example5-numbering.tex
new file mode 100644
index 0000000000..09633659e7
--- /dev/null
+++ b/macros/latex/contrib/handout/examples/example5-numbering.tex
@@ -0,0 +1,24 @@
+\documentclass[a4paper]{article}
+\usepackage{polyglossia,fontspec}
+\setmainlanguage{french}
+\usepackage[dir=txt,sectioning,numbering]{handout}
+\newcommand{\beforehandout}{%
+ \renewenvironment{quotation}{}{}
+}
+\begin{document}
+
+\section{Au temps des guerre de religions}
+L'historien catholique Gabriel du Preau ce sert de l'épisode lorsqu'il est question de Matthieu:
+\handout{Preau1583.tex}
+Des commentaires sur ce passage
+
+Mais notre auteur dispose aussi de l'œuvre de Nicéphore Calliste Xanthopoulos. C'est pourquoi il duplique notre évangile retrouvé:
+\handout{Preau1583b}
+Des commentaires sur ce passage
+\section{Les conflits autour de l'œuvre de Richard~Simon}
+Dans son \emph{Histoire critique du texte du Nouveau Testament}, Richard~Simon écrit:
+\handout{Richard_Simon_NT.tex}
+Des commentaires sur ce passage.
+\end{document}
+
+
diff --git a/macros/latex/contrib/handout/examples/example6-not-and-only.pdf b/macros/latex/contrib/handout/examples/example6-not-and-only.pdf
new file mode 100644
index 0000000000..ba60bd2ae2
--- /dev/null
+++ b/macros/latex/contrib/handout/examples/example6-not-and-only.pdf
Binary files differ
diff --git a/macros/latex/contrib/handout/examples/example6-not-and-only.tex b/macros/latex/contrib/handout/examples/example6-not-and-only.tex
new file mode 100644
index 0000000000..21be851ecf
--- /dev/null
+++ b/macros/latex/contrib/handout/examples/example6-not-and-only.tex
@@ -0,0 +1,24 @@
+\documentclass[a4paper]{article}
+\usepackage{polyglossia,fontspec}
+\setmainlanguage{french}
+\usepackage[dir=txt,sectioning,numbering]{handout}
+\newcommand{\beforehandout}{%
+ \renewenvironment{quotation}{}{}
+}
+\begin{document}
+
+\section{Au temps des guerre de religions}
+L'historien catholique Gabriel du Preau ce sert de l'épisode lorsqu'il est question de Matthieu:
+\handout{Preau1583-not-and-only.tex}
+Des commentaires sur ce passage
+
+Mais notre auteur dispose aussi de l'œuvre de Nicéphore Calliste Xanthopoulos. C'est pourquoi il duplique notre évangile retrouvé:
+\handout{Preau1583b}
+Des commentaires sur ce passage
+\section{Les conflits autour de l'œuvre de Richard~Simon}
+Dans son \emph{Histoire critique du texte du Nouveau Testament}, Richard~Simon écrit:
+\handout{Richard_Simon_NT.tex}
+Des commentaires sur ce passage.
+\end{document}
+
+
diff --git a/macros/latex/contrib/handout/examples/example7-biblatex.pdf b/macros/latex/contrib/handout/examples/example7-biblatex.pdf
new file mode 100644
index 0000000000..2d4eb01c31
--- /dev/null
+++ b/macros/latex/contrib/handout/examples/example7-biblatex.pdf
Binary files differ
diff --git a/macros/latex/contrib/handout/examples/example7-biblatex.tex b/macros/latex/contrib/handout/examples/example7-biblatex.tex
new file mode 100644
index 0000000000..c7d083752e
--- /dev/null
+++ b/macros/latex/contrib/handout/examples/example7-biblatex.tex
@@ -0,0 +1,42 @@
+\documentclass[a4paper]{article}
+\usepackage{polyglossia,fontspec}
+\usepackage[style=verbose-trad2]{biblatex}
+\bibliography{example}
+\setmainlanguage{french}
+\usepackage[dir=txt,sectioning,numbering]{handout}
+\newcommand{\beforehandout}{%
+ \renewenvironment{quotation}{}{}%
+}
+
+\newcommand{\citehandout}{%
+ \AtNextCitekey{%
+ \forhandout{%
+ \beforehandoutref%
+ }%
+ \forhandout{%
+ \cite[\strfield{postnote}]{\strfield{entrykey}}%
+ }%
+ \forhandout{%
+ \afterhandoutref%
+ }%
+ }%
+}
+\newcommand{\beforehandoutref}{\par\noindent\hspace{-2\parindent}}
+\newcommand{\afterhandoutref}{\par\vskip0.25\baselineskip}
+\begin{document}
+
+\section{Au temps des guerre de religions}
+L'historien catholique Gabriel du Preau ce sert de l'épisode lorsqu'il est question de Matthieu\citehandout\footcite[33]{Preau1583}:
+\handout{Preau1583-not-and-only.tex}
+Des commentaires sur ce passage
+
+Mais notre auteur dispose aussi de l'œuvre de Nicéphore Calliste Xanthopoulos. C'est pourquoi il duplique notre évangile retrouvé\citehandout\footcite[194]{Preau1583}:
+\handout{Preau1583b}
+Des commentaires sur ce passage
+\section{Les conflits autour de l'œuvre de Richard~Simon}
+Dans son \emph{Histoire critique du texte du Nouveau Testament}, Richard~Simon écrit\citehandout\footcite[45]{Simon1689}:
+\handout{Richard_Simon_NT.tex}
+Des commentaires sur ce passage.
+\end{document}
+
+
diff --git a/macros/latex/contrib/handout/examples/latexmkrc b/macros/latex/contrib/handout/examples/latexmkrc
new file mode 100644
index 0000000000..f69e7ab8f7
--- /dev/null
+++ b/macros/latex/contrib/handout/examples/latexmkrc
@@ -0,0 +1,2 @@
+$pdflatex = "xelatex";
+$pdf_mode = "1";
diff --git a/macros/latex/contrib/handout/examples/makefile b/macros/latex/contrib/handout/examples/makefile
new file mode 100644
index 0000000000..aa7ef50a16
--- /dev/null
+++ b/macros/latex/contrib/handout/examples/makefile
@@ -0,0 +1,5 @@
+all: *tex *bib
+ latexmk *tex
+
+clean:
+ @$(RM) *.pdf *.toc *.aux *.out *.fdb_latexmk *.log *.bbl *.bcf *.blg *run.xml *.synctex.gz* *fls *.handout
diff --git a/macros/latex/contrib/handout/examples/txt/Preau1583-not-and-only.tex b/macros/latex/contrib/handout/examples/txt/Preau1583-not-and-only.tex
new file mode 100644
index 0000000000..2930a23ef2
--- /dev/null
+++ b/macros/latex/contrib/handout/examples/txt/Preau1583-not-and-only.tex
@@ -0,0 +1,4 @@
+
+\begin{quotation}
+L'an 42. l'Evangeliste S.~Matthieu escrivit son Evangile en Hebreu au païs de Iudee: qui ayant esté long temps caché, fut par luy mesme reuelé\footnote{\nothandout{Note non présente dans l'exemplier.}\onlyhandout{Note seulement présente dans l'exemplier.}} \& trouvé du temps de l'Empereur Zenon, comme nous verrons en son lieu.
+\end{quotation}
diff --git a/macros/latex/contrib/handout/examples/txt/Preau1583.tex b/macros/latex/contrib/handout/examples/txt/Preau1583.tex
new file mode 100644
index 0000000000..19a8483b90
--- /dev/null
+++ b/macros/latex/contrib/handout/examples/txt/Preau1583.tex
@@ -0,0 +1,4 @@
+
+\begin{quotation}
+L'an 42. l'Evangeliste S.~Matthieu escrivit son Evangile en Hebreu au païs de Iudee: qui ayant esté long temps caché, fut par luy mesme reuelé \& trouvé du temps de l'Empereur Zenon, comme nous verrons en son lieu.
+\end{quotation}
diff --git a/macros/latex/contrib/handout/examples/txt/Preau1583b.tex b/macros/latex/contrib/handout/examples/txt/Preau1583b.tex
new file mode 100644
index 0000000000..398f79bf4c
--- /dev/null
+++ b/macros/latex/contrib/handout/examples/txt/Preau1583b.tex
@@ -0,0 +1,4 @@
+
+\begin{quotation}
+Aussi durant son Empire, fut trouvé en Cypre souz un arbre, que l'on nomme Silique, le corps de S.~Barnabé Apostre, sur l'estomach duquel estoit le sainct \& sacré Evangile de l'Evangeliste sainct Matthieu, escrit de la propre main d'iceluy S.~Barnabé. A cause dequoy les Cypriens deslors commencerent d'avoir leur ville capitale Salamine franche \& libre: \& ne furent de là en avant contraincts de porter leur denombrement \& declaration en Antioche, comme ils fouloient faire au precedent. Iustinian puis apres confirma d'avantage leurs droicts, privileges \& franchises, à cause que Theodose sa femme estoit du pays de Cypre: comme luy mesme aussi porta grand honneur à sa ville Achride Iustiniane la premiere.
+\end{quotation} \ No newline at end of file
diff --git a/macros/latex/contrib/handout/examples/txt/Richard_Simon_NT.tex b/macros/latex/contrib/handout/examples/txt/Richard_Simon_NT.tex
new file mode 100644
index 0000000000..662185768e
--- /dev/null
+++ b/macros/latex/contrib/handout/examples/txt/Richard_Simon_NT.tex
@@ -0,0 +1,4 @@
+
+\begin{quotation}
+Mr.~le~Moine habile Protestant \& savant dans les langues Orientales, nous assûre qu'il étoit écrit en Ebreu, parce que Saint~Barnabé qui l'avoit décrit pour son usage étoit Juif de naissance, \& prêchoit à ceux de sa nation. Mais il y a plus d'apparence qu'Anthime qui n'étoit pas Juif en supposa un grec ; \& il n'est gueres croyable qu'on l'eust lû publiquement dans l'Eglise de Constantinople, s'il eût été écrit en Ebreu.
+\end{quotation} \ No newline at end of file
diff --git a/macros/latex/contrib/handout/handout.pdf b/macros/latex/contrib/handout/handout.pdf
new file mode 100644
index 0000000000..19c248beb3
--- /dev/null
+++ b/macros/latex/contrib/handout/handout.pdf
Binary files differ
diff --git a/macros/latex/contrib/handout/handout.sty b/macros/latex/contrib/handout/handout.sty
new file mode 100644
index 0000000000..88e407c870
--- /dev/null
+++ b/macros/latex/contrib/handout/handout.sty
@@ -0,0 +1,157 @@
+%% Copyright 2014… Maïeul Rouquette
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of this work is Maïeul Rouquette
+% This work consists of the files handout.sty and example and documentation files.
+
+\ProvidesPackage{handout}[2017/04/21 1.6.0 Handout package]
+\RequirePackage{kvoptions,etoolbox,suffix}
+
+% Options
+\DeclareBoolOption[false]{disabled}
+\let\disablehandout\handout@disabledtrue
+\let\enablehandout\handout@disabledfalse
+
+\DeclareBoolOption[false]{numbering}
+\DeclareBoolOption[false]{sectioning}
+
+\DeclareBoolOption[true]{printing}
+
+\DeclareStringOption[.]{dir}
+
+\ProcessKeyvalOptions*
+
+% Warning tools
+\newcommand{\handout@warning}[1]{\@latex@warning{Handout: #1}}
+
+% Opening the handout file
+\newwrite\@handout
+\immediate\openout\@handout=\jobname.handout
+
+
+% The main command, to be used by people
+\newcommand{\handout}[1]{%
+ \ifhandout@disabled\else%Only if not disabled, of course!
+ \ifhandout@numbering%
+ \stepcounter{handoutnumber}%
+ \handoutnumberintxt{\thehandoutnumber}%
+ \fi%
+ \ifhandout@printing%
+ \immediate\write\@handout {\string\handout@input{#1}}%
+ \fi%
+ \fi%
+ \input{\handout@dir/#1}% Add the handout
+}
+
+
+% The special commands to be used by people
+
+\newcommand{\nothandout}[1]{#1}
+\newcommand{\onlyhandout}[1]{}
+\newcommand{\forhandout}[1]{%
+ \ifhandout@disabled\else%
+ \ifhandout@printing%
+ \immediate\write\@handout{\noexpand #1}%
+ \fi%
+ \fi%
+}
+\WithSuffix\newcommand\forhandout*[1]{%
+ \ifhandout@disabled\else%
+ \ifhandout@printing%
+ \immediate\write\@handout{\unexpanded{#1}}%
+ \fi%
+ \fi%
+}
+
+% The command written in the .handout file
+\newcommand{\handout@input}[1]{%
+ \ifdefined\AtEveryHandout%
+ \AtEveryHandout%
+ \fi%
+ \ifhandout@numbering%
+ \stepcounter{handoutnumber}%
+ \handoutnumber{\thehandoutnumber}%
+ \fi%
+ \input{\handout@dir/#1}%
+}
+% Output the sectionning commands in the .handout file
+
+\ifhandout@sectioning%Only if needed by option
+
+ \apptocmd{\@sect}{%
+ \ifhandout@disabled\else%
+ \ifhandout@printing%
+ \immediate\write\@handout{\@backslashchar#1{\unexpanded{#8}}}%
+ \fi%
+ \fi%
+ }{}{\handout@warning{Can't patch sectioning commands}}
+
+\fi
+% Call the handout file at the end, if need
+
+\AtEndDocument{%
+ \ifhandout@printing%
+ \ifhandout@disabled\else
+ \immediate\closeout\@handout%
+ \before@handout%
+ \ifdef{\beforehandout}{\beforehandout}{\handout@warning{No command defined to be run before handout}}
+ \makeatletter%
+ \input\jobname.handout%
+ \makeatother%
+ \ifdef{\afterhandout}{\afterhandout}{\handout@warning{No command defined to be run after handout}}
+ \fi%
+ \fi%
+}
+
+% Standard command before handout
+\newcommand{\before@handout}{%
+ % New page
+ \newpage%
+ % Reset counters
+ \setcounter{page}{1}%
+ \setcounter{footnote}{0}%
+ \setcounter{table}{0}%
+ \setcounter{figure}{0}%
+ \ifhandout@sectioning%
+ \setcounter{section}{0}%
+ \setcounter{subsection}{0}%
+ \setcounter{subsubsection}{0}%
+ \fi
+ \ifhandout@numbering
+ \setcounter{handoutnumber}{0}%
+ \fi
+ % No new data in content or in label or index
+ \def\addcontentsline##1##2##3{}
+ \let\label\@gobble
+ \renewcommand{\index}[2][1]{}
+
+ % Switches onlyhandout and nothandout commands
+ \renewcommand{\nothandout}[1]{}
+ \renewcommand{\onlyhandout}[1]{##1}
+
+}
+
+\AtBeginDocument{%
+ \@ifpackageloaded{biblatex}{%
+ \apptocmd{\before@handout}{\citereset}{}{}%
+ }{}}
+
+% Handout numbering
+
+\ifhandout@numbering
+ \newcounter{handoutnumber}
+ \renewcommand{\thehandoutnumber}{\fbox{\arabic{handoutnumber}}}
+\fi
+\newcommand{\handoutnumberintxt}[1]{\handoutnumber{#1}}
+\newcommand{\handoutnumber}[1]{\marginpar{#1}}
+
+
diff --git a/macros/latex/contrib/handout/handout.tex b/macros/latex/contrib/handout/handout.tex
new file mode 100644
index 0000000000..dc483101d1
--- /dev/null
+++ b/macros/latex/contrib/handout/handout.tex
@@ -0,0 +1,232 @@
+\documentclass{ltxdockit}[2011/03/25]
+\usepackage{btxdockit}
+\usepackage{fontspec}
+\usepackage[mono=false]{libertine}
+\usepackage{microtype}
+\usepackage[american]{babel}
+\usepackage[strict]{csquotes}
+\setmonofont[Scale=MatchLowercase]{DejaVu Sans Mono}
+\usepackage{shortvrb}
+\usepackage{pifont}
+\usepackage{minted}
+\usepackage{bidi}
+% Meta-datas
+\titlepage{%
+ title={Making handout},
+ subtitle={to support your talk},
+ email={maieul <at> maieul <dot> net},
+ author={Maïeul Rouquette},
+ revision={1.6.0},
+ date={21/04/2017},
+ url={https://github.com/maieul/handout}}
+
+
+\begin{document}
+
+\printtitlepage
+\tableofcontents
+
+\section{Introduction}
+\subsection{Goal}
+
+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.
+
+The pack­age sup­ports prepa­ra­tion of such hand­outs when writ­ing the talk.
+
+\subsection{Credits}
+
+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}.}
+
+All issues can be submitted, in French or English, on the GitHub issues page.\footnote{\url{https://github.com/maieul/handout/issues}.}
+
+\subsection{French tutorial}
+
+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}.
+
+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.
+
+\section{Basis}
+
+The package can be loaded very quickly with the standard command \cs{usepackage}
+
+\begin{minted}{tex}
+\usepackage{handout}
+\end{minted}
++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}:
+
+\begin{minted}{tex}
+Your text
+\handout{folder/example}
+Your text
+\end{minted}
+
+The PDF output will contain two parts:
+\begin{enumerate}
+ \item Your paper.
+ \item The handout.
+\end{enumerate}
+
+You have just to split your pdf in two parts to obtain your handout for your audience.
+See example~1.
+
+\section{Code to be run at the beginning / at the end of the handout}
+
+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:
+\begin{minted}{tex}
+\newcommand{\beforehandout}{%
+ \renewenvironment{quotation}{}{}%
+}
+\end{minted}
+See example~2.
+
+Note that some actions are always performed before the handout:
+\begin{itemize}
+ \item Start a new page.
+ \item Reset page, footnote, table and figure counters.
+ \item Disable \cmd{index} and \cmd{label} command.
+\end{itemize}
+
+You can also execute any code at the end of the handout by defining a command \cmd{afterhandout}.
+ For example, if you want to add additional remarks on your handout, but not in your main text.
+\begin{minted}{tex}
+\newcommand{\afterhandout}{%
+ Additional remarks.
+}
+\end{minted}
+\section{Putting all your examples in a single folder}
+
+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}:
+\begin{minted}{tex}
+\usepackage[dir=folder]{handout}
+...
+Your text
+\handout{example}
+Your text
+\end{minted}
+
+See example~3.
+
+\section{Recopying the sectioning commands in the handout}
+
+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.
+
+\section{Numbering the examples}
+
+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.
+
+To customize number's presentation, you can redefine three commands:
+\begin{enumerate}
+ \item \cmd{thehandoutnumber} to redefine the way the number is displayed. Standard is:
+\begin{minted}{tex}
+\renewcommand{\thehandoutnumber}{\fbox{\arabic{handoutnumber}}}
+\end{minted}
+See \LaTeX\ documentation on counter's appearance.
+ \item \cmd{handoutnumber} to redefine the position of the number. Standard is:
+\begin{minted}{tex}
+\newcommand{\handoutnumber}[1]{\marginpar{#1}}
+\end{minted}
+ \item \cmd{handoutnumberintxt}, to redefine the position of the number in the main text. Standard is:
+\begin{minted}{tex}
+\newcommand{\handoutnumberintxt}[1]{\handoutnumber{#1}}
+\end{minted}
+\end{enumerate}
+
+\section{Temporarily disabling the handout generation}
+
+The package option \opt{disabled} allows you to disable the handout's generation.
+
+\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.
+
+\label{printing} You can also use \opt{printing=false}, which makes \LaTeX\ number the examples without producing the handout.
+
+\section{Advanced use}
+\subsection{Conditional code}
+
+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.
+
+\subsection{Insert code in the handout}
+\subsubsection{\cmd{forhandout} and \cmd{forhandout*}}\label{forhandout}
+The argument of the \cmd{forhandout} command will be added to the handout, even if used outside any included file.
+
+All the commands inside will be expanded, except the one which starts argument..
+
+
+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:
+
+
+\begin{minted}{tex}
+\newcommand{\citehandout}{%
+ \AtNextCitekey{%
+ \forhandout{%
+ \beforehandoutref%
+ }%
+ \forhandout{%
+ \cite[\strfield{postnote}]{\strfield{entrykey}}%
+ }%
+ \forhandout{%
+ \afterhandoutref%
+ }%
+ }%
+}
+\newcommand{\beforehandoutref}{\par\noindent\hspace{-2\parindent}}
+\newcommand{\afterhandoutref}{\par\vskip0.25\baselineskip}
+\end{minted}
+
+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.
+
+
+Note that the citation tracker is automatically reset at the beginning of the handout.
+
+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:
+\begin{minted}{latex}
+\forhandout{Read the three following texts, looking for:
+\begin{itemize}
+ \item Places.
+ \item Topics.
+ \item Characters.
+\end{itemize}
+}
+\end{minted}
+\subsubsection{\cmd{AtEveryHandout}}\label{forhandout}
+You can also add define a \cs{AtEveryHandout} command to be executed in the handout, before each content added to the handout.
+\section{Change history}
+
+\begin{changelog}
+\begin{release}{1.6.0}{2017-04-21}
+\item Add starred version of \cs{forhandout} macro \see{forhandout}.
+\end{release}
+
+\begin{release}{1.5.0}{2016-11-15}
+\item Reset automatically table and figure counters before typesetting handout.
+\end{release}
+
+\begin{release}{1.4.0}{2016-10-24}
+\item Add possibility to add additional content before every element of an handout.
+\end{release}
+
+\begin{release}{1.3.0}{2016-10-13}
+\item Add possibility to add additional content at the end of the handout.
+\end{release}
+
+\begin{release}{1.2.1}{2015-01-06}
+\item Optimize performance with \opt{sectioning} option.
+\end{release}
+
+\begin{release}{1.2.0}{2015-01-06}
+\item Add new option printing. \see{printing}
+\item Optimize performance.
+\end{release}
+
+\begin{release}{1.1.0}{2014-12-15}
+\item Add \cmd{enablehandout} and \cmd{disablehandout}. \see{enablehandout}
+\end{release}
+
+\begin{release}{1.0.1}{2014-05-23}
+\item Also disable indexing in the handout when using multiple index.
+\end{release}
+
+\begin{release}{1.0.0}{2014-03-20}
+\item First public release.
+\end{release}
+\end{changelog}
+\end{document}
diff --git a/macros/latex/contrib/handout/latexmkrc b/macros/latex/contrib/handout/latexmkrc
new file mode 100644
index 0000000000..d6cfc714fa
--- /dev/null
+++ b/macros/latex/contrib/handout/latexmkrc
@@ -0,0 +1,2 @@
+$pdflatex = "xelatex --shell-escape %S";
+$pdf_mode = "1";
diff --git a/macros/latex/contrib/handout/makefile b/macros/latex/contrib/handout/makefile
new file mode 100644
index 0000000000..e4e5610c87
--- /dev/null
+++ b/macros/latex/contrib/handout/makefile
@@ -0,0 +1,21 @@
+
+dist: examples handout.tex README *.sty makefile latexmkrc
+ $(RM) ../handout.zip
+ rm -rf handout
+ latexmk handout.tex
+ $(MAKE) -C examples all
+
+ mkdir handout
+ cp *.sty *.tex *.pdf latexmkrc makefile README handout
+
+ mkdir handout/examples
+ cp examples/*pdf examples/*tex examples/*bib examples/latexmkrc examples/makefile handout/examples
+
+ mkdir handout/examples/txt
+ cp examples/txt/*tex handout/examples/txt
+ zip -r ../handout.zip handout
+
+clean:
+ $(MAKE) -C examples clean
+ @$(RM) *.pdf *.toc *.aux *.out *.fdb_latexmk *.log *.bbl *.bcf *.blg *run.xml *.synctex.gz* *.pyg
+ rm -rf handout