From bea41f5e2c2a13912cb3e946f8939964e5dd5857 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 7 Jan 2015 22:55:21 +0000 Subject: handout (7jan15) git-svn-id: svn://tug.org/texlive/trunk@35986 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/handout/handout.sty | 32 +++++++++++++++++-------- 1 file changed, 22 insertions(+), 10 deletions(-) (limited to 'Master/texmf-dist/tex') diff --git a/Master/texmf-dist/tex/latex/handout/handout.sty b/Master/texmf-dist/tex/latex/handout/handout.sty index 3431b2ea531..41655ac69cc 100644 --- a/Master/texmf-dist/tex/latex/handout/handout.sty +++ b/Master/texmf-dist/tex/latex/handout/handout.sty @@ -13,7 +13,7 @@ % 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}[2014/12/15 1.1.0 Handout package] +\ProvidesPackage{handout}[2015/01/06 1.2.0 Handout package] \RequirePackage{kvoptions,etoolbox} % Options @@ -24,6 +24,8 @@ \DeclareBoolOption[false]{numbering} \DeclareBoolOption[false]{sectioning} +\DeclareBoolOption[true]{printing} + \DeclareStringOption[.]{dir} \ProcessKeyvalOptions* @@ -43,7 +45,9 @@ \stepcounter{handoutnumber}% \handoutnumberintxt{\thehandoutnumber}% \fi% - \immediate\write\@handout {\string\csuse{handout@input}{#1}}% + \ifhandout@printing% + \immediate\write\@handout {\string\handout@input{#1}}% + \fi% \fi% \input{\handout@dir/#1}% Add the handout } @@ -55,7 +59,9 @@ \newcommand{\onlyhandout}[1]{} \newcommand{\forhandout}[1]{% \ifhandout@disabled\else% - \immediate\write\@handout{\noexpand #1}% + \ifhandout@printing% + \immediate\write\@handout{\noexpand #1}% + \fi% \fi% } @@ -73,7 +79,9 @@ \apptocmd{\@sect}{% \ifhandout@disabled\else% - \immediate\write\@handout{\string\csuse{#1}{\unexpanded{#8}}}% + \ifhandout@printing% + \immediate\write\@handout{\string\csuse{#1}{\unexpanded{#8}}}% + \fi% \fi% }{}{\handout@warning{Can't patch sectioning commands}} @@ -81,12 +89,16 @@ % Call the handout file at the end, if need \AtEndDocument{% - \ifhandout@disabled\else - \immediate\closeout\@handout% - \before@handout% - \ifdef{\beforehandout}{\beforehandout}{\handout@warning{No command defined to be run before handout}} - \input\jobname.handout% - \fi + \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% + \fi% + \fi% } % Standard command before handout -- cgit v1.2.3