diff options
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/latex/xwatermark/README | 6 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/xwatermark/tab-globaloptions.tex | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/xwatermark/tab-localoptions.tex | 3 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples.cfg | 248 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples1.pdf | bin | 169240 -> 0 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples1.tex | 86 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples2.pdf | bin | 179583 -> 0 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples2.tex | 199 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide.cfg | 23 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide.tex | 14 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/xwatermark/xwatermark-test-20120201.tex | 52 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/xwatermark/xwatermark.sty | 576 |
12 files changed, 395 insertions, 814 deletions
diff --git a/Master/texmf-dist/doc/latex/xwatermark/README b/Master/texmf-dist/doc/latex/xwatermark/README index 0322e818dc3..28420e50d05 100644 --- a/Master/texmf-dist/doc/latex/xwatermark/README +++ b/Master/texmf-dist/doc/latex/xwatermark/README @@ -2,7 +2,11 @@ This is the README file for the 'xwatermark' package. VERSION -Version 1.5.2b, 10 August 2012 +Version 1.5.2c, 10 October 2012 + +LOCATION ON CTAN + +macros/latex/contrib/xwatermark SUMMARY diff --git a/Master/texmf-dist/doc/latex/xwatermark/tab-globaloptions.tex b/Master/texmf-dist/doc/latex/xwatermark/tab-globaloptions.tex index 954064c41c7..775e2b31323 100644 --- a/Master/texmf-dist/doc/latex/xwatermark/tab-globaloptions.tex +++ b/Master/texmf-dist/doc/latex/xwatermark/tab-globaloptions.tex @@ -1,5 +1,5 @@ %++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% -% This is file xwatermark-guide (global options), version 1.5.2a % +% This is file xwatermark-guide (global options), version 1.5.2c % % % % Copyright (c) 2009-2012 Ahmed Musa (amusa22@gmail.com). % %++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% diff --git a/Master/texmf-dist/doc/latex/xwatermark/tab-localoptions.tex b/Master/texmf-dist/doc/latex/xwatermark/tab-localoptions.tex index 85bc44d146a..55ae1da30e9 100644 --- a/Master/texmf-dist/doc/latex/xwatermark/tab-localoptions.tex +++ b/Master/texmf-dist/doc/latex/xwatermark/tab-localoptions.tex @@ -1,5 +1,5 @@ %++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% -% This is file xwatermark-guide (local options), version 1.5.2a % +% This is file xwatermark-guide (local options), version 1.5.2c. % % % % Copyright (c) 2009-2012 Ahmed Musa (amusa22@gmail.com). % %++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% @@ -170,5 +170,4 @@ \normalfont\normalsize - \end{document} diff --git a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples.cfg b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples.cfg deleted file mode 100644 index 7644422fc9b..00000000000 --- a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples.cfg +++ /dev/null @@ -1,248 +0,0 @@ -%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% -% This is file xwatermark-examples.cfg, version 1.5.2a % -% % -% Copyright (c) 2009-2012 Ahmed2Musa (a.musa@rocketmail.com). % -%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% - -\ProvidesFile{xwatermark-examples.cfg} - [2012/02/01 v1.5.2a Configuration file for xwatermark-examples.tex (AM)] -\NeedsTeXFormat{LaTeX2e} -\makeatletter - -\@ifundefined{ver@ltxtools-base1.sty}{% - \csname @\ifx\documentclass\@twoclasseserror - first\else second\fi oftwo\endcsname - \usepackage\RequirePackage{ltxtools-base1}% -}{} -\AtBeginDocument{\hypersetup{pdfstartview=Fit,colorlinks}} - -\ltsloadpackages{% - xcolor|dvipsnames,table,hyperref; - geometry|left=3cm,right=3cm,top=2.5cm,bottom=2.5cm,includeheadfoot; - lipsum; - amsmath; - amssymb; - ltxtools-doc; - xwatermark|printwatermark; - hyperref|verbose=false,pdfpagemode=UseThumbs, - pdfview=FitB,pdfstartview=FitB; -} -\WrapQuotes -\new@def\hspce{\hspace{1cm}} -\nameabbrev\lppl{\LaTeX\ Project Public License}[LPPL] -\providerobust@def*\eg{% - \ifnextcharTF.{e.\,g\sspace}{e.\,g.\@\sspace}% -} -\providerobust@def*\ie{% - \ifnextcharTF.{i.\,e\sspace}{i.\,e.\@\sspace}% -} -\shelllet\ttcl=\textcolor -\providerobust@def*\xcopyright#1{% - \unskip\ttcl{#1}{\textsuperscript{\copyright}}% -} -\robust@def*\xxcopyright{% - \mbox{\textcopyright~\lower.7\p@\hbox{\uppercase - \expandafter{\romannumeral\year}}}\sspace -} -\robust@def*\colorbullet#1{\ttcl{#1}{\textbullet}\sspace} -\providerobust@def*\pkg{% - \ifnextcharTF'% - {\@firstoftwo{\def\xwm@pkgsw{00}\xwm@pkg}} - {\def\xwm@pkgsw{01}\xwm@pkg}% -} -\robust@def*\xwm@pkg#1{% - \def\do##1{\ttcl{ForestGreen}{\texttt{##1}}}% - \ltsprintcommalist{#1}\do - \if\xwm@pkgsw\@space package\ifnum\maxindrisnr>\@ne s\fi\fi -} -\providerobust@def*\email{\hyper@normalise\xwm@email} -\robust@def*\xwm@email#1{\href{mailto:#1}{#1}} -\AfterStartOfDocument{% - \def\thefootnote{\fnsymbol{footnote}}% -} - -\fancypagenos[ - showonpageone = false, - coordunit = pc, - showheadrule = false, - showfootrule = false, - x-position = 0, - y-position = -.5\textwidth, - scale = 2.5, - angle = 0, - hfoffset-left = .9, - hfoffset-right = .9, - style = Page \thepage~of~\lastdocpage, - header-left = \ttcl{blue}{\today}, - header-right = Ahmed Musa, - footer-center = \pkg'{xwatermark}, - header-center = \textsf{\ttcl{purple}{Demonstration document}} -] - -\renewcommand\textfraction{0.05} -\renewcommand\topfraction{0.95} -\renewcommand\bottomfraction{0.95} -\abovedisplayskip=6pt plus3pt minus1pt -\belowdisplayskip=6pt plus3pt minus1pt -\abovedisplayshortskip=0pt plus3pt minus0pt -\belowdisplayshortskip=4pt plus3pt minus0pt -\belowcaptionskip=6pt plus3pt minus1pt -\abovecaptionskip=6pt plus3pt minus1pt -\setcounter{totalnumber}{5} - -\csn@def{watermark-2}{% - % The macro \aaa below is an unlikely example definition, - % but it provides a test of xwatermark schemes: - \def\aaa##1{##1}% - \xwmcolorbox[fillcolor=gray!55,width=.982\paperheight, - textalign=center,framesep=5pt,framerule=2pt, - outerframecolor=blue,innerframecolor=white]{% - \color{white}\framebox[2cm][c]{\phantom{Hello}}% - \hspce\color{black}\ttcl{red}{\textbullet}% - \hspce The marks on these pages were - placed effortlessly by using the \pkg'{xwatermark} - \hspce\ttcl{red}{\textbullet}\hspce\color{white}% - \framebox[2cm][c]{\phantom{Hello}}% - \rotatebox[origin=c]{90}{\makebox[1.4cm][c]{\phantom{Hello}}}% - }\\[0cm]% - \rotatebox[origin=c]{-90}{\raisebox{-13.55cm}[0cm][0cm]{% - \hspace*{-.1mm}% - \xwmcolorbox[framesep=5pt,framerule=2pt,fillcolor=yellow!75, - outerframecolor=ForestGreen,innerframecolor=white, - textalign=center,width=.715\paperwidth]{% - \color{white}\framebox[2cm][c]{\phantom{Hello}}\hspce - \color{black}\ttcl{red}{\textbullet}% - \hspce Page~\thepage~of~\pageref*{xwmlastpage}\hspce - \ttcl{red}{\textbullet}\hspce - \color{white}\framebox[2cm][c]{\phantom{Hello}}% - \rotatebox[origin=c]{90}{\makebox[1.4cm][c]{\phantom{Hello}}}% - }}}\\[0cm]% - \rotatebox[origin=c]{-90}{\raisebox{12.35cm}[0cm][0cm] - {\makebox[0cm][r]{% - \xwmcolorbox[framesep=5pt,framerule=2pt,fillcolor=yellow!55, - outerframecolor=ForestGreen,innerframecolor=white, - textalign=justified,width=.715\paperwidth]{% - \normalfont\small\color{blue}\vspace*{-1ex}% - \begin{center}\colorbullet{red}\hspace{.25cm}% - \ttcl{Purple}{LICENSE}% - \hspace{.25cm}\colorbullet{red}\end{center}\relax - This work (\ie, all the files in the \pkg'{xwatermark} - manifest) may be distributed and/or modified under the - conditions of the \lppl, either version~1.3 of this - license or any later version. The \lppl maintenance - status of this software is \quoted{author-maintained}. - This software is provided \quoted{as it is}, without - warranty of any kind, either expressed or implied, - including, but not limited to, the implied - warranties of merchantability and fitness for a - particular purpose. - }}}}\\[0cm]% - \xwmcolorbox[framesep=5pt,framerule=2pt,fillcolor=gray!55, - outerframecolor=blue,innerframecolor=white, - textalign=center,width=.982\paperheight]{% - \color{white}\framebox[2cm][c]{\phantom{Hello}}% - \hspce\color{black}\ttcl{red}{\textbullet}% - \hspace{4.3cm}User manual for the \pkg'{xwatermark} - \hspace{4.3cm}\ttcl{red}{\textbullet}\hspce - \color{white}\framebox[2cm][c]{\phantom{Hello}}% - \rotatebox[origin=c]{90}{\makebox[1.4cm][c] - {\phantom{Hello}}}% - }% -} -\newcommand*\scaleb[1]{\scalebox{2.5}{#1}} -\newcommand*\tmptexbox{% - \fboxrule4pt\fbox{\scaleb\TeX}\\[0ex]\fbox{\scaleb\LaTeX}% -} -\csn@def{watermark-3}{% - \xwmcolorbox[width=.8\paperwidth,framerule=4pt,framebox, - framesep=4pt,innerframecolor=Green,outerframecolor=blue]{% - \xwmminipage[width=.7\paperwidth,textalign=left, - framerule=4pt,framecolor=magenta,textcolor=red,framebox] - {\tmptexbox}\\[0ex]% - \xwmminipage[width=.7\paperwidth,textalign=center, - textcolor=blue,framerule=4pt,framecolor=black,framebox] - {\tmptexbox}\\[0ex]% - \xwmminipage[width=.7\paperwidth,textalign=right, - framecolor=ProcessBlue,textcolor=orange,framerule=4pt, - framebox]{\tmptexbox}% - }% -} - -\csn@def{watermark-4}{% - \xwmcolorbox[fillcolor=teal,width=.983\paperheight, - textalign=center,framesep=5pt,framerule=2pt, - outerframecolor=purple,innerframecolor=magenta]{% - \color{white}\framebox[2cm][t]{\phantom{Hello}}% - \hspce\color{orange!85!red!55}% - \ttcl{red}{$\blacktriangleright$}\hspce The~ - \texttt{\ttcl{white}{xwatermark}}~ - package\hspce\ttcl{red}{$\blacktriangleleft$}% - \hspce\color{white}\framebox[2cm][t]{\phantom{Hello}}% - \rotatebox[origin=c]{90}{\makebox[1.4cm][c]{\phantom{Hello}}}% - }\\[0cm]% - \rotatebox[origin=c]{-90}{\raisebox{-13.7cm}[0cm][0cm]{% - \hspace*{-.1mm}% - \xwmcolorbox[framesep=5pt,framerule=2pt, - fillcolor=green!75!blue!50,outerframecolor=brown, - innerframecolor=white,textalign=center,width=.713\paperwidth, - textcolor=white]{a.musa@rocketmail.com}}% - }\\[0cm]% - \rotatebox[origin=c]{-90}{\raisebox{13.5cm}[0cm][0cm]{% - \makebox[0cm][r]{% - \xwmcolorbox[framesep=5pt,framerule=2pt, - fillcolor=green!75!blue!50,outerframecolor=brown, - innerframecolor=white,textalign=center,width=.713\paperwidth, - textcolor=white]{\xxcopyright Ahmed Musa}% - }}}\\[0cm]% - \xwmcolorbox[framesep=5pt,framerule=2pt,fillcolor=teal, - outerframecolor=purple,innerframecolor=magenta,textalign=center, - width=.983\paperheight]{\color{white}\framebox[2cm][t] - {\phantom{Hello}}\hspce\color{orange!85!red!55}% - \ttcl{red}{$\blacktriangleright$}\hspace{2.1cm}% - Page~\thepage~of~\pageref*{xwmlastpage}% - \hspace{2cm}\ttcl{red}{$\blacktriangleleft$}\hspce - \color{white}\framebox[2.1cm][t]{\phantom{Hello}}% - \rotatebox[origin=c]{90}{\makebox[1.4cm][c]{\phantom{Hello}}}% - }% -} -\csn@def{watermark-5}{% - \xwmcolorbox[framesep=5pt,framerule=4pt,innerframecolor=green, - outerframecolor=red,textalign=center,width=.7\paperheight, - textcolor=blue]{\scalebox{5}{Hello world,}}\\[.25ex]% - \xwmcolorbox[framesep=5pt,framerule=4pt,innerframecolor=white, - outerframecolor=blue,fillcolor=brown!55,textalign=center, - width=.7\paperheight,textcolor=red]{\scalebox{5}{We're here!}}% -} -\csn@def{watermark-6}{% - \xwmminipage[width=\hsize,framerule=2pt,framebox,framecolor=green, - height=2cm,depth=2cm]{% - \xwmminipage[width=\hsize,textalign=center,textcolor=magenta, - framebox]{\fbox{\TeX}\\[0ex]\fbox{\LaTeX}}% - }% -} - -\csn@def{watermark-7}{% - \begin{center}% - \color{Yellow}% - \fboxrule4\p@ - \centering\fbox{% - \begin{minipage}[c]{\textwidth}% - \xwmstrut{2cm}\z@ - \color{ProcessBlue}\centering - \fboxrule3\p@\vss - \fbox{% - \begin{minipage}[c]{.5\hsize}% - \xwmstrut{1.3cm}\z@ - \fboxrule4\p@\vss - \centering\color{LimeGreen}% - \fbox{\ttcl{red}{\scalebox{2}{xwatermark}}}% - \xwmstrut\z@{1cm}% - \end{minipage}% - }% - \xwmstrut\z@{2cm}% - \end{minipage}% - } - \end{center}% -} - -\endinput diff --git a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples1.pdf b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples1.pdf Binary files differdeleted file mode 100644 index db2b512d5a0..00000000000 --- a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples1.pdf +++ /dev/null diff --git a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples1.tex b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples1.tex deleted file mode 100644 index b52b94bb361..00000000000 --- a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples1.tex +++ /dev/null @@ -1,86 +0,0 @@ -%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% -% This is file 'xwatermark-examples1.tex', version 1.5.2a. % -% % % This work (ie, all the files in the xwatermark manifest) may be % -% distributed and/or modified under the conditions of the LaTeX % -% Project Public License, either version 1.3 of this license or any % -% later version. The latest version of this license is at % -% http://www.latex-project.org/lppl.txt and version 1.3 or later % -% is part of all distributions of LaTeX version 2005/12/01 or later. % -% % -% The LPPL maintenance status of this software is 'author-maintained'. % -% % -% This software is provided 'as it is', without warranty of any kind, % -% either expressed or implied, including, but not limited to, the % -% implied warranties of merchantability and fitness for a particular % -% purpose. % -% % -% Copyright (c) 2009-2012 Ahmed Musa (amusa22@gmail.com). % -%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% - -\documentclass[a4paper,10pt,final,showpagenos]{article} -\makeatletter -\InputIfFileExists{xwatermark-examples.cfg}{}{% - \errmessage{No file xwatermark-examples.cfg or wrong path}} - -\xnewwatermark -[pages={\lastdocpage-1}-\lastdocpage,fontfamily=phv,fontsize=11pt, - fontseries=m,align=center,height=\paperheight,width=\paperheight, - angle=90,scale=1,xpos=1.15,ypos=0]{\usecsn{watermark-4}} - -\xnewwatermark* -[pagex={3,5,7},fontfamily=phv,fontsize=11pt, - fontseries=m,align=center,height=\paperheight,width=\paperheight, - angle=0,scale=1,xpos=0,ypos=40]{\usecsn{watermark-7}} - -\xnewwatermark -[page=1,fontfamily=phv,fontsize=11pt, - fontseries=m,align=center,height=\paperwidth,width=\paperheight, - angle=90,scale=1,xpos=1.15,ypos=0]{\usecsn{watermark-2}} - -\xnewwatermark -[page=3,fontfamily=phv,fontsize=11pt,fontseries=m,align=center, - height=\paperheight,width=.7\paperheight,angle=45,scale=1,xpos=0, - ypos=0]{\usecsn{watermark-5}} - -\xnewwatermark -[evenpages,fontfamily=phv,fontsize=11pt,fontseries=m,align=center, - height=\paperheight,width=\paperheight,angle=45,scale=1,xpos=1, - ypos=0]{\usecsn{watermark-3}} - - -\begin{document} - -\title{% - {\setbox\z@\vbox to.25\paperheight{}\box0}% - \bfseries The \texttt{\ttcl{blue}{xwatermark}} Package - \xcopyright{red}\\[1ex] - \large Version 1.5.2a\\[2ex] - \Large EXAMPLES (File 1)% -} -\author{% - \textbf{Ahmed Musa}\\Preston, United Kingdom\\ - \email{amusa22@gmail.com} -} -\maketitle - -\thispagestyle{empty} - -\newpage -\noindent -\ltslipsum[1-3] - -\newpage -\ltslipsum[1-4] - -\newpage -\ltslipsum[1-4] - -\newpage -\ltslipsum[1-4] - -\newpage -\ltslipsum[1-4] - -\newpage -\ltslipsum[1-4] -\end{document} diff --git a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples2.pdf b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples2.pdf Binary files differdeleted file mode 100644 index 1f96a24e6da..00000000000 --- a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples2.pdf +++ /dev/null diff --git a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples2.tex b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples2.tex deleted file mode 100644 index 5e8c9e52ee2..00000000000 --- a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples2.tex +++ /dev/null @@ -1,199 +0,0 @@ -%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% -% This is file 'xwatermark-examples2.tex', version 1.5.2a. % -% % -% This work (ie, all the files in the xwatermark manifest) may be % -% distributed and/or modified under the conditions of the LaTeX % -% Project Public License, either version 1.3 of this license or any % -% later version. The latest version of this license is at % -% http://www.latex-project.org/lppl.txt and version 1.3 or later % -% is part of all distributions of LaTeX version 2005/12/01 or later. % -% % -% The LPPL maintenance status of this software is 'author-maintained'. % -% % -% This software is provided 'as it is', without warranty of any kind, % -% either expressed or implied, including, but not limited to, the % -% implied warranties of merchantability and fitness for a particular % -% purpose. % -% % -% Copyright (c) 2009-2012 Ahmed Musa (amusa22@gmail.com). % -%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% - -\documentclass[final,showpagenos]{article} -\makeatletter - -\InputIfFileExists{xwatermark-examples.cfg}{}{% - \errmessage{No file xwatermark-examples.cfg or wrong path}} - -\thispagestyle{empty} -\watermarkpaths[.](/){{}{/Graphics}} - -\newwatermark*[% - page=2,fontfamily=put,textcolor=BurntOrange,fontsize=1cm, - textscale=1,textalign=center,textangle=45,picangle=90, - picontoptext=false,boxalign=center,picxpos=50, - picypos=.25\paperheight,textxpos=-70,textypos=-50, - picbb=116 428 477 718,picscale=1,picfile=tabu-test1, - picfileext=eps -]{\ttcl{Green}{\texttt{xwatermark\\package}}} - -\newwallpaper[% - page=2,fontfamily=put,textcolor=BurntOrange,fontsize=1cm, - textscale=2,textalign=center,textangle=45,picangle=45, - tilexoffset=0pt,squaretiles,tileyoffset=0pt,picontoptext=true, - boxalign=center,picbb=54 54 483 242,picscale=2,picfile=fant, - tileno=4,picfileext=epsx,graphicsoptions={keepaspectratio,hiresbb} -]{\texttt{fant}} - - -% * (star) means 'put on foreground'; -% ' (prime) means 'ignore this mark': -\newwallpaper*[% - page=3,fontfamily=put,textcolor=BurntOrange,fontsize=1cm,textscale=2, - textalign=center,textangle=45,picangle=45,tilexoffset=0pt,%squaretiles, - tileyoffset=0pt,picontoptext=false,boxalign=center, - picbb=116 428 477 718,picscale=2,picfile=tabu-test1,tileno=4, - % The package will look for the right file extension in each mode, - % ignoring the following 'epsx': - picfileext=epsx -]{\texttt{test}} - -\newwallpaper[% - page=5,fontfamily=put,textcolor=BurntOrange,fontsize=1cm,textscale=2, - textalign=center,textangle=0,picangle=0,tilexoffset=0pt,squaretiles, - tileyoffset=0pt,picontoptext=false,boxalign=center,showpagecenter, - picbb=116 428 477 718,picscale=2,picfile=tabu-test1,tileno=4, - picfileext=eps -]{\texttt{test}} - -\newwallpaper*[% - page=4,fontfamily=put,textcolor=violet!70,fontsize=1cm,textscale=1, - textalign=center,textangle=45,picangle=0,tilexoffset=0pt,squaretiles, - tileyoffset=0pt,picontoptext=false,boxalign=center,%top-left, - picbb=20 21 590 400,picscale=1,picfile=comet1,%tileno=8, - picfileext=epsx -]{Comet} - -\dummywallpaper[% - page=5,fontfamily=put,textcolor=BurntOrange,fontsize=1cm,textscale=2, - textalign=center,textangle=45,picangle=45,squaretiles,tilexoffset=0pt, - tileyoffset=0pt,picontoptext=false,%boxalign=l-t, - picbb=115 623 238 747,picscale=2,picfile=xwatermarkpic1, - picfileext=eps -]{YES} - -\newwatermark[% - pages=4,fontfamily=put,textcolor=blue,fontsize=1.2cm,textscale=1, - width=.8\paperheight,textalign=center,textangle=90,textxpos=0,textypos=0 -]{% - \xwmcolorbox[framesep=4pt,framerule=4pt,fillcolor=brown!70!yellow!55, - innerframecolor=white,outerframecolor=blue,height=1.5cm, - depth=1cm,textalign=center,width=.8\paperheight]% - {\tt\string\advance\ttcl{red}{\string\knowledge}% - \string\by\ttcl{red}{\string\inquiry}}% -} - -\newwatermark[% - page=6,fontfamily=put,textcolor=BurntOrange!70,fontsize=1cm,textscale=2, - picbb=78 563 304 788,picscale=2,picfile=xwatermarkpic3, - picfileext=epsx,width=\paperwidth,textalign=center,textangle=0, - textxpos=0,textypos=0,picontoptext=false -]{\ttcl{black}{Yes}} - -\newwatermark*[% - page=6,fontfamily=put,textcolor=violet!70,fontsize=2cm,textscale=1, - width=\paperwidth,textalign=center,textangle=0,textxpos=0,textypos=0 -]{\fbox{Brought to front}} - -\newwatermark[% - page=7,fontfamily=put,textcolor=MidnightBlue!80,fontsize=2cm,textscale=1, - width=\paperwidth,textalign=center,textangle=-50,textxpos=-30,textypos=80 -]{\fbox{Taken to back}} - -\csndef*{watermark-2a}#1#2{% - \newwatermark[% - pages=6-7,fontfamily=pbk,textcolor=gray!35,fontsize=12pt,fontseries=n, - textalign=center,textangle=#2,textscale=1,textxpos=#1,textypos=0, - width=\paperheight - ]{% - \xwmcolorbox[framesep=5pt,framerule=2pt,fillcolor=teal, - innerframecolor=magenta,outerframecolor=green, - textalign=center,width=.98\paperheight]% - {% - \color{white}\framebox[2cm][t]{\phantom{Hello}}\hspace{1cm}% - \color{orange!85!red!55}\ttcl{red}{$\blacktriangleright$}% - \hspace{2.1cm}Page \thepage~of~\pageref{xwmlastpage}% - \hspace{2.1cm}\ttcl{red}{$\blacktriangleleft$}\hspace{1cm}% - \color{white}\framebox[2cm][t]{\phantom{Hello}}% - \xwmstrut{9mm}{6mm}% - }% - }% -} - -\begin{ltscomment} -The same watermark is placed twice on the same page. -Compare this with one of the examples in xwatermark-examples1.tex: -\end{ltscomment} - -\usecsn{watermark-2a}{-.428\paperwidth}{90} -\usecsn{watermark-2a}{.428\paperwidth}{-90} - -\begin{ltscomment} -Here is an inefficient example. \scalebox and \rotatebox -could have been more efficiently achieved in the following -example: -\end{ltscomment} -\newwatermark[page=\lastdocpage,width=\paperheight]{% - \setbox\xwm@boxb=\hb@xt@.9\paperheight{% - \hfuzz\maxdimen\hss - \xwmcolorbox[framesep=4pt,framerule=4pt,fillcolor=brown!70, - innerframecolor=white,outerframecolor=MidnightBlue,height=1cm, - depth=.8cm,textalign=center,width=.8\paperheight]% - {\scalebox{1.2}{\bf\tt\ttcl{white}{\char`\\advance}% - \ttcl{red}{\string\knowledge}% - \string\by\ttcl{blue}{\char`\\inquiry}}}\hss}% - \begin{center}\rotatebox{45}{\box\xwm@boxb}\end{center}% -} - -\begin{document} - -\title{% - {\setbox\z@\vbox to.25\paperheight{}\box0}% - \bfseries The \texttt{\ttcl{blue}{xwatermark}} Package - \xcopyright{red}\\[1ex] - \large Version 1.5.2a\\[2ex] - \Large EXAMPLES (File 2)% -} -\author{% - \textbf{Ahmed Musa}\\Preston, United Kingdom\\ - \email{amusa22@gmail.com} -} -\maketitle -\thispagestyle{empty} - -\newpage - -\ltslipsum[1-4] - -\ltslipsum - -\newpage - -\ltslipsum[1-4] - -\newpage - -\ltslipsum[1-4] - -\newpage - -\ltslipsum[1-4] - -\newpage - -\ltslipsum[1-4] - -\newpage - -\ltslipsum[1-4] - -\end{document} diff --git a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide.cfg b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide.cfg index 30840505db3..8fc850de85e 100644 --- a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide.cfg +++ b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide.cfg @@ -1,15 +1,18 @@ %++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% -% This is file xwatermark-guide.cfg, version 1.5.2a % +% This is file xwatermark-guide.cfg, version 1.5.2c % % % % Copyright (c) 2009-2012 Ahmed Musa (amusa22@gmail.com). % %++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% +% \usepackage[logonly]{trace} + \ProvidesFile{xwatermark-guide.cfg} - [2012/02/01 v1.5.2a Configuration file for xwatermark-guide.tex (AM)] + [2012/10/14 v1.5.2c Configuration file for xwatermark-guide.tex (AM)] \NeedsTeXFormat{LaTeX2e} \makeatletter \ltsloadpackages{% - xwatermark|printwatermark; + % change file name ++++++++++++++++++++++++ + n-xwatermark|printwatermark; array; colortbl; % ltablex; @@ -25,9 +28,11 @@ } \newcolumntype{I}{!{\color{red}\vrule width 1pt}} \newcolumntype{W}{>{\hspace{0pt}\arraybackslash}m{\colthree}} +% Adjust this if you change table width: \newcolumntype{M}{>{\rightskip-.4cm}m{\dimexpr\coltotal+.5cm}} +%\newcolumntype{L}{m{\coltotal}} -\amltxoptions{% +\amltxdocoptions{% geometryoptions = {left=3cm,right=3cm,top=2.5cm,% bottom=2.5cm,includeheadfoot}, reviewdocument = false, @@ -61,7 +66,8 @@ \ifamd@subsidfile\else\ltsafterfi -\usepackage[persistent,useincluput]{ltxtools-incluput} +% Change package name: +++++++++++++++ +\usepackage[persistent,useincluput]{n-ltxtools-incluput} \fancypagenos[% showonpageone = false, @@ -98,7 +104,8 @@ } \def\colorseriescycle{20} -\definecolorseries{C}{cmyk}{last}{white}[cmyk]{1,0,0,0} +%\definecolorseries{C}{cmyk}{last}{white}[cmyk]{1,0,0,0} +\definecolorseries{C}{rgb}{step}{cyan!50}[cmyk]{1,0,0,0} \resetcolorseries[10]{C} \definecolorseries{M}{cmyk}{last}{white}[cmyk]{0,1,0,0} \resetcolorseries[10]{M} @@ -136,7 +143,7 @@ \fboxsep=2mm\relax \@tempcnta\z@pt \ltstfor xwatermark\dofor{% - \csn@def{d@\number\@tempcnta}{% + \csn@def{xwmd@\number\@tempcnta}{% \vbox{\hbox to\dimexpr\paperwidth/13\relax {\hfil\detokenize{#1}\hfil \vrule height1.8ex depth.6ex width0pt}% @@ -144,7 +151,7 @@ }% \advance\@tempcnta\@ne }% - \def\elt{\usename{d@\ncolr}}% + \def\elt{\usename{xwmd@\ncolr}}% \multido{\ncolr=0+1}{10}{\colorbox{C!![\ncolr]}{\elt}}\\ \multido{\ncolr=0+1}{10}{\colorbox{M!![\ncolr]}{\elt}}\\ \multido{\ncolr=0+1}{10}{\colorbox{Y!![\ncolr]}{\elt}}\\ diff --git a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide.tex b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide.tex index 91dd18cf13b..39cc4bc8b2a 100644 --- a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide.tex +++ b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide.tex @@ -25,7 +25,7 @@ \title{The \texttt{\color{blue}xwatermark} Package\titleref{t1}} \subtitle{\textsf{A dynamic watermarking scheme for \latex}} \titlenote[t1]{The package is available at \url{\titleurltext}.} -\version{1.5.2a} +\version{1.5.2c} \titleurl{http://mirror.ctan.org/macros/latex/contrib/xwatermark/} \author{Ahmed Musa\Email{amusa22@gmail.com}\\ {\small The University of Central Lancashire, Preston, UK}} @@ -69,6 +69,12 @@ } +\docsection(sec:newfeatures){New features} + +Enter \ffx'{\xwmwatermarkon,\xwmwatermarkoff} for suspending and resuming watermark placement on pages. + + + \docsection(sec:intro){Introduction} \lletter{T}{he \pkg'{xwatermark}} puts user-specified watermarks (graphics and/or arbitrary texts) on select pages of documents. It has more functionality and dynamism than, for example, the packages \pkg'{draftcopy, draftwatermark, watermark, draftmark,wallpaper}. The advantages of \pkg'{xwatermark} over these earlier packages include: @@ -657,6 +663,12 @@ Local package options are those associated with the commands \ffx'{\newwatermark The following change history highlights significant changes that affect user utilities and interfaces; changes of technical nature are not documented in this section. The \stsign on the right-hand side of the following lists means the subject features in the package but is not reflected anywhere in this user guide. \begin{versionhist} + \begin{version}{1.5.2c}{2012/10/14} + \item The commands \ffx'{\xwmwatermarkon,\xwmwatermarkoff} introduced \vsecref* + \end{version} + \begin{version}{1.5.2b}{2012/08/01} + \item Persistent interaction mode inherited from \pkg'{catoptions} removed \vsecref* + \end{version} \begin{version}{1.5.2a}{2012/02/01} \item New command \fx{\xwm@stripallouterbraces} introduced \vsecref* \end{version} diff --git a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-test-20120201.tex b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-test-20120201.tex deleted file mode 100644 index 8a41dab0679..00000000000 --- a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-test-20120201.tex +++ /dev/null @@ -1,52 +0,0 @@ -\documentclass[showpagenos]{article} -\makeatletter -\usepackage[dvipsnames]{xcolor} -\usepackage{amsmath,amssymb} -\usepackage[printwatermark]{xwatermark} - -\thispagestyle{empty} -\watermarkpaths*[.](/){{,/Graphics}} -% The user should replace 'comet1' and 'fant' with his/her image filenames. -\newwallpaper[ - page=1,fontfamily=put,textcolor=BurntOrange,fontsize=1cm,textscale=2, - textalign=center,textangle=45,picangle=0,tilexoffset=0pt,%squaretiles - tileyoffset=0pt,picontoptext=false,boxalign=top-left, - picbb=20 21 590 400,picscale=2,picfile=comet1,tileno=8, - picfileext=eps -]{YES} - -\newwallpaper[ - page=2,fontfamily=put,textcolor=BurntOrange,fontsize=1cm,textscale=2, - textalign=center,textangle=45,picangle=45,tilexoffset=0pt,%squaretiles - tileyoffset=0pt,picontoptext=true,boxalign=top-left, - picbb=54 54 483 242,picscale=2,picfile=fant,tileno=4, - picfileext=eps, graphicsoptions={keepaspectratio,hiresbb} -]{\texttt{fant}} - -\newwatermark[ - pages=3-4,fontfamily=pbk,textcolor=gray!35,fontsize=12pt,fontseries=n, - textalign=center,textangle=90,textscale=1,textxpos=-.44\paperwidth,textypos=0, - width=\paperheight -]{% - \xwmcolorbox[framesep=5pt,framerule=2pt,fillcolor=teal, - innerframecolor=magenta,outerframecolor=green, - textalign=center,width=.995\paperheight]% - {% - \color{white}\framebox[2cm][t]{\phantom{Hello}}\hspace{1cm}% - \color{orange!85!red!55}\textcolor{red}{$\blacktriangleright$}% - \hspace{2.1cm}Page \thepage~of~\pageref{xwmlastpage}% - \hspace{2.1cm}\textcolor{red}{$\blacktriangleleft$}\hspace{1cm}% - \color{white}\framebox[2cm][t]{\phantom{Hello}}% - \xwmstrut{9mm}{6mm}% - }% -} - -\begin{document} -xx -\newpage -yy -\newpage -zz -\newpage -ww -\end{document} diff --git a/Master/texmf-dist/tex/latex/xwatermark/xwatermark.sty b/Master/texmf-dist/tex/latex/xwatermark/xwatermark.sty index c9b5394e3b8..51b61741c18 100644 --- a/Master/texmf-dist/tex/latex/xwatermark/xwatermark.sty +++ b/Master/texmf-dist/tex/latex/xwatermark/xwatermark.sty @@ -1,5 +1,5 @@ %++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% -% This is file 'xwatermark.sty', version 1.5.2b, August 2012. % +% This is file 'xwatermark.sty', version 1.5.2c, October 2012. % % % % This package puts user-specified watermarks (graphics and arbitrary % % texts) on select pages of documents. See package documentation % @@ -23,17 +23,17 @@ %++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% \@ifpackageloaded{catoptions}{% - \@ifpackagelater{catoptions}{2012/08/01}{}{% + \@ifpackagelater{catoptions}{2012/10/14}{}{% \@latex@error{Loaded version of 'catoptions' package is - not current}\@ehc + not current}\@ehd }% }{% - \RequirePackage{catoptions}[2012/08/01]% + \RequirePackage{catoptions}[2012/10/14]% } \UseNormalCatcodes \StyleFilePurpose{A dynamic watermarking scheme} \StyleFileRCSInfo -$Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ +$Id: xwatermark.sty,v 1.5.2c 2012/10/14 09:00:00 Ahmed Musa Exp $ \ProvidesPackage{xwatermark}[\StyleFileInfo] \NeedsTeXFormat{LaTeX2e}[2011/06/27] \SetStyleFileMessages[xwm@]{info}{warn}{err} @@ -55,13 +55,44 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ \newletcs\xwm@nil\relax \new@def*\xwm@nnil{\xwm@nil} \AtBeginShipoutInit -\newvariables{box}[xwm@box]{a,b}\relax -\newvariables{count}[xwm@]{cnta}[\z@pt] -\newvariables{if}[xwm@]{pdf,swa,swb,foregrd,wall}[false] -\newvariables{write}[xwm@]{wrt}\relax +\cptnewvariables{box}[xwm@box]{a,b}\relax +\cptnewvariables{count}[xwm@]{cnta}[\z@pt] +\cptnewvariables{if}[xwm@]{pdf,swa,swb,foregrd,wall,putmark}[false] +\xwm@putmarktrue +\cptnewvariables{write}[xwm@]{wrt}\relax \robust@def*\AtShipoutAlwaysUpperLeft#1{% \AtBeginShipout{\AtBeginShipoutUpperLeft{#1}}% } +\robust@def*\xwm@secstartpage#1{% + \begingroup + \def\do##1##2,{% + \ifx\do##1\else + \csn@gdef{xwm@secstartpage@@\romannumeral##1}{##2}% + \expandafter\do + \fi + }% + \do#1,\do\do,% + \endgroup +} +\new@def*\xwm@seclist{} +\AtEndDocument{% + \immediate\write\@auxout{% + \string\xwm@secstartpage{\xwm@seclist}% + }% +} +\robust@def*\xwm@recordsecno{% + \xdef\xwm@seclist{% + \xwm@seclist\ifx\xwm@seclist\@empty\else,\fi + {\thesection}{\thepage}% + }% +} +\edef\reserved@a{% + \def\noexpand\@seccntformat##1{% + \unexpanded\expandafter{\@seccntformat{#1}}% + \unexpanded{\protect\xwm@recordsecno}% + }% +} +\reserved@a \new@def*\xwm@boxframestack{} \robust@def*\xwm@pushboxframe{% \xdef\xwm@boxframestack{% @@ -107,7 +138,7 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ } \robust@def*\xwm@ifxcolorloaded{% \ifcsndefTF{ver@xcolor.sty}\@iden{% - \xwm@err{'xcolor' package not loaded}\@ehc + \xwm@err{'xcolor' package not loaded}\@ehd }% } \robust@def*\xwmdefinecolor{% @@ -126,7 +157,7 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ \@ifundefinedcolor{#2}{% \reserved@e[#1]{#2}% }{% - \xwm@err{Color name '#2' already defined}\@ehc + \xwm@err{Color name '#2' already defined}\@ehd }% } \robust@def*\xwmdefinecolorset{\cpt@testopt\xwm@definecolorset{x}} @@ -140,7 +171,7 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ \def\xwm@tempa##1,##2,##3,##4,##5\@nil{% \ifblankTF{##4}{% \xwm@err{Incomplete color format in - \string\xwmdefinecolorset}\@ehc + \string\xwmdefinecolorset}\@ehd }{% \def\xwm@tempf{##1}% }% @@ -165,10 +196,10 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ \expandafter\do\normalized@list;\@nil;% \ifcsemptyTF\xwm@tempe{}{% \xwm@err{Color names '\expandcsonce\xwm@tempe' multiply - \MsgBrk submitted to \string\xwmdefinecolorset}\@ehc + \MsgBrk submitted to \string\xwmdefinecolorset}\@ehd }% \ifcsemptyTF\xwm@tempc{}{% - \xwm@err{Color names '\expandcsonce\xwm@tempc' already in use}\@ehc + \xwm@err{Color names '\expandcsonce\xwm@tempc' already in use}\@ehd }% \ifcsemptyTF\xwm@tempb{}{% \cptexpandarg{\xglobal\definecolorset{rgb}{#1}{#2}} @@ -179,15 +210,21 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ } \DefSuffixChecker\xwm@suffixcheck{*}{+}{'} \robust@def*\xwmifitemsinTF{% - \cpt@swatrue\cpt@testopt\xwm@itemsin\@ne + \xwm@swatrue\cpt@testopt\xwm@itemsin\@ne } \robust@def*\xwmifitemsinFT{% - \cpt@swafalse\cpt@testopt\xwm@itemsin\@ne + \xwm@swafalse\cpt@testopt\xwm@itemsin\@ne +} +\robust@def*\xxwmifitemsinTF{% + \xwm@swatrue\cpt@testopt\xwm@xitemsin{1}% +} +\robust@def\xwm@xitemsin[#1]#2#3{% + \cptexpandtwoargs{\xwm@itemsin[#1]}{#2}{#3}% } \robust@def\xwm@itemsin[#1]#2#3{% \ifnum\numexpr#1<\@ne \xwm@err{Invalid number '\the#1'\relax\MsgBrk - for command \string\xwmifitemsinTF}\@ehc + for command \string\xwmifitemsinTF}\@ehd \fi \lowercase{% \edef\xwm@tempa{\unexpanded{#2}}% @@ -198,28 +235,23 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ \def\xwm@items{}% \def\csv@do##1{% \xifinsetFT{,\detokenize{##1}}{,\cptoxdetok\xwm@tempb}{}{% - \cptaddtolist[,]\xwm@items{##1}% - \pushnumber\xwm@nritems - \ifnum\xwm@nritems>\numexpr#1-1\relax - \loopbreak - \fi + \edef\xwm@items{% + \expandcsonce\xwm@items\ifx\xwm@items\@empty\else,\fi + \unexpanded{##1}% + }% + \edef\xwm@nritems{\the\numexpr\xwm@nritems+1}% + \ifnum\xwm@nritems>\numexpr#1-1\relax\loopbreak\fi }% }% \csv@@parse*[,]\xwm@tempa \csname @\ifnum\xwm@nritems>\numexpr#1-1\relax - \ifcpt@swa first\else second\fi + \ifxwm@swa first\else second\fi \else - \ifcpt@swa second\else first\fi + \ifxwm@swa second\else first\fi \fi oftwo\endcsname } -\robust@def*\x@xwmifitemsinTF{% - \cpt@swatrue\cpt@testopt\xwm@xitemsin{1}% -} -\robust@def\xwm@xitemsin[#1]#2#3{% - \cptexpandtwoargs{\xwm@itemsin[#1]}{#2}{#3}% -} \robust@def*\xwm@hyphenpagerange#1#2#3{% \xifinsetTF{\detokenize{\xwmgetpagenumber}}{\cptoxdetok{#1}}{% \xwm@swbtrue @@ -240,7 +272,7 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ }{% \ifblankTF{#1}{% \xwm@err{Empty page range for watermark: - ^^J'\expandcsonce\currwatermark'.^^J}\@ehc + ^^J||\expandcsonce\xwm@currwatermark||.^^J}\@ehd }{% \protected@edef#3{#1}% }% @@ -250,11 +282,11 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ \def#3{#1}\def#4{#2}% \ifinsetTF{-}{#2}{% \xwm@err{Too many hyphens in page range '#1-#2' - \MsgBrk of watermark:^^J'\expandcsonce\currwatermark'}\@ehc + \MsgBrk of watermark:^^J||\expandcsonce\xwm@currwatermark||}\@ehd }{% \ifblankTF{#1}{% \xwm@warn{No start-page in page-range of watermark: - ^^J'\expandcsonce\currwatermark'.^^JI have used the + ^^J||\expandcsonce\xwm@currwatermark||.^^JI have used the default start-page '\xwm@defaultfirstpage' instead}% \def#3{\xwm@defaultfirstpage}% @@ -264,7 +296,7 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ }% \ifblankTF{#2}{% \xwm@warn{No end-page for page-range - of watermark:^^J'\expandcsonce\currwatermark' + of watermark:^^J||\expandcsonce\xwm@currwatermark|| ^^JI have used the default end-page '\xwm@defaultlastpage' instead}% \def#4{\xwm@defaultlastpage}% @@ -277,7 +309,7 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ \ifnum\numexpr#1<\numexpr#2\relax\else \ifxwm@swb\else \xwm@err{Watermark start-page '#1' is greater - than end-page '#2'}\@ehc + than end-page '#2'}\@ehd \fi \fi \fi @@ -331,7 +363,7 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ \cptexpandsecond{\def\reserved@a##1}{#1}##2##3\xwm@nil{% \def\reserved@a{##2}% \ifxTF\reserved@a\xwm@nnil{% - \cpt@err{Invalid value '#1' for textalign}\@ehc + \cpt@err{Invalid value '#1' for textalign}\@ehd \def#1{xwm@relax}% }{% \def#1{##2}% @@ -379,12 +411,12 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ \expandafter\xwm@resa\reserved@a-\xwm@nil-% \s@expandarg\ifnullTF{\the\toks@}{}{% \xwm@err{'boxalign' has invalid or inconsistent - \MsgBrk values '#1'}\@ehc + \MsgBrk values '#1'}\@ehd }% \ifcsnullTF\xwm@tempa{}{% \ifcsnullTF\xwm@tempb{}{% \xwm@err{Invalid values '#1' for 'boxalign': - \MsgBrk possibly a mixture of styles}\@ehc + \MsgBrk possibly a mixture of styles}\@ehd }% }% \def\xwm@tempc{}% @@ -417,7 +449,7 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ \xifblankTF{#1}{% \def\xwm@tempc{s}% }{% - \xwm@err{Invalid entries '#1' for 'boxalign'}\@ehc + \xwm@err{Invalid entries '#1' for 'boxalign'}\@ehd }% }{% \begingroup @@ -425,7 +457,7 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ \def\siso@do##1{\advance\cpt@cnta\@ne}% \s@expandarg\siso@@loop\xwm@tempc \ifnum\cpt@cnta>2\relax - \xwm@err{More than two entries '#1' for 'boxalign'}\@ehc + \xwm@err{More than two entries '#1' for 'boxalign'}\@ehd \fi \endgroup }% @@ -433,7 +465,7 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ \postgroupdef#1\endgroup } \robust@def*\xwm@notenddocerr{% - \xwm@err{Wrong location of end-of-document command}\@ehc + \xwm@err{Wrong location of end-of-document command}\@ehd } \robust@def*\AfterEndOfDocument{\grightaddtocs\xwm@afterenddoc} \new@def*\xwm@afterenddoc{} @@ -572,7 +604,7 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ \cptgxaddtolist*\xwm@picfilesread{\usename{#2picfile}}% }% \aftercsname\xwm@stripallouterbracesincs{#2picfileext}% - \ifboolTF{xwm@pdf}{% + \ifdefboolTF{xwm@pdf}{% \xifinsetTF{,\usename{#2picfileext},}{,pdf,png,jpeg,jpg,mps,}{}{% \csn@def{#2picfileext}{pdf}% \ifxwm@swb\xwm@tempb{pdf}{pdf}\fi @@ -605,7 +637,7 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ printwatermark=true; print-watermark=true/\setaliaskey{printwatermark}; allownesting=true; - showpagecenter=true/\ifboolTF{xwm@showpagecenter} + showpagecenter=true/\ifdefboolTF{xwm@showpagecenter} {\wmk@showpagecentertrue\wlp@showpagecentertrue}{}; show-page-center=true/\setaliaskey{showpagecenter}; showpapercenter=true/\setaliaskey{showpagecenter}; @@ -652,13 +684,13 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ \ifbracedTF{##1}{% \aftercsname{\xwm@stripallouterbraces{##1}}{#1graphicsoptions} }{% - \cpt@err{Values of key 'graphicsoptions' not braced}\@ehc + \cpt@err{Values of key 'graphicsoptions' not braced}\@ehd }; GraphicsOptions=/ \ifdocstartedTF{% \xwm@err{\noexpand\GraphicsOptions is a command, not a key.\MsgBrk - Maybe you meant 'graphicsoptions'}\@ehc + Maybe you meant 'graphicsoptions'}\@ehd }{}; picontoptext=true; picture-on-top-text=true/\setaliaskey{picontoptext}; @@ -713,8 +745,7 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ \usename{#1tmarkfalse} }{% \usename{#1tmarktrue} - }% - \letcstocsn\currwatermark{#1textmark}; + }; text-mark=DRAFT/\setaliaskey{textmark}; firstpage=true/\ifdefboolFT{#1firstpage}{}{\usename{#1minmarktrue}}; first-page=true/\setaliaskey{firstpage}; @@ -724,7 +755,7 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ page=1/ \ifinsetTF{-}{##1}{% \xwm@err{I found '-' in '##1' for key 'page', - \MsgBrk but 'page' doesn't take page-range}\@ehc + \MsgBrk but 'page' doesn't take page-range}\@ehd }{% \ifnum\numexpr##1=\z@pt\else\usename{#1onepageonlytrue} \usename{#1minmarktrue}\fi @@ -738,7 +769,7 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ \cptmakecs{#1pagestart}\cptmakecs{#1pageend}}; pagex={1}/ \ifbracedTF{##1}{}{% - \xwm@err{Value of key 'pagex' must be braced}\@ehc + \xwm@err{Value of key 'pagex' must be braced}\@ehd }; boxalign=/\ifblankTF{##1}{} {\aftercsname\xwm@setboxalign{#1boxalign}}; @@ -954,29 +985,31 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ tileno,tilenumber,tile-number,number-of-tiles } \new@def*\xwm@pagespecifiers{% - page=,pages=,pagex=,firstpage,lastpage,allpages,% - oddpages,evenpages% + % '=' is needed here to create uniqueness; eg, to avoid confusing + % ',page' with ',pages'. + page=,pages=,pagex=,firstpage,lastpage,allpages,oddpages,evenpages,% + section=,sections=,sectionx=% } \robust@def*\xwm@decidedetok#1{% - \ifsingletokenTF{#1}{% + \ifntypeTF{#1}{% \ifmacroTF{#1}{% - \let\xwm@detok\cptoxdetok + \let\xwm@detoktype\cptoxdetok }{% - \let\xwm@detok\detokenize + \let\xwm@detoktype\detokenize }% }{% - \let\xwm@detok\detokenize + \let\xwm@detoktype\detokenize }% } \robust@def*\xwm@decidexp#1{% - \ifsingletokenTF{#1}{% + \ifntypeTF{#1}{% \ifmacroTF{#1}{% - \let\xwm@xp\expandcsonce + \let\xwm@exptype\expandcsonce }{% - \let\xwm@xp\unexpanded + \let\xwm@exptype\unexpanded }% }{% - \let\xwm@xp\unexpanded + \let\xwm@exptype\unexpanded }% } \robust@def*\newwatermark#1{% @@ -992,8 +1025,7 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ }% } \robust@def*\xnewwatermark{% - \xwm@suffixcheck - {\cpt@teststpm{\cpt@testopt\cpt@xnewwatermark{}}}% + \xwm@suffixcheck{\cpt@teststpm{\cpt@testopt\cpt@xnewwatermark{}}}% } \robust@def*\xwm@ltxcmds{% \centering,\flushright,\flushleft,\raggedright,% @@ -1051,20 +1083,20 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ }% } \robust@def\xwm@n@wwatermark[#1]#2{% - \ifboolTF{cpt@pm}{}{\xwm@n@ww@termark{#1}{#2}}% + \ifdefboolTF{cpt@pm}{}{\xwm@n@ww@termark{#1}{#2}}% } \robust@def\xwm@n@ww@termark#1#2{% \xwm@decidexp{#1}% - \edef\xwm@currattrib{\xwm@xp{#1}}% + \edef\xwm@currattrib{\xwm@exptype{#1}}% \cpt@sttrue\cpt@kvnormalize[,]\xwm@currattrib \xwm@decidexp{#2}% - \edef\xwm@currmark{\xwm@xp{#2}}% + \edef\xwm@currmark{\xwm@exptype{#2}}% \xwm@decidedetok{#2}% \xwm@swafalse - \xifinsetTF{\detokenize{\newwatermark}}{\xwm@detok{#2}}{% + \xifinsetTF{\detokenize{\newwatermark}}{\xwm@detoktype{#2}}{% \xwm@swatrue }{% - \xifinsetTF{\detokenize{\newwallpaper}}{\xwm@detok{#2}}{% + \xifinsetTF{\detokenize{\newwallpaper}}{\xwm@detoktype{#2}}{% \xwm@swatrue }{}% }% @@ -1072,10 +1104,10 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ \ifxwm@allownesting\else \xwm@err{Nested '\string\newwatermark' or '\string\newwallpaper'\MsgBrk - while option 'allownesting' is false}\@ehc + while option 'allownesting' is false}\@ehd \fi \fi - \ifboolTF{xwm@wall}{}{% + \ifdefboolTF{xwm@wall}{}{% \xwmifitemsinFT[1]{% squaretiles,square-tiles,tilexsize,tile-xsize,% tileysize,tile-ysize,wpxoffset,wallpaper-xoffset,% @@ -1084,13 +1116,13 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ tile-number,number-of-tiles% }{#1}{}{% \xwm@@err{'\xwm@items' not admissible for - \MsgBrk non-wallpaper watermarks}\@ehc + \MsgBrk non-wallpaper watermarks}\@ehd }% }% - \ifboolTF{xwm@allownesting}{}{% + \ifdefboolTF{xwm@allownesting}{}{% \cpt@choicefdfalse \def\csv@do##1{% - \xifinsetFT{,\detokenize{##1}}{,\xwm@detok{#2}}{}{% + \xifinsetFT{,\detokenize{##1}}{,\xwm@detoktype{#2}}{}{% \def\xwm@tempa{##1}% \cpt@choicefdtrue\loopbreak }% @@ -1101,28 +1133,28 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ \MsgBrk The following keys are not allowed in \MsgBrk mandatory/second argument of \MsgBrk '\string\newwatermark' or '\string\newwallpaper': - ^^J||\xwm@samplemarkkeys||}\@ehc + ^^J||\xwm@samplemarkkeys||}\@ehd \fi }% - \xifinsetFT\xwm@watermarkparser{\xwm@detok{#2}}{}{% + \xifinsetFT\xwm@watermarkparser{\xwm@detoktype{#2}}{}{% \xwm@err{Watermark parser '\xwm@watermarkparser' appears in the following watermark.\MsgBrk Enclose your token - '\xwm@watermarkparser' in braces:^^J||\unexpanded{#2}||}\@ehc + '\xwm@watermarkparser' in braces:^^J||\unexpanded{#2}||}\@ehd }% - \x@xwmifitemsinTF[1]\xwm@pagespecifiers{\expandcsonce\xwm@currattrib}{% - \x@xwmifitemsinTF[2]\xwm@pagespecifiers{\expandcsonce\xwm@currattrib}{% + \xxwmifitemsinTF[1]\xwm@pagespecifiers{\expandcsonce\xwm@currattrib}{% + \xxwmifitemsinTF[2]\xwm@pagespecifiers{\expandcsonce\xwm@currattrib}{% \xwm@err{Too many page specifiers '\xwm@items' for watermark: ^^J||\expandcsonce\xwm@currattrib||}{% Only one page specifier is allowed in watermark.}% }{}% }{% \xwm@err{No page specifier for watermark: - ^^J||\expandcsonce\xwm@currmark||}\@ehc + ^^J||\expandcsonce\xwm@currmark||}\@ehd }% \ifcsnullTF\xwm@currattrib{% \ifcsnullTF\xwm@currmark{}{% \xwm@@err{No attributes for watermark: - ^^J||\expandcsonce\xwm@currmark||}\@ehc + ^^J||\expandcsonce\xwm@currmark||}\@ehd }% }{% \xwm@makecurrmark @@ -1132,150 +1164,256 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ \expandcsonce\xwm@backlist\fi }% \expandafter\edef\reserved@a{% - \expandafter\ifdefTF\reserved@a{\expandcstwice\reserved@a}{}% - \expandcsonce\currwatermark + \expandafter\ifdefined\reserved@a\expandcstwice\reserved@a\fi + \expandcsonce\xwm@currwatermark }% - \undefcs\xwm@xp\undefcs\xwm@detok } -\robust@def*\xwm@twopagespecerr{% - \ifxwm@swa +\robust@def*\xwm@avoidtwopagespecs{% + \if\xwm@pagespecfd \xwm@err{Two page specifiers in watermark attributes: - ^^J||\cptoxdetok{\xwm@currattrib}||}\@ehc + ^^J||\cptoxdetok\xwm@currattrib||}\@ehd \else - \xwm@swatrue + \def\xwm@pagespecfd{00}% \fi } \robust@def*\xwm@addcurrmark#1{% - \begingroup - \xifinsetTF{,\detokenize{textmark}}{,\cptoxdetok\xwm@currattrib}{% - \@tempswafalse - \ifxTF\xwm@currmark\@empty{}{% - \xwm@err{Duplicate nonempty 'textmark'}\@ehc + % Local group is in effect. + % If the current mark is already on current page, ignore it. This, eg, + % avoids 'pagex={1,1,2},textmark=X' making two entries for 'X' on page 1. + \letcstocsn\reserved@a{xwm@mark@@\romannumeral#1}% + \ifx\reserved@a\xwm@currattrib\else + \xifinsetTF{\detokenize{textmark=}}{\cptoxdetok\xwm@currattrib}{% + \@tempswafalse + \ifx\xwm@currmark\@empty\else + \xwm@err{Duplicate textmark in ||\cptoxdetok\xwm@currmark||} + {I found textmark earlier in the mandotory argument of + \noexpand\newwatermark, and now I find textmark key in the + attribute list.}% + \fi + }{% + \@tempswatrue }% - }{% - \@tempswatrue - }% - \edef\xwm@tempb{% - page=\number#1,\expandcsonce\xwm@currattrib,% - \if@tempswa textmark={\expandcsonce\xwm@currmark}\fi - }% - \ifcsemptyTF\xwm@tempb{}{\xwm@normalizedoublecomma\xwm@tempb}% - \edef\currwatermark{% - \expandcsonce\currwatermark{\number#1}{\expandcsonce\xwm@tempb}% - }% - \postgroupdef\currwatermark\endgroup + \edef\xwm@tempb{% + page=\number#1,\expandcsonce\xwm@currattrib,% + \if@tempswa textmark={\expandcsonce\xwm@currmark}\fi + }% + \edef\xwm@currwatermark{% + % {<page.no>}{<curr.mark>} + \expandcsonce\xwm@currwatermark{\number#1}{\expandcsonce\xwm@tempb}% + }% + \gletcsntocs{xwm@mark@@\romannumeral#1}\xwm@currattrib + \fi } \robust@def*\xwm@getpagespec#1{% - \ifinsetTF{,#1,}{,page,pages,pagex,}{% - \def\xwm@tempa##1#1=##2,##3\xwm@nil{% - \ifblankTF{##2}{% - \xwm@warn{Key 'page/pages' has blank value; - \MsgBrk '1' used instead}\@ehc - \def\xwm@currpage{1}% - }{% - \ifstrcmpTF{#1}{pages}{% - \ifinsetTF{,}{##2}{% - \xwm@err{Key 'pages' doesn't accept comma-separated - \MsgBrk page numbers: use a hyphen}\@ehc - }{}% + \ifinsetTF{,#1,}{,page,pages,pagex,section,sections,sectionx,}{% + % \xwm@ifpagespec has shown that #1 is in \xwm@currattrib. We + % need to confirm that '#1=' is in \xwm@currattrib. + \xifinsetTF{,\detokenize{#1=}}{,\cptoxdetok\xwm@currattrib}{% + \def\xwm@tempa##1#1=##2,##3\xwm@nil{% + \ifblankTF{##2}{% + \xwm@warn{Key '#1' has an empty value; '1' assumed}\@ehd + \def\xwm@currpages{1}% }{% - \ifstrcmpTF{#1}{pagex}{% - \ifinsetTF{-}{##2}{% - \xwm@err{Key 'pagex' doesn't accept hyphen-separated - \MsgBrk page numbers: use commas}\@ehc + \ifinsetTF{,#1,}{,pages,sections,}{% + \ifinsetTF{,}{##2}{% + \xwm@err{Key '#1' doesn't accept comma-separated + \MsgBrk page numbers: use a hyphen}\@ehd }{}% - }{}% + }{% + \ifinsetTF{,#1,}{,pagex,sectionx,}{% + \ifinsetTF{-}{##2}{% + \xwm@err{Key '#1' doesn't accept hyphen-separated + \MsgBrk page numbers: use commas}\@ehd + }{}% + }{}% + }% + \def\xwm@currpages{##2}% }% - \def\xwm@currpage{##2}% + \edef\xwm@currattrib{\unexpanded{##1,##3}}% }% - \edef\xwm@currattrib{\unexpanded{##1,##3}}% + \expandafter\xwm@tempa\xwm@currattrib,\xwm@nil + }{% + \xwm@err{Key '#1' doesn't have '=' and a value}\@ehd }% - \expandafter\xwm@tempa\xwm@currattrib,\xwm@nil }{% - \def\xwm@tempa##1#1,##2\xwm@nil{% + \xwm@getpagespec@a{#1}% + }% + \kv@@normalize*\xwm@currattrib +} +\robust@def*\xwm@getpagespec@a#1{% + \xifinsetTF{,\detokenize{#1=true},}{,\cptoxdetok\xwm@currattrib,}{% + \def\xwm@tempa##1#1=true,##2\xwm@nil{% \edef\xwm@currattrib{\unexpanded{##1,##2}}% }% \expandafter\xwm@tempa\xwm@currattrib,\xwm@nil + }{% + \xifinsetTF{,\detokenize{#1=false},}{,\cptoxdetok\xwm@currattrib,}{% + \def\xwm@tempa##1#1=false,##2\xwm@nil{% + \edef\xwm@currattrib{\unexpanded{##1,##2}}% + }% + \expandafter\xwm@tempa\xwm@currattrib,\xwm@nil + }{% + \def\xwm@tempa##1#1,##2\xwm@nil{% + \edef\xwm@currattrib{\unexpanded{##1,##2}}% + }% + \expandafter\xwm@tempa\xwm@currattrib,\xwm@nil + }% }% } \robust@def*\xwm@ifpagespec#1{% - \cptexpandtwoargs\cpt@in - {,\detokenize{#1}}{,\cptoxdetok\xwm@currattrib}% - \ifboolTF{cpt@in}\@iden\@gobble + \@expandtwoargs\cpt@in{,\detokenize{#1}}{,\cptoxdetok\xwm@currattrib}% + \ifdefboolTF{cpt@in}\@iden\@gobble } \robust@def*\xwm@normalizedoublecomma#1{% - \def\xwm@tempa##1,,##2\xwm@@nil{% + \def\xwm@tempa##1,,##2\normal@nil{% \ifblankTF{##2}{% \edef#1{\unexpanded{##1}}% }{% - \xwm@tempa##1,##2\xwm@@nil + \xwm@tempa##1,##2\normal@nil }% }% - \expandafter\xwm@tempa#1,,\xwm@@nil + \expandafter\xwm@tempa#1,,\normal@nil } \robust@def*\xwm@makecurrmark{% - \edef\xwm@rsvda{\lastdocpage}% - \def\currwatermark{}% - \xwm@swafalse + \begingroup + \edef\xwm@lastpage{\lastdocpage}% + \def\xwm@currwatermark{}% + \def\xwm@pagespecfd{01}% \xwm@ifpagespec{page=}{% - \xwm@twopagespecerr + \xwm@avoidtwopagespecs \xwm@getpagespec{page}% - \xwm@addcurrmark\xwm@currpage + \xwm@addcurrmark\xwm@currpages }% \xwm@ifpagespec{pages=}{% - \xwm@twopagespecerr + \xwm@avoidtwopagespecs \xwm@getpagespec{pages}% - \xwm@hyphenpagerange\xwm@currpage\xwm@pagestart\xwm@pageend + \xwm@hyphenpagerange\xwm@currpages\xwm@pagestart\xwm@pageend \xwm@cnta\numexpr\xwm@pagestart\relax \cptloop \xwm@addcurrmark\xwm@cnta - \advance\xwm@cnta by1 % + \advance\xwm@cnta\@ne \ifnum\xwm@cnta<\numexpr\xwm@pageend+1\relax \cptrepeat }% \xwm@ifpagespec{pagex=}{% - \xwm@twopagespecerr + \xwm@avoidtwopagespecs \xwm@getpagespec{pagex}% - \def\ltxkeys@do##1{\xwm@addcurrmark{##1}}% - \ltxkeys@parse*1\xwm@currpage + \expandafter\cptfor\xwm@currpages\dofor{% + \xwm@addcurrmark{##1}% + }% }% \xwm@ifpagespec{firstpage}{% - \xwm@twopagespecerr + \xwm@avoidtwopagespecs \xwm@getpagespec{firstpage}% \xwm@addcurrmark{1}% }% \xwm@ifpagespec{lastpage}{% - \xwm@twopagespecerr + \xwm@avoidtwopagespecs \xwm@getpagespec{lastpage}% - \xwm@addcurrmark\xwm@rsvda + \xwm@addcurrmark\xwm@lastpage + }% + \xwm@ifpagespec{allpages}{% + \xwm@avoidtwopagespecs + \xwm@getpagespec{allpages}% + \xwm@cnta\@ne + \cptloop + \xwm@addcurrmark\xwm@cnta + \advance\xwm@cnta\@ne + \ifnum\xwm@cnta<\numexpr\xwm@lastpage+1\relax + \cptrepeat }% \xwm@ifpagespec{evenpages}{% - \xwm@twopagespecerr + \xwm@avoidtwopagespecs \xwm@getpagespec{evenpages}% \xwm@cnta\@ne \cptloop \ifodd\xwm@cnta\else \xwm@addcurrmark\xwm@cnta \fi - \advance\xwm@cnta by1 - \ifnum\xwm@cnta<\numexpr\xwm@rsvda+1\relax + \advance\xwm@cnta\@ne + \ifnum\xwm@cnta<\numexpr\xwm@lastpage+1\relax \cptrepeat }% \xwm@ifpagespec{oddpages}{% - \xwm@twopagespecerr + \xwm@avoidtwopagespecs \xwm@getpagespec{oddpages}% \xwm@cnta\z@pt \cptloop - \ifodd\xwm@cnta\expandafter\@iden\else\expandafter\@gobble\fi - {\xwm@addcurrmark\xwm@cnta}% - \advance\xwm@cnta by1 - \ifnum\xwm@cnta<\numexpr\xwm@rsvda+1\relax + \ifodd\xwm@cnta + \xwm@addcurrmark\xwm@cnta + \fi + \advance\xwm@cnta\@ne + \ifnum\xwm@cnta<\numexpr\xwm@lastpage+1\relax + \cptrepeat + }% + \xwm@ifpagespec{section=}{% + \xwm@avoidtwopagespecs + \xwm@getpagespec{section}% + \xwm@convertsectopage\xwm@currpages + \xwm@addcurrmark\xwm@currpages + }% + \xwm@ifpagespec{sections=}{% + \xwm@avoidtwopagespecs + \xwm@getpagespec{sections}% + \xwm@convertsectopage@hyphen\xwm@currpages + \xwm@hyphenpagerange\xwm@currpages\xwm@pagestart\xwm@pageend + \xwm@cnta\numexpr\xwm@pagestart\relax + \cptloop + \xwm@addcurrmark\xwm@cnta + \advance\xwm@cnta\@ne + \ifnum\xwm@cnta<\numexpr\xwm@pageend+1\relax \cptrepeat }% - \ifxwm@swa\else + \xwm@ifpagespec{sectionx=}{% + \xwm@avoidtwopagespecs + \xwm@getpagespec{sectionx}% + \xwm@convertsectopage\xwm@currpages + \expandafter\cptfor\xwm@currpages\dofor{% + \xwm@addcurrmark{##1}% + }% + }% + \if\xwm@pagespecfd\else \xwm@err{No page specifier in watermark attributes: - ^^J||\cptoxdetok\xwm@currattrib||}\@ehc + ^^J||\cptoxdetok\xwm@currattrib||}\@ehd \fi + \postgroupdef\xwm@currwatermark\endgroup +} +% \xwm@convertsectopage{<current.pages>} +\robust@def*\xwm@convertsectopage#1{% + \begingroup + \def\xwm@tempa{}% + \expandafter\cptfor#1\dofor{% + \letcstocsn\reserved@a{xwm@secstartpage@@\romannumeral##1}% + \ifx\reserved@a\undefined + \def\reserved@a{1}% + \fi + \xifinsetTF{,\reserved@a,}{,\xwm@tempa,}{}{% + \edef\xwm@tempa{% + \xwm@tempa\ifx\xwm@tempa\@empty\else,\fi\reserved@a + }% + }% + }% + \let#1\xwm@tempa + \postgroupdef#1\endgroup +} +% \xwm@convertsectopage@hyphen{<current.pages>} +\robust@def*\xwm@convertsectopage@hyphen#1{% + \begingroup + \def\xwm@tempa{}% + \def\csv@do##1{% + \letcstocsn\reserved@a{xwm@secstartpage@@\romannumeral##1}% + \ifx\reserved@a\undefined + \def\reserved@a{1}% + \fi + \xifinsetTF{-\reserved@a-}{-\xwm@tempa-}{}{% + \edef\xwm@tempa{% + \xwm@tempa\ifx\xwm@tempa\@empty\else-\fi\reserved@a + }% + }% + }% + \csv@@parse*[-]#1% + \let#1\xwm@tempa + \postgroupdef#1\endgroup } \robust@def*\dummywatermark#1{% \ifstrcmpTF{#1}\newwatermark{% @@ -1283,7 +1421,7 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ {'\string\newwatermark' in front of \string\dummywatermark}% {First comment out or remove '\string\newwatermark'.}% }{% - \ifboolTF{xwm@usedummymarks}\newwatermark\xwm@dummywatermark + \ifdefboolTF{xwm@usedummymarks}\newwatermark\xwm@dummywatermark #1% }% } @@ -1293,7 +1431,7 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ {'\string\newwallpaper' in front of \string\dummywallpaper}% {First comment out or remove '\string\newwallpaper'.}% }{% - \ifboolTF{xwm@usedummymarks}\newwallpaper\xwm@dummywatermark + \ifdefboolTF{xwm@usedummymarks}\newwallpaper\xwm@dummywatermark #1% }% } @@ -1308,18 +1446,25 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ \global\let\newwatermark\dummywatermark \global\xwm@usedummymarksfalse } +\robust@def*\xwmsuspendwatermark{\xwm@putmarkfalse} +\robust@def*\xwmresumewatermark{\xwm@putmarktrue} +\newletcs\xwmwatermarkoff\xwmsuspendwatermark +\newletcs\xwmwatermarkon\xwmresumewatermark + \robust@def*\xwm@putbothmarks{% - \ifdefFT\xwm@watermarklist{}\xwm@textpicmark@a - \ifdefFT\xwm@wallpaperlist{}\xwm@wallpaper@a + \ifdefboolFT{xwm@putmark}{}{% + \ifdefFT\xwm@watermarklist{}\xwm@textpicmark@a + \ifdefFT\xwm@wallpaperlist{}\xwm@wallpaper@a + }% } -\chardef\xwm@nowatermark\z@pt +\chardef\xwm@nowatermarksignal\z@pt \AtBeginShipout{% - \endlinechar13\catcode13=5 - \catcode`\ =10 + \endlinechar13 \catcode13=5\relax + \catcode`\ =10\relax \catcode`\\\z@pt \catcode`\{\@ne \catcode`\}\tw@ - \ifboolTF{xwm@printwatermark}{% + \ifdefboolTF{xwm@printwatermark}{% \let\xwm@watermarklist\xwm@backwmklist \let\xwm@wallpaperlist\xwm@backwalllist \AtBeginShipoutUpperLeft{% @@ -1333,8 +1478,8 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ \xwm@putbothmarks }% }{% - \ifnum\xwm@nowatermark<\@ne - \pushnumber\xwm@nowatermark + \ifnum\xwm@nowatermarksignal<\@ne + \edef\xwm@nowatermarksignal{\the\numexpr\xwm@nowatermarksignal+1}% \xwm@info{'printwatermark=false': no watermark printed}% \fi }% @@ -1400,10 +1545,10 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ } \robust@def*\xwm@textpicmark@a{% \ifcsnullTF\xwm@watermarklist{% - \ifboolTF{xwm@foregrd}{}{% + \ifdefboolTF{xwm@foregrd}{}{% \ifdefboolFT{xwm@printwatermark}{}{% - \ifboolTF{xwm@draft}{% - \ifboolTF{wmk@showpagecenter}{}{% + \ifdefboolTF{xwm@draft}{% + \ifdefboolTF{wmk@showpagecenter}{}{% \ifnumcmpFT\c@page=\@ne{}{% \cptexpandargonce{\ltxkeys@setkeys[XWM]{watermark}}% \xwm@perpagewmkstate @@ -1446,21 +1591,19 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ }{% [\ltxkeys@keynames]{\expandcsnonce{xwm@perpage#2state}}% }% - \edef\currwatermark{\unexpanded{#3}}% + \edef\xwm@currwatermark{\unexpanded{#3}}% \ifblankTF{#3}{}{\ltxkeys@setkeys[XWM]{#1}{#3}}% } \robust@def*\xwm@processmarks#1#2{% -%\edef\tempa{\expandcsonce{#1}} -%\show\tempa \def\xwm@pr@cessmarks##1##2{% - \ifstrcmpTF{##1}{.}{}{% + \ifstrcmpTF{##1}{\@nil}{}{% \ifnumcmpTF##1=\c@page{#2}{% \edef#1{\expandcsonce#1\unexpanded{{##1}{##2}}}% }% \xwm@pr@cessmarks }% }% - \cptexpandsecondonce{\def#1{}\xwm@pr@cessmarks}{#1}{.}{}% + \cptexpandsecondonce{\def#1{}\xwm@pr@cessmarks}{#1}{\@nil}{}% } \ltxkeys@disablekeys*[XWM]{main}{printwatermark,disablegeometry} \BeforeStartOfDocument{% @@ -1482,7 +1625,7 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ \edef\xwm@curralign{\expandcsnonce{#1@textalign}}% \cptexpanded{\endgroup \xwm@put(\mcs{#1@textxpos@a},\mcs{#1@textypos@a}){% - \quitvmode\nxp\@killglue\noindent + \nxp\leavevmode\nxp\@killglue\noindent \nxp\makebox(0,0)[\expandcsnonce{#1@boxalign}]{% \nxp\rotatebox[origin=c]{\mcs{#1@textangle}}{% \nxp\scalebox{\mcs{#1@textscale}}{% @@ -1496,7 +1639,7 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ \nxp\fontseries\mcs{#1@fontseries}% \nxp\fontsize\mcs{#1@fontsize}\mcs{#1@fontsize@a}% \nxp\selectfont - \quitvmode + \nxp\leavevmode \nxp\begin{\xwm@curralign}% \mcs{#1@textmark}% \nxp\end{\xwm@curralign}% @@ -1508,18 +1651,19 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ }% \@killglue\normalcolor } -\robust@def*\xwm@getpicsize#1{% +% See also \xwmgetpicturesize. +\robust@def*\xwm@getgrafsize#1{% \ifcsnnullTF{#1@picwidth}{% \ifcsnnullTF{#1@picheight}{% \edef\pic@size{scale=\cptmakecs{#1@picscale}}% }{% \xwm@err{You have supplied picture height - but not width}\@ehc + but not width}\@ehd }% }{% \ifcsnnullTF{#1@picheight}{% \xwm@err{You have supplied picture width - but not height}\@ehc + but not height}\@ehd }{% \edef\pic@size{width=\cptmakecs{#1@picwidth},% height=\cptmakecs{#1@picheight}}% @@ -1528,12 +1672,13 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ } \robust@def*\xwm@picmark{% \xwm@findpicfile\wmk@picfile\wmk@picfileext - \xwm@getpicsize{wmk}% + \xwm@getgrafsize{wmk}% \cptpassexpanded{% \setbox\xwm@boxa=\hbox{% - \noexpand\includegraphics[\ifxwm@pdf viewport\else - bb\fi=\wmk@picbb,\pic@size,clip,\wmk@graphicsoptions, - \xwm@gr@phicsoptions]{\xwm@filefound}}% + \noexpand\includegraphics[\ifxwm@pdf viewport\else + bb\fi=\wmk@picbb,\pic@size,clip,\wmk@graphicsoptions,% + \xwm@gr@phicsoptions]{\xwm@filefound}% + }% }% \cptdimdef\widthofcurrpic{\wd\xwm@boxa}% \cptdimdef\heightofcurrpic{\ht\xwm@boxa}% @@ -1542,7 +1687,7 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ \xwm@put(\wmk@picxpos@a,\wmk@picypos@a){% \rotatebox[origin=c]\wmk@picangle{% \cptexpandsecond{\makebox(0,0)}{[\wmk@boxalign]{% - \ifboolTF{xwm@draft}{\xwm@draftbox{wmk}}{\copy\xwm@boxa}% + \ifdefboolTF{xwm@draft}{\xwm@draftbox{wmk}}{\copy\xwm@boxa}% }% }% }}% @@ -1568,7 +1713,7 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ \newcommand*\xwm@textpicmark@c{% \xwm@getposition\wmk@textxpos\wmk@textypos\wmk@coordunit \xwm@getposition\wmk@picxpos\wmk@picypos\wmk@coordunit - \ifboolTF{wmk@picontoptext}{% + \ifdefboolTF{wmk@picontoptext}{% \ifdefboolFT{wmk@tmark}{}{\xwm@textbox{wmk}}% \ifdefboolFT{wmk@pmark}{}\xwm@picmark }{% @@ -1601,7 +1746,7 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ \robust@def*\xwm@w@term@rkpaths#1(#2)#3{% \cpt@useemptytrue \def\xwm@tempa{#3}% - \ifboolTF{cpt@st}{% + \ifdefboolTF{cpt@st}{% \ifbracedTF{#3}{\xwm@stripallouterbraces{#3}\xwm@tempa}{}% \def\csv@do##1{% \ifbracedTF{##1}{% @@ -1616,13 +1761,13 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ \xifinsetFT{,}{\cptoxdetok\xwm@tempa}{}{% \xwm@err{Input path '#3' contains comma: \MsgBrk Commas can appear only in the argument - \MsgBrk of star (*) variant of \string\watermarkpaths}\@ehc + \MsgBrk of star (*) variant of \string\watermarkpaths}\@ehd }% \def\tsv@do##1{% \ifbracedTF{##1}{% \cptexpandarg{\grightaddtocs\xwm@inputpath}{{#1\@iden##1#2}}% }{% - \xwm@err{Input path '##1' needs outer braces}\@ehc + \xwm@err{Input path '##1' needs outer braces}\@ehd }% }% \tsv@@parse*\xwm@tempa @@ -1664,7 +1809,7 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ }% }% \tsv@@loop*\xwm@inputpath - \ifboolTF{cpt@choicefd}% + \ifdefboolTF{cpt@choicefd}% } \robust@def*\xwm@nofileerr#1#2{% \message{% @@ -1693,7 +1838,7 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ \robust@def*\xwm@findpicfile#1#2{% \let\xwm@filefound\@empty \edef\xwm@filegiven{#1.#2}% - \ifboolTF{xwm@pdf}{% + \ifdefboolTF{xwm@pdf}{% \xwm@f@ndpicfile{#1}{#2}{pdf,png,jpeg,mps}% }{% \xwm@f@ndpicfile{#1}{#2}{eps,ps}% @@ -1713,8 +1858,8 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ }% \csv@@loop[,]{#3}% }% - \ifboolTF{xwm@swb}{}{% - \ifboolTF{xwm@swa}{% + \ifdefboolTF{xwm@swb}{}{% + \ifdefboolTF{xwm@swa}{% \xwm@warn{File '\xwm@filegiven' doesn't exist \MsgBrk on given path(s) '\xwm@inputpath', \MsgBrk but I have found \xwm@filefound'}% @@ -1725,7 +1870,7 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ }% } \robust@def*\xwm@wallpaper@c{% - \ifboolTF{wlp@picontoptext}{% + \ifdefboolTF{wlp@picontoptext}{% \xwm@textwallpaper \xwm@picwallpaper }{% @@ -1736,13 +1881,12 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ } \robust@def*\xwm@textwallpaper{% \ifdefboolFT{wlp@tmark}{}{% - \ifboolTF{wlp@squaretiles}\xwm@sqtexttiles\xwm@texttiles + \ifdefboolTF{wlp@squaretiles}\xwm@sqtexttiles\xwm@texttiles }% } \robust@def*\xwm@picwallpaper{% \ifdefboolFT{wlp@pmark}{}{% - \ifboolTF{wlp@squaretiles}% - \xwm@sqpictiles\xwm@pictiles + \ifdefboolTF{wlp@squaretiles}\xwm@sqpictiles\xwm@pictiles }% } \robust@def*\xwm@dotiling{\xwm@makedraftbox\xwm@dotiling@a} @@ -1756,8 +1900,7 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ \xwm@put(\tilex,\xwm@tempa){\rotatebox[origin=c] \xwm@currangle{% \cptexpandsecond{\makebox(0,0)}{[\wlp@boxalign]}{% - \ifboolTF{xwm@draft} - {\xwm@draftbox{wlp}}{\copy\xwm@boxa}% + \ifdefboolTF{xwm@draft}{\xwm@draftbox{wlp}}{\copy\xwm@boxa}% }% }}% \cptdimadd\tilex{\wlp@tilexsize+\wlp@tilexoffset}% @@ -1768,7 +1911,7 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ \robust@def*\xwm@toofewtiles#1{% \ifnum\numexpr#1<4\relax \xwm@err{Too few square wallpapers '#1'; - \MsgBrk minimum expected: 4}\@ehc + \MsgBrk minimum expected: 4}\@ehd \fi } \robust@def*\xwm@texttiles{% @@ -1836,21 +1979,23 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ \ifmmode\copy\@tempboxa\else\unhcopy\@tempboxa\fi \endgroup } -\robust@def*\xwmgetpicdim{\cpt@testopt\xwm@getpicdim{}} -\robust@def*\xwm@getpicdim[#1]#2{% +\robust@def*\xwmgetpicturesize{\cpt@testopt\xwm@getpicsize{}} +\robust@def*\xwm@getpicsize[#1]#2{% \begingroup \edef\Ginput@path{% \usecsifdef\Ginput@path\usecsifdef\xwm@inputpath \usecsifdef\input@path }% \setbox\xwm@boxa=\hbox{\includegraphics[#1]{#2}}% - \cptdimdef\xwmwdofpic{\wd\xwm@boxa}% - \cptdimdef\xwmhtofpic{\ht\xwm@boxa}% - \cptdimdef\xwmdpofpic{\dp\xwm@boxa}% - \cptdimdef\xwmtothtofpic{\ht\xwm@boxa+\dp\xwm@boxa}% + % See also \widthofcurrpic. + \cptdimdef\widthofpic{\wd\xwm@boxa}% + \cptdimdef\heightofpic{\ht\xwm@boxa}% + \cptdimdef\depthofpic{\dp\xwm@boxa}% + \cptdimdef\totalheightofpic{\ht\xwm@boxa+\dp\xwm@boxa}% \let\\\cpt@csexit \cptexpanded{\endgroup - \\\xwmwdofpic\\\xwmhtofpic\\\xwmdpofpic\\\xwmtothtofpic}% + \\\widthofpic\\\heightofpic\\\depthofpic\\\totalheightofpic + }% } % #1=optional text to be printed as watermark % #2=sundry fixed keys @@ -1860,12 +2005,11 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ \cpt@teststpm{\cpt@testopt\xwm@repeatwatermarks{}}% } \robust@def\xwm@repeatwatermarks[#1]#2#3{% - \edef\repeat@marks{\csv@@loop\ifcpt@st*\fi}% + \edef\cpt@tempa{\csv@@loop\ifcpt@st*\fi}% \def\csv@do##1{% \ifblankTF{##1}{}{\newwatermark[#2,##1]{#1}}% }% - \ifboolTF{cpt@pm}{}{\repeat@marks[;]{#3}}% - \undefcs\repeat@marks + \ifdefboolTF{cpt@pm}{}{\cpt@tempa[;]{#3}}% } \ltxkeys@definekeys*[XWM]{boxedminipage}[xwmbmp@]{% width=\textwidth; @@ -1894,7 +2038,7 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ \xifstrcmpTF\xwmbmp@innerpos{t}{% \vtop }{% - \ifboolTF{mmode}{% + \ifdefboolTF{mmode}{% \vcenter }{% \@pboxswtrue $\vcenter |$ @@ -2146,7 +2290,7 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ \color{\fad@boxcolor}% \chardef\icol\z@pt \cptdotimes\@tempcnta{% - \pushnumber\icol + \cptpushnumber\icol \colbox{\scalebox\fad@scale {\xwmstrut\fad@height\fad@depth \usename{fade@\romannumeral\icol}}}% @@ -2203,7 +2347,7 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ \xwm@gethfoffset\pgn@hfoffsetleft\pgn@hfoffsetright \fancyhfoffset[R,L]\xwm@hfoffset \AtBeginShipout{% - \ifboolTF{pgn@sendtoback}{% + \ifdefboolTF{pgn@sendtoback}{% \AtBeginShipoutUpperLeft{% \xwm@f@ncyp@genos }% @@ -2214,7 +2358,7 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ }% }% } -\newswitch{xwm@fancy} +\cptnewswitch{xwm@fancy} \robust@def*\xwm@f@ncypagenos{% \def\pgn@textmark{% \begingroup @@ -2222,14 +2366,14 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ \pgn@format{\normalfont\pgn@style}% \endgroup }% - \switchtrue{xwm@fancy}% + \cptswitchtrue{xwm@fancy}% \xwm@textbox{pgn}% - \switchfalse{xwm@fancy}% + \cptswitchfalse{xwm@fancy}% } \robust@def*\xwm@f@ncyp@genos{% \ifboolFT{pgn@showpagenos}{}{% \ifnumcmpTF\c@page=\@ne{% - \ifboolTF{pgn@showonpageone}\xwm@f@ncypagenos\relax + \ifdefboolTF{pgn@showonpageone}\xwm@f@ncypagenos\relax }{% \xwm@f@ncypagenos }% @@ -2239,13 +2383,13 @@ $Id: xwatermark.sty,v 1.5.2b 2012/08/10 09:00:00 Ahmed Musa Exp $ \begingroup \def\temp@err{% \xwm@err{Only digits (without units) are allowed\MsgBrk - in the values of 'hfoffsetleft' and 'hfoffsetright'}\@ehc + in the values of 'hfoffsetleft' and 'hfoffsetright'}\@ehd }% \xifblankTF{#1}{}{% - \x@xwmifitemsinTF\xwm@allowedcoordunits{#1}\temp@err{}% + \xxwmifitemsinTF\xwm@allowedcoordunits{#1}\temp@err{}% }% \xifblankTF{#2}{}{% - \x@xwmifitemsinTF\xwm@allowedcoordunits{#2}\temp@err{}% + \xxwmifitemsinTF\xwm@allowedcoordunits{#2}\temp@err{}% }% \def\xwm@tempc##1##2{% \xifblankTF{##1}{\def##2{1}}{\def##2{##1}}% |