summaryrefslogtreecommitdiff
path: root/texmf-dist/tex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2018-06-12 08:07:19 +0900
committerNorbert Preining <norbert@preining.info>2018-06-12 08:07:19 +0900
commit3c18186d7c1bc4aa0a3f5727b5dbe5a251687d9c (patch)
tree5b945b95730cae1a07320b1c1f3d5dece42f796c /texmf-dist/tex
parent76948a9dde88d0b50fd8d5485e2a9e5fff668bd6 (diff)
add qrcstamps
Diffstat (limited to 'texmf-dist/tex')
-rw-r--r--texmf-dist/tex/latex/qrcstamps/qrcstamps.sty59
-rw-r--r--texmf-dist/tex/latex/qrcstamps/scandoc-grc.def55
2 files changed, 114 insertions, 0 deletions
diff --git a/texmf-dist/tex/latex/qrcstamps/qrcstamps.sty b/texmf-dist/tex/latex/qrcstamps/qrcstamps.sty
new file mode 100644
index 00000000..dc83a5de
--- /dev/null
+++ b/texmf-dist/tex/latex/qrcstamps/qrcstamps.sty
@@ -0,0 +1,59 @@
+%%
+%% This is file `qrcstamps.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% qrcstamps.dtx (with options: `copyright,package')
+%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% qrcstamps.sty package, %%
+%% Copyright (C) 2017 %%
+%% dpstory@uakron.edu %%
+%% %%
+%% This program can redistributed and/or modified under %%
+%% the terms of the LaTeX Project Public License %%
+%% Distributed from CTAN archives in directory %%
+%% macros/latex/base/lppl.txt; either version 1.2 of the %%
+%% License, or (at your option) any later version. %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\NeedsTeXFormat{LaTeX2e}[1997/12/01]
+\ProvidesPackage{qrcstamps}
+ [2018/06/02 v1.0 qrcstamps: Create QR codes using stamps]
+\RequirePackage{xkeyval}
+\DeclareOptionX{scandoc}{\let\grc@InputScanDoc\qr@scanDoc}
+\DeclareOptionX{!scandoc}{\let\grc@InputScanDoc\relax}
+\let\grc@InputScanDoc\relax
+\def\qr@scanDoc{\InputIfFileExists{scandoc-grc.def}{\PackageInfo{qrcstamps}
+ {Inputting the scandoc-grc.def file}}
+ {\PackageWarning{qrcstamps}{Cannot find the file scandoc-grc.def}}}
+\DeclareOptionX{basename}{\def\QRBase{#1}}
+\def\QRBase{AeBQRC}
+\DeclareOptionX*{\PassOptionsToPackage{\CurrentOption}{insdljs}}
+\ProcessOptionsX
+\RequirePackage{annot_pro}[2017/06/06]
+\ifx\grc@InputScanDoc\relax\else\let\execjs=y\fi
+\define@choicekey+{annotprostampQR}{size}[\val\nr]{%
+small,medium,large}[small]{\ifcase\nr\relax
+ \def\apstamp@@size{Small}\def\qrc@def@W{1in}\or
+ \def\apstamp@@size{Med}\def\qrc@def@W{1.5in}\or
+ \def\apstamp@@size{Large}\def\qrc@def@W{2in}\else
+ \def\apstamp@@size{Small}\def\qrc@def@W{1in}\fi}%
+{\PackageWarning{qrcstamps}{Invalid choice of `size=#1'\MessageBreak
+ Permissible values are small, medium, large}}
+\def\apstamp@@size{Small}
+\define@boolkey{annotprostampQR}{allowresize}[true]{}
+\define@key{annotprostampQR}{basename}[\QRBase]{\edef\QRBase{#1}}
+\define@key{annotprostampQR}{contents}[]{\long\def\qrc@contents{#1}}
+\let\qrc@contents\@empty
+\newcommand\qrCode[2][]{\begingroup\def\n{\string\n}%
+ \def\apstamp@@size{Small}\def\qrc@def@W{1in}%
+ \setkeys*{annotprostampQR}{#1}%
+ \annotpro*[widthTo=\qrc@def@W,#1,type=stamp,
+ \ifKV@annotprostampQR@allowresize\else readonly\fi,
+ title=QRC,subject={#2},%
+ name=\#\QRBase_\apstamp@@size]{\qrc@contents}\endgroup}
+\grc@InputScanDoc
+\endinput
+%%
+%% End of file `qrcstamps.sty'.
diff --git a/texmf-dist/tex/latex/qrcstamps/scandoc-grc.def b/texmf-dist/tex/latex/qrcstamps/scandoc-grc.def
new file mode 100644
index 00000000..148cdbc9
--- /dev/null
+++ b/texmf-dist/tex/latex/qrcstamps/scandoc-grc.def
@@ -0,0 +1,55 @@
+%%
+%% This is file `scandoc-grc.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% qrcstamps.dtx (with options: `copyright,scandoc')
+%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% qrcstamps.sty package, %%
+%% Copyright (C) 2017 %%
+%% dpstory@uakron.edu %%
+%% %%
+%% This program can redistributed and/or modified under %%
+%% the terms of the LaTeX Project Public License %%
+%% Distributed from CTAN archives in directory %%
+%% macros/latex/base/lppl.txt; either version 1.2 of the %%
+%% License, or (at your option) any later version. %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{execJS}{scan4qrc}
+var aBCStamps=new Array();
+if (typeof scancomplete=="undefined") {
+ var scancomplete=false,annots,isStamp,isHashtag;
+ this.syncAnnotScan();
+ for (var p=0; p<this.numPages; p++) {
+ annots=this.getAnnots(p);
+ if (annots!=null) {
+ for (var i=0; i<annots.length; i++) {
+ isStamp=(annots[i].type=="Stamp");
+ isHashtag=(annots[i].AP.indexOf("\#")==0);
+ if ( isStamp && isHashtag ) {
+ aBCStamps.push(p);
+ break;
+ }
+ }
+ }
+ }
+}
+QRCscrollPage.index=0;
+function QRCscrollPage() {
+ if (QRCscrollPage.index<aBCStamps.length) {
+ this.pageNum=aBCStamps[QRCscrollPage.index];
+ QRCscrollPage.index+=1;
+ } else {
+ app.clearInterval(qrcTO);
+ scancomplete=true;
+ this.pageNum=0;
+ }
+}
+if (aBCStamps.length>0)
+ var qrcTO=app.setInterval("QRCscrollPage()", 5);
+\end{execJS}
+\endinput
+%%
+%% End of file `scandoc-grc.def'.