diff options
author | Karl Berry <karl@freefriends.org> | 2021-09-13 20:08:25 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-09-13 20:08:25 +0000 |
commit | 77c9c311ad25b7b4f1b27e14add6373167821163 (patch) | |
tree | ea0924458281473a37108a65cc4cb0698322a248 /Master/texmf-dist/tex | |
parent | 81a33834335e72d0faa60a3b1387c38fbfec5c6f (diff) |
clicks (13sep21)
git-svn-id: svn://tug.org/texlive/trunk@60498 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/clicks/clicks.sty | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/clicks/clicks.sty b/Master/texmf-dist/tex/latex/clicks/clicks.sty new file mode 100644 index 00000000000..e5fac0ebbc5 --- /dev/null +++ b/Master/texmf-dist/tex/latex/clicks/clicks.sty @@ -0,0 +1,74 @@ +% (The MIT License) +% +% Copyright (c) 2021 Yegor Bugayenko +% +% Permission is hereby granted, free of charge, to any person obtaining a copy +% of this software and associated documentation files (the 'Software'), to deal +% in the Software without restriction, including without limitation the rights +% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +% copies of the Software, and to permit persons to whom the Software is +% furnished to do so, subject to the following conditions: +% +% The above copyright notice and this permission notice shall be included in all +% copies or substantial portions of the Software. +% +% THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +% SOFTWARE. + +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{clicks}[2021/09/13 0.1.1 Clicks] + +\RequirePackage{xkeyval} +\RequirePackage{etoolbox} + +\makeatletter\newif\ifclicks@static\makeatother +\makeatletter\DeclareOption{static}{\clicks@statictrue}\makeatother +\ProcessOptions\relax + +\makeatletter\newcommand*\clicks@body{}\makeatother +\makeatletter\newcommand\clicks@flush{% + \clicks@body\vspace*{0pt}\newpage% +}\makeatother + +\newcounter{minutes} + +% Print the content as is +\makeatletter\newcommand\print[1]{% + \gappto\clicks@body{{#1\par}}% +}\makeatother + +\makeatletter\newcommand\flush[1][1]{% + \clicks@flush% + \renewcommand*\clicks@body{}% + \ifclicks@static\else% + \addtocounter{minutes}{#1}% + \fi% +} + +\makeatletter\newcommand\click{% + \ifclicks@static\else% + \clicks@flush% + \fi% +}\makeatother + +% Print and flush +% [1]: How many minutes to stay here +% {1}: The content to print +\newcommand\plush[2][1]{% + \print{#2}% + \flush[#1]% +} + +% Print and click +% {1}: The content to print +\newcommand\plick[1]{% + \print{#1}% + \click% +} + +\endinput |