summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-10-10 21:15:31 +0000
committerKarl Berry <karl@freefriends.org>2016-10-10 21:15:31 +0000
commit14ee829b923fee3fbf3d06640862706e04d84cd2 (patch)
tree08c5658ce06e4c8492be0d43d035a2e26a47ad34
parentd4bcdd471d32a18a14ce486284c593d3cb90f7a1 (diff)
scanpages (10oct16)
git-svn-id: svn://tug.org/texlive/trunk@42249 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/scanpages/README6
-rw-r--r--Master/texmf-dist/doc/latex/scanpages/pic1.pdfbin0 -> 3699 bytes
-rw-r--r--Master/texmf-dist/doc/latex/scanpages/pic2.pdfbin0 -> 4289 bytes
-rw-r--r--Master/texmf-dist/doc/latex/scanpages/scanpages-doc.pdfbin64666 -> 233176 bytes
-rw-r--r--Master/texmf-dist/doc/latex/scanpages/scanpages-doc.tex97
-rw-r--r--Master/texmf-dist/fonts/map/dvips/scanpages/scanpages.map1
-rw-r--r--Master/texmf-dist/fonts/tfm/public/scanpages/scanwipe.tfmbin0 -> 148 bytes
-rw-r--r--Master/texmf-dist/fonts/type1/public/scanpages/scanwipe.pfbbin0 -> 2627 bytes
-rw-r--r--Master/texmf-dist/tex/latex/scanpages/scanpages.sty47
-rw-r--r--Master/texmf-dist/tex/latex/scanpages/uscanwipe.fd6
-rwxr-xr-xMaster/tlpkg/libexec/ctan2tds1
-rw-r--r--Master/tlpkg/tlpsrc/scanpages.tlpsrc1
12 files changed, 92 insertions, 67 deletions
diff --git a/Master/texmf-dist/doc/latex/scanpages/README b/Master/texmf-dist/doc/latex/scanpages/README
index 5c4a9bd6cbc..5e9cb19d5e6 100644
--- a/Master/texmf-dist/doc/latex/scanpages/README
+++ b/Master/texmf-dist/doc/latex/scanpages/README
@@ -16,7 +16,11 @@ LaTeX package scanpages
#
# This work consists of the files scanpages.sty, replicate.py and replicate.plist.
-Version: 1.04, 2016/03/28
+Current version: 1.05, 2016/10/09
+
+Changes in version 1.05
+1. Corrected some misbehaviors in scanpages.sty and some misinformaion in scanpages-doc.
+2. Made a small font with just a square and circular shape to act as eraser-heads---used in new macros \whitesq, \whitecirc.
Changes in version 1.04
Added options to include the page number from the original scanned document. (Thanks to Gill Williamson for his very useful input on this feature.)
diff --git a/Master/texmf-dist/doc/latex/scanpages/pic1.pdf b/Master/texmf-dist/doc/latex/scanpages/pic1.pdf
new file mode 100644
index 00000000000..9e562d3eab2
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/scanpages/pic1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/scanpages/pic2.pdf b/Master/texmf-dist/doc/latex/scanpages/pic2.pdf
new file mode 100644
index 00000000000..5c2cd17066f
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/scanpages/pic2.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/scanpages/scanpages-doc.pdf b/Master/texmf-dist/doc/latex/scanpages/scanpages-doc.pdf
index fde28e1e823..9d20074ae33 100644
--- a/Master/texmf-dist/doc/latex/scanpages/scanpages-doc.pdf
+++ b/Master/texmf-dist/doc/latex/scanpages/scanpages-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/scanpages/scanpages-doc.tex b/Master/texmf-dist/doc/latex/scanpages/scanpages-doc.tex
index 7618b31a5bd..af1d28791b5 100644
--- a/Master/texmf-dist/doc/latex/scanpages/scanpages-doc.tex
+++ b/Master/texmf-dist/doc/latex/scanpages/scanpages-doc.tex
@@ -1,7 +1,9 @@
+% !TEX TS-program = pdflatex
\documentclass[11pt]{article}
\usepackage[margin=1in]{geometry}
\usepackage[parfill]{parskip}% Begin paragraphs with an empty line rather than an indent
\usepackage{graphicx}
+\pdfmapfile{+scanpages.map}
%SetFonts
% libertine+newtxmath
\usepackage[lining]{libertine}
@@ -9,13 +11,14 @@
\usepackage{textcomp}
\usepackage[scaled=.85]{beramono}
\usepackage{amsmath,amsthm}
-\usepackage[libertine,bigdelims]{newtxmath}
+\usepackage[libertine]{newtxmath}
\usepackage{url}
\useosf
\usepackage[supstfm=libertinesups,%
supscaled=1.2,%
raised=-.13em]{superiors}
%SetFonts
+\usepackage{scanpages}
\title{The \textsf{Scanpages} Package}
\author{Michael Sharpe}
\date{\today} % Activate to display a given date or no date
@@ -23,9 +26,9 @@
\begin{document}
\maketitle
\section{Briefly}
-This package is intended for production of documents based on scanned material in any format acceptable to \textsf{pdflatex} as a graphic inclusion---eg, {\tt pdf}, {\tt png}, {\tt jpg}. For me, the format has been useful when trying to archive pre-\TeX\ documents without converting them to \LaTeX\ source documents but inputting the scanned pages one by one and adding indexing, hyperlinks, a table of contents (You'll have to do this using \verb|\addcontentsline{toc}...|, and if using \textsf{hyperref}, you may need to add \verb|\phantomsection| immediately before \verb|\addcontentsline|), footnotes, marginal notes and the like. What makes scanned documents bothersome is the irregularities introduced by the scanning process. Pages are sometimes skewed and often offset horizontally and/or vertically from one another, and extraneous marks will likely appear, so each page may need adjustments. The methods of this package are of two types. First, the package {\tt scanpages.sty} contains macros to make it more convenient to perform those adjustments and add adornments. Second, some kind of script is very useful for making the relevant part of the {\tt tex} source, if you are handling more than a few pages of scanned material. For this, there are two almost equivalent scripts included to automate this process as much as possible, one written in \textsf{python}, the other in \textsf{AppleScript.} (The letter may be installed in \TeX Shop's macro menu for completely self-contained usage.)
+This package is intended for production of documents based on scanned material in any format acceptable to \textsf{pdflatex} as a graphic inclusion---eg, {\tt pdf}, {\tt png}, {\tt jpg}, though {\tt pdf} works best with this package. For me, the format has been useful when trying to archive pre-\TeX\ documents without converting them to \LaTeX\ source documents but inputting the scanned pages one by one and adding indexing, hyperlinks, a table of contents (You'll have to do this using \verb|\addcontentsline{toc}...|, and if using \textsf{hyperref}, you may need to add \verb|\phantomsection| immediately before \verb|\addcontentsline|), footnotes, marginal notes and the like. What makes scanned documents bothersome is the irregularities introduced by the scanning process. Pages are sometimes skewed and often offset horizontally and/or vertically from one another, and extraneous marks will likely appear, so each page may need adjustments. The methods of this package are of two types. First, the package {\tt scanpages.sty} contains macros to make it more convenient to perform those adjustments and add adornments. Second, some kind of script is very useful for making the relevant part of the {\tt tex} source, if you are handling more than a few pages of scanned material. For this, there are two almost equivalent scripts included to automate this process as much as possible, one written in \textsf{python}, the other in \textsf{AppleScript.} (The letter may be installed in \TeX Shop's macro menu for completely self-contained usage.)
\section{The \LaTeX\ package}
-Starting with a scanned document, you need to measure four dimensions governed by the region you wish to import, and decide on a magnification factor to apply. The region to import from the scan should ideally be a bit larger (10{\tt pt} is a good starting value) than the area typically containing all the data, and perhaps excluding original page numbers. The four critical dimensions are:
+Starting with a scanned document, you need to measure four dimensions to specify by the region you wish to import, and decide on a magnification factor to apply. The region to import from the scan should ideally be a bit larger (10{\tt pt} is a good starting value) than the area typically containing all the data, and perhaps excluding original page numbers. (The part of the scanned page lying outside the region is cropped.) The four critical dimensions are:
\begin{itemize}
\item
The $x$ and $y$ coordinates {\tt llx, lly} of the lower left corner of the image region (the part you want to import) relative to the lower left corner of the scanned page;
@@ -44,9 +47,9 @@ It is not an error to omit one or more of these values, as default values will b
\item {\tt w} defaults to {\tt 400pt}.
\item {\tt h} defaults to {\tt 600pt}.
\end{itemize}
-The package creates then a destination box centered horizontally and vertically in the page and runs \verb|\includegraphics| with appropriate values whenever it sees entries like
+The package creates then a destination box centered horizontally and vertically in the page and runs \verb|\includegraphics| with appropriate values set for the {\tt viewport} and {\tt crop} whenever it sees entries like
\begin{verbatim}
-\scanpage[rot=-1,page=1,dx=20,dy=15]{scan-0}
+\scanpage[rot=-1,page=1,dx=20,dy=15]{scan-0} % page= only for pdf files
%\index{}
%\put(450,250){Is this assertion correct?}
\endpicture\endgroup\newpage
@@ -54,10 +57,14 @@ The package creates then a destination box centered horizontally and vertically
which it interprets as follows:
\begin{itemize}
\item
-{\tt rot} is an angle of rotation (degrees) in the mathematically positive sense (counter-clockwise) about the center. You may find it easier to enter {\tt tanrot=0.175}, the tangent of the rotation angle, as this is more easily estimated from the picture.
-{\tt page=1} selects the first page of the file {\tt scan-0.pdf}. This option may be omitted if the file contains only one page.
-\item {\tt dx} nudges the resulting picture to the right by {\tt 20bp}, and similarly for {\tt dy}. (Actually, {\tt dx} nudges the {\tt viewport} to the left by {\tt 20bp/scale}.) If no unit is provided, {\tt bp} is assumed.
-\item Any material following the \verb|\scanpage| line and before \verb|\endpicture| can be used for index entries, table of contents entries, footnotes and the like. As the action is all taking place within a \LaTeX\ {\tt picture} environment, each visible item must be placed in an instruction of the form
+if {\tt scan-0} is a blank string, a blank picture is produced, otherwise, if no corresponding graphic file can be found, {\tt graphicx} will stop with an error message;
+\item
+{\tt page=} will be understood only by {\tt.pdf} inclusions;
+\item
+{\tt rot} is an angle of rotation (degrees) in the mathematically positive sense (counter-clockwise) about the center. You may find it easier to enter {\tt tanrot=0.175}, the tangent of the rotation angle, as this is more easily estimated from the picture;
+{\tt page=1} selects the first page of the file {\tt scan-0.pdf}. This option may be omitted if the file contains only one page;
+\item {\tt dx} nudges the resulting picture to the right by {\tt 20bp}, and similarly for {\tt dy}. (Actually, {\tt dx} nudges the {\tt viewport} to the left by {\tt 20bp/scale}.) If no unit is provided, {\tt bp} is assumed;
+\item any material following the \verb|\scanpage| line and before \verb|\endpicture| can be used for index entries, table of contents entries, footnotes, additional graphic inclusions, annotations and the like. As the action is all taking place within a \LaTeX\ {\tt picture} environment, each visible item must be placed in an instruction of the form
\begin{verbatim}
\put(x,y){...}
\end{verbatim}
@@ -69,45 +76,21 @@ The page it produces contains, in addition to the scan material and other embell
The \verb|\scanpage| macro also accepts three additional options that allow the page number from the original scanned document to be displayed.
\begin{itemize}
\item
-\verb|origpgnum=104| sets the current page number from the orginal scanned document to {\tt 104}, and specifies that this number should appear only when the {\tt grid} is in use---that is, except when the option {\tt nogrid} is in force. Unless modified by an option in a future page, the scanned page number will increment by one and display on all subsequent pages.
+\verb|origpgnum=104| sets the current scanned page number to {\tt 104}, and specifies that this number should appear only when the {\tt grid} is in use---that is, except when the option {\tt nogrid} is in force. Unless modified by an option in a future page, the scanned page number will increment by one and display on all subsequent pages.
\item \verb|origindest| specifies that the current scanned page number should be visible in the final document.
\item \verb|origpgnumoff| prevents the scanned page number from appearing in either the final document or the grid, from this page forward.
\item
The format governing the display of the current scanned page number is set by the macro \verb|\origpgcmd|, whose default value is
\begin{verbatim}
-\newcommand{\origpgcmd}{\put(400,-30){p.\ $\the\origpgnum$ in orig.}}
+\newcommand{\origpgcmd}{\put(400,-30){\texttt{Orig. page \# \the\origpgnum}}}
\end{verbatim}
which specifies that entries like
\begin{verbatim}
-p. 104 in orig.
+Orig. page # 104
\end{verbatim}
-will appear with baseline {\tt 30bp} (about 3/8 in) below the target box and {\tt 400bp} ( about {\tt5.6in}) from its left edge. You may change this after loading {\tt scanpages} with a similar line like
+will appear with baseline {\tt 30bp} (about 3/8 in) below the target box and {\tt 400bp} ( about {\tt5.6in}) from its left edge. You may change this in your preamble, after loading {\tt scanpages}, with a similar line, like
\begin{verbatim}
-\renewcommand{\origpgcmd}{\put(250,-30){\color{red}%
-This was p.\ $\the\origpgnum$ in the original}}
-\end{verbatim}
-It is important to note that this will have no effect if it is placed within a block of the form
-\begin{verbatim}
-\scanpage[...]{}
-
-\endpicture\endgroup
-\end{verbatim}
-\item \textsc{Example:}
-\begin{verbatim}
-\scanpage[page=1]{scanneddoc.pdf}% no orig page number
-\endpicture\endgroup\newpage
-%
-\scanpage[page=2,origpgnum=87,origpgdest]{scanneddoc.pdf}
-% the final doc will show the orig page no 87
-\endpicture\endgroup\newpage
-%
-\scanpage[page=3]{scanneddoc.pdf}
-% the final doc will show the orig page no 88
-\endpicture\endgroup\newpage
-%
-\scanpage[page=4,origpgnumoff]{scanneddoc.pdf}
-% the orig page no (89) will not display, but its counter increments
-\endpicture\endgroup\newpage
+\renewcommand{\origpgcmd}{...}
\end{verbatim}
@@ -117,11 +100,11 @@ It is important to note that this will have no effect if it is placed within a b
\subsection{Resetting the initial choices}
The options you chose when loading the package may be changed in the middle of a document. Just insert
\begin{verbatim}
-\initviewport{<scale>,<llx>,<lly>,<w>,<h>}
+\initviewport{<scale>}{<llx>}{<lly>}{<w>}{<h>}
\end{verbatim}
-to change your initial choice of options. Eg,
+to change your initial choice of options. E.g.,
\begin{verbatim}
-\initviewport{.95,3cm,4cm,8cm,12cm}
+\initviewport{.95}{3cm}{4cm}{8cm}{12cm}
\end{verbatim}
will in effect make {\tt scale=.95}, {\tt llx=3cm}, {\tt lly=4cm}, {\tt w=8cm} and {\tt h=12cm}.
\section{Making a source entry for each page}
@@ -176,20 +159,16 @@ Scanning software often places each scanned page in a separate file with names l
\end{verbatim}
\end{itemize}
\section{Whiting out scan artifacts}
-Use a white rectangular box to overwrite scan artifacts. The simplest method may be to use \verb|\rule|, like this:
+Use a white rectangular box to overwrite scan artifacts. The package provides some macros to assist. Both are based on glyphs in a special font included as part of the {\tt scanpages} package, one a square shape and one a circular shape, each 500 units wide and tall, with zero depth and zero side-bearings. (At {\tt 10pt} typesetting, 500 units amounts to {\tt 5pt}.)
\begin{verbatim}
-\put(150,200){% lower left corner at (150,200)
-{\color{white}\rule{10pt}{5pt}}% solid white rect 10pt wide, 5pt high
-}
+\whitesq(150,200){5} % height and width scaled by 5
+\whitesq(150,200){5}[2] % height scaled by 5, width by 2
\end{verbatim}
-For more precise whiteouts which allow you to overwrite existing material, use something like
\begin{verbatim}
-\setlength{\fboxsep}{1bp} % This line sets the width of border of opaque white
-% around the text in the \colorbox
-\put(.,.){\colorbox{white}{$y=$}} % places $y=$ with an opaque white background
-% 1bp larger than the minimal bounding box for $y=$.
+\whitecirc(150,200){5} % height and width scaled by 5
+\whitecirc(150,200){5}[2] % height scaled by 5, width by 2
\end{verbatim}
-
+the only difference being in the the shape of the of the region whited out.
\section{Differences between the scripts}
The AppleScript is meant to work within TeXShop after installation in the TeXShop Macros Menu---see instructions below. It works on the selected part of the file, and its output is placed in the same file, which can be part of a larger document. The \textsf{python} script is meant to run from the command line on a file containing just the pattern text, and produces output in the same file, which can then be copied than into your working {\tt.tex} document. Eg, if you copied the script into a directory on your {\tt PATH} and made it executable
\begin{verbatim}
@@ -200,4 +179,20 @@ The two scripts give the same output provided you use variable names that are id
line. (In the examples above, this was always {\tt NNN}.) The \textsf{python} script is case sensitive, but the AppleScript is not---it will act on any variant like {\tt nnn0} or {\tt NnN1} as well.
\subsection{Installation in TeXShop's Macros Menu}
Select \TeX Shop's Macros Menu and choose the top item---\textsf{Open Macro Editor ... }. Then, from the same menu, choose the second item---\textsf{Add macros from file ...}---and navigate to {\tt replicate.plist} in this distribution. When you choose that file, the AppleScript will be installed under the name \textsf{Replicate} in the Macros Menu.
+\section{Example}
+The last page of this document shows the result of using {\tt scanpage} with a blank filename, which does nothing but create a blank picture with a grid, then overwrite a part of the page with a portion of another. The illustration will not show the ({\tt nogrid}) final result.
+\begin{verbatim}
+\newpage
+\initviewport{1}{1in}{1in}{8cm}{12cm}
+\scanpage{}
+%viewport=xl yl xr yr
+\put(100,200){\includegraphics[viewport=165 530 300 700,clip]{pic1}}
+\endpicture\endgroup\newpage
+\end{verbatim}
+\newpage
+\initviewport{1}{1in}{1in}{8cm}{12cm}
+\scanpage{}
+%viewport=xl yl xr yr
+\put(100,200){\includegraphics[viewport=165 530 300 700,clip]{pic1}}
+\endpicture\endgroup\newpage
\end{document} \ No newline at end of file
diff --git a/Master/texmf-dist/fonts/map/dvips/scanpages/scanpages.map b/Master/texmf-dist/fonts/map/dvips/scanpages/scanpages.map
new file mode 100644
index 00000000000..b5503df694d
--- /dev/null
+++ b/Master/texmf-dist/fonts/map/dvips/scanpages/scanpages.map
@@ -0,0 +1 @@
+scanwipe scanwipe <scanwipe.pfb
diff --git a/Master/texmf-dist/fonts/tfm/public/scanpages/scanwipe.tfm b/Master/texmf-dist/fonts/tfm/public/scanpages/scanwipe.tfm
new file mode 100644
index 00000000000..eb591c0f2f2
--- /dev/null
+++ b/Master/texmf-dist/fonts/tfm/public/scanpages/scanwipe.tfm
Binary files differ
diff --git a/Master/texmf-dist/fonts/type1/public/scanpages/scanwipe.pfb b/Master/texmf-dist/fonts/type1/public/scanpages/scanwipe.pfb
new file mode 100644
index 00000000000..adec8f8a6a6
--- /dev/null
+++ b/Master/texmf-dist/fonts/type1/public/scanpages/scanwipe.pfb
Binary files differ
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
diff --git a/Master/tlpkg/libexec/ctan2tds b/Master/tlpkg/libexec/ctan2tds
index d2bf0d59df1..736ca681d3f 100755
--- a/Master/tlpkg/libexec/ctan2tds
+++ b/Master/tlpkg/libexec/ctan2tds
@@ -981,7 +981,6 @@ chomp ($Build = `cd $Master/../Build/source && pwd`);
'sagetex', "die 'skipping, omitted at author request (25 Jan 2010 19:50:16)'",
'sansmathaccent', "&MAKEflatten",
'sansmathfonts', "&MAKEflatten",
- 'scanpages', "&MAKEflatten",
'schedule', "die 'skipping, noinfo license, too old to matter'",
'schulschriften', "&MAKEflatten",
'scientifixpaper', "die 'skipping, noinfo license'",
diff --git a/Master/tlpkg/tlpsrc/scanpages.tlpsrc b/Master/tlpkg/tlpsrc/scanpages.tlpsrc
index e69de29bb2d..fc4bf8b70ed 100644
--- a/Master/tlpkg/tlpsrc/scanpages.tlpsrc
+++ b/Master/tlpkg/tlpsrc/scanpages.tlpsrc
@@ -0,0 +1 @@
+execute addMap scanpages.map