summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/scanpages
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-03-29 21:24:48 +0000
committerKarl Berry <karl@freefriends.org>2016-03-29 21:24:48 +0000
commit61c652c6ab0d56352e59455266ca1d649ba244d6 (patch)
treed0af0720070116c664d5848da7c4ec5c5c79909a /Master/texmf-dist/tex/latex/scanpages
parent86d055cf3a39706e11cf2f143633f70879052726 (diff)
scanpages (29mar16)
git-svn-id: svn://tug.org/texlive/trunk@40177 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/scanpages')
-rw-r--r--Master/texmf-dist/tex/latex/scanpages/scanpages.sty28
1 files changed, 21 insertions, 7 deletions
diff --git a/Master/texmf-dist/tex/latex/scanpages/scanpages.sty b/Master/texmf-dist/tex/latex/scanpages/scanpages.sty
index 5d24e8625e0..c049983fd4c 100644
--- a/Master/texmf-dist/tex/latex/scanpages/scanpages.sty
+++ b/Master/texmf-dist/tex/latex/scanpages/scanpages.sty
@@ -5,8 +5,8 @@
% Copyright (c) 2014 by Michael Sharpe, msharpe at ucsd dot edu;
% This is free software, subject to the LATEX Project Public License.
-\def\fileversion{1.03}
-\def\filedate{2014/05/01}
+\def\fileversion{1.04}
+\def\filedate{2016/03/28}
\ProvidesPackage{scanpages.sty}[\filedate\space v\fileversion]
\message{`scanpages' v\fileversion, \filedate\space Macros to help create documents from scanned pages (msharpe)}
@@ -19,7 +19,7 @@
\RequirePackage{graphicx}
\RequirePackage{etoolbox}
\ifpdf\else
- \@latex@error{Must be processed in pdf[la]tex!}\@eha
+ \@latex@error{Must be processed with pdf[la]tex!}\@eha
\fi
\newif\ifscanp@nogrid
\define@boolkey{scanp}{nogrid}[true]{%
@@ -43,6 +43,13 @@
\x}
\ProcessOptions*
+%new
+\newcommand{\origpgcmd}{\put(\scanp@srcw,-30){p.\ \the\origpgnum\ in orig.}}
+\newcount\origpgnum %page in original
+\newif\ifscanp@origindest
+\newif\ifscanp@origingrid
+\newif\ifscanp@change
+% end new
\newcount\scanp@pgcnt
\setlength\unitlength{1bp}
\long\def\putn(#1,#2)#3{%
@@ -89,6 +96,9 @@
}
\initviewport{\scanp@srcscale}{\scanp@llx}{\scanp@lly}{\scanp@srcw}{\scanp@srcw}
%
+\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}
\define@key{scanpi}{dx}{\def\scanp@dx{#1}}
\define@key{scanpi}{dy}{\def\scanp@dy{#1}}
\define@key{scanpi}{page}{\def\scanp@page{#1}}
@@ -97,7 +107,10 @@
\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}%
+\def\scanpage@i[#1]#2{\advance\scanp@pgcnt\@ne\begingroup\setkeys{scanpi}{#1}%
+\ifscanp@change\global\scanp@origindesttrue %
+ \global\scanp@origingridfalse %
+ \global\scanp@changefalse \fi%
\edef\scanp@head{\noexpand\vspace*{\scanp@yindent}\noexpand\noindent\noexpand\hspace*{\scanp@xindent}\noexpand\picture(\strip@pt\scanp@dwdimbp,\strip@pt\scanp@dhdimbp)}
%\edef\@x{\strip@pt\scanp@dwdimbp}\edef\@y{\strip@pt\scanp@dhdimbp}
%\vspace*{\the\scanp@yindent}\noindent\hspace*{\scanp@xindent}\picture(\@x,\@y)
@@ -115,8 +128,9 @@
\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)
-\thegrid{\strip@pt\scanp@dwdimbp}{\strip@pt\scanp@dhdimbp}
-}
+\ifscanp@origindest\origpgcmd\fi
+\thegrid{\strip@pt\scanp@dwdimbp}{\strip@pt\scanp@dhdimbp}%
+\global\advance\origpgnum\@ne}
\ifscanp@nogrid\def\thegrid#1#2{}\else%
\long\def\thegrid#1#2{\edef\scanp@gcmd{\noexpand\put(0,0){\noexpand\line(1,0){#1}}
@@ -138,7 +152,7 @@
\put(\x,-15){\x}}
\put(0,-30){\color{blue}Page \the\scanp@pgcnt}%
\scanp@gcmd%
-}
+\ifscanp@origingrid\origpgcmd\fi}
\fi % end \ifscanp@nogrid
\endinput \ No newline at end of file