diff options
author | Karl Berry <karl@freefriends.org> | 2016-10-10 21:15:31 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-10-10 21:15:31 +0000 |
commit | 14ee829b923fee3fbf3d06640862706e04d84cd2 (patch) | |
tree | 08c5658ce06e4c8492be0d43d035a2e26a47ad34 /Master/texmf-dist/tex/latex/scanpages | |
parent | d4bcdd471d32a18a14ce486284c593d3cb90f7a1 (diff) |
scanpages (10oct16)
git-svn-id: svn://tug.org/texlive/trunk@42249 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/scanpages')
-rw-r--r-- | Master/texmf-dist/tex/latex/scanpages/scanpages.sty | 47 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/scanpages/uscanwipe.fd | 6 |
2 files changed, 39 insertions, 14 deletions
diff --git a/Master/texmf-dist/tex/latex/scanpages/scanpages.sty b/Master/texmf-dist/tex/latex/scanpages/scanpages.sty index c049983fd4c..56f24122307 100644 --- a/Master/texmf-dist/tex/latex/scanpages/scanpages.sty +++ b/Master/texmf-dist/tex/latex/scanpages/scanpages.sty @@ -2,12 +2,12 @@ % A package to help make a document based on scanned pages. % -% Copyright (c) 2014 by Michael Sharpe, msharpe at ucsd dot edu; +% Copyright (c) 2014--2016 by Michael Sharpe, msharpe at ucsd dot edu; % This is free software, subject to the LATEX Project Public License. -\def\fileversion{1.04} -\def\filedate{2016/03/28} -\ProvidesPackage{scanpages.sty}[\filedate\space v\fileversion] +\def\fileversion{1.05} +\def\filedate{2016/10/09} +\ProvidesPackage{scanpages}[\filedate\space v\fileversion] \message{`scanpages' v\fileversion, \filedate\space Macros to help create documents from scanned pages (msharpe)} % @@ -18,6 +18,7 @@ \RequirePackage{fp-basic} \RequirePackage{graphicx} \RequirePackage{etoolbox} +%\RequirePackage{trace} \ifpdf\else \@latex@error{Must be processed with pdf[la]tex!}\@eha \fi @@ -42,9 +43,10 @@ \noexpand\setkeys{scanp}{\CurrentOption}}% \x} \ProcessOptions* +\def\bp@ratio{.99264} % factor to multiply num of pt to get num of bp %new -\newcommand{\origpgcmd}{\put(\scanp@srcw,-30){p.\ \the\origpgnum\ in orig.}} +\newcommand{\origpgcmd}{\put(400,-30){p.\ $\the\origpgnum$ in orig.}} \newcount\origpgnum %page in original \newif\ifscanp@origindest \newif\ifscanp@origingrid @@ -57,7 +59,6 @@ \dimen0\@picht\advance\dimen0 -#2\unitlength% \raise\dimen0\hb@xt@\z@{\kern#1\unitlength #3\hss} \ignorespaces} -\def\bp@ratio{.99264} % factor to multiply num of pt to get num of bp \def\unitlength@off{\let\@unitlength\ignorespaces\ignorespaces} \def\scanp@setlength#1#2{% if #2 has no dimension, append dimension \let\@unitlength\unitlength @@ -78,15 +79,20 @@ % \def\initviewport#1#2#3#4#5{% srcscale,llx,lly,srcw,srch \scanp@pgcnt=\z@ -\FPdiv\scanp@invscale{1.0}{\scanp@srcscale} +\edef\scanp@srcscale{#1} +\FPdiv{\scanp@invscale}{1.0}{\scanp@srcscale} +\edef\scanp@llx{#2} +\edef\scanp@lly{#3} +\edef\scanp@srcw{#4} +\edef\scanp@srch{#5} \scanp@setlength{\scanp@swdim}{\scanp@srcw} \scanp@setlength{\scanp@shdim}{\scanp@srch} \scanp@dwdim=\scanp@srcscale\scanp@swdim \scanp@dhdim=\scanp@srcscale\scanp@shdim \scanp@dwdimbp=\bp@ratio\scanp@dwdim \scanp@dhdimbp=\bp@ratio\scanp@dhdim -\scanp@setlength{\scanp@xl}{#2} -\scanp@setlength{\scanp@yl}{#3} +\scanp@setlength{\scanp@xl}{\scanp@llx} +\scanp@setlength{\scanp@yl}{\scanp@lly} \scanp@xr=\scanp@xl \advance\scanp@xr\scanp@swdim \scanp@yr=\scanp@yl \advance\scanp@yr\scanp@shdim \scanp@xindent=\textwidth \scanp@yindent=\textheight @@ -94,8 +100,20 @@ \scanp@xindent=0.5\scanp@xindent\scanp@yindent=0.5\scanp@yindent \advance\scanp@yindent -14\p@ } -\initviewport{\scanp@srcscale}{\scanp@llx}{\scanp@lly}{\scanp@srcw}{\scanp@srcw} +\initviewport{\scanp@srcscale}{\scanp@llx}{\scanp@lly}{\scanp@srcw}{\scanp@srch} +% +\def\whitesq(#1)#2{% +\@ifnextchar[{\whitesq@(#1){#2}}{\whitesq@(#1){#2}[#2]}} +\long\def\whitesq@(#1)#2[#3]{\put(#1){\scalebox{#2}[#3]{\color{white}{\usefont{U}{scanwipe}{m}{n}\char"00}}}} +\def\whitecirc(#1)#2{% +\@ifnextchar[{\whitecirc@(#1){#2}}{\whitecirc@(#1){#2}[#2]}} +\long\def\whitecirc@(#1)#2[#3]{\put(#1){\scalebox{#2}[#3]{\color{white}{\usefont{U}{scanwipe}{m}{n}\char"01}}}} % +%\newdimen\scanp@whw\newdimen\scanp@whh %width, height of whiteout +%\def\whiteout(#1)#2#3{\scanp@setlength{\scanp@whw}{#2}% +%\scanp@setlength{\scanp@whh}{#3}% +%\put(#1){\color{white}\fcolorbox{white}{white}{\vrule width \the\scanp@whw height \the\scanp@whh}}} + \define@key{scanpi}{origpgnum}{\global\origpgnum=#1 \global\scanp@origingridtrue} \define@boolkey{scanpi}{origindest}[true]{\csname scanp@change#1\endcsname} \define@boolkey{scanpi}{origpgnumoff}[true]{\global\scanp@origindestfalse\global\scanp@origingridfalse} @@ -105,7 +123,7 @@ \define@key{scanpi}{rot}{\def\scanp@rot{#1}} \define@key{scanpi}{tanrot}{\def\scanp@skew{#1}} \newdimen\scanp@dxdim\newdimen\scanp@dydim - +% \def\scanpage{\@ifnextchar[\scanpage@i{\scanpage@i[]}} \def\scanpage@i[#1]#2{\advance\scanp@pgcnt\@ne\begingroup\setkeys{scanpi}{#1}% \ifscanp@change\global\scanp@origindesttrue % @@ -120,14 +138,15 @@ \scanp@xrbp=\bp@ratio\scanp@xr \scanp@ylbp=\bp@ratio\scanp@yl \scanp@yrbp=\bp@ratio\scanp@yr +%\ifblank{#2}{\global\scanp@blanktrue}{} \edef\scanp@cmd{viewport=\strip@pt\scanp@xlbp\space\strip@pt\scanp@ylbp\space\strip@pt\scanp@xrbp\space\strip@pt\scanp@yrbp, clip]{#2}} \ifdefvoid{\scanp@rot}{% \ifdefvoid{\scanp@skew}{}{% - \@dima=\scanp@skew\p@\@dima=57.14\@dima\edef\scanp@cmd{angle=\strip@pt\@dima,origin=c,\scanp@cmd}}}{\edef\scanp@cmd{angle=\scanp@rot,origin=c,\scanp@cmd}}% +\@dima=\scanp@skew\p@\@dima=57.14\@dima\edef\scanp@cmd{angle=\strip@pt\@dima,origin=c,\scanp@cmd}}}{\edef\scanp@cmd{angle=\scanp@rot,origin=c,\scanp@cmd}}% \if\scanp@srcscale\scanp@origscale\else\edef\scanp@cmd{scale=\scanp@srcscale,\scanp@cmd}\fi \ifdefvoid{\scanp@page}{}{\edef\scanp@cmd{page=\scanp@page,\scanp@cmd}} \edef\scanp@cmd{\noexpand\scanp@head\noexpand\put(0,0){\noexpand\includegraphics[\scanp@cmd}} -\scanp@cmd % \begingroup, start \picture, \put pdf at (0,0) +\ifblank{#2}{\scanp@head}{\scanp@cmd} % \begingroup, start \picture, \put pdf at (0,0) \ifscanp@origindest\origpgcmd\fi \thegrid{\strip@pt\scanp@dwdimbp}{\strip@pt\scanp@dhdimbp}% \global\advance\origpgnum\@ne} @@ -143,7 +162,7 @@ \foreach\x in {-300,-290,...,550}{% \put(\x,-500){\color{red!20}\line(0,1){1500}}% } -\foreach\x in{-400,-350,...,800}{% +\foreach\x in {-400,-350,...,800}{% \put(-400,\x){\color{red!50}\line(1,0){1000}}% \put(-20,\x){\x} } diff --git a/Master/texmf-dist/tex/latex/scanpages/uscanwipe.fd b/Master/texmf-dist/tex/latex/scanpages/uscanwipe.fd new file mode 100644 index 00000000000..2318f466d76 --- /dev/null +++ b/Master/texmf-dist/tex/latex/scanpages/uscanwipe.fd @@ -0,0 +1,6 @@ +\ProvidesFile{uscanwipe.fd} + [ scanwipe (Unknown encoding)] +\DeclareFontFamily{U}{scanwipe}{} +\DeclareFontShape{U}{scanwipe}{m}{n}{ +<-> scanwipe.tfm}{} +\endinput |