summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Master/texmf-dist/doc/latex/xwatermark/Graphics/xwatermarkpic.eps932
-rw-r--r--Master/texmf-dist/doc/latex/xwatermark/Graphics/xwatermarkpic.pdfbin14861 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/latex/xwatermark/Graphics/xwatermarkpic.tex107
-rw-r--r--Master/texmf-dist/doc/latex/xwatermark/README61
-rw-r--r--Master/texmf-dist/doc/latex/xwatermark/tab-globaloptions.tex57
-rw-r--r--Master/texmf-dist/doc/latex/xwatermark/tab-localoptions.tex170
-rw-r--r--Master/texmf-dist/doc/latex/xwatermark/xwatermark-bugreport.tex30
-rw-r--r--Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples.cfg253
-rw-r--r--Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples.pdfbin182297 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples.tex181
-rw-r--r--Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples1.pdfbin0 -> 168751 bytes
-rw-r--r--Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples1.tex95
-rw-r--r--Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples2.pdfbin0 -> 179121 bytes
-rw-r--r--Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples2.tex205
-rw-r--r--Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide.cfg295
-rw-r--r--Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide.pdfbin255394 -> 488959 bytes
-rw-r--r--Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide.tex1076
-rw-r--r--Master/texmf-dist/doc/latex/xwatermark/xwatermark-manifest.tex17
-rw-r--r--Master/texmf-dist/tex/latex/xwatermark/xwatermark.sty2508
19 files changed, 3619 insertions, 2368 deletions
diff --git a/Master/texmf-dist/doc/latex/xwatermark/Graphics/xwatermarkpic.eps b/Master/texmf-dist/doc/latex/xwatermark/Graphics/xwatermarkpic.eps
deleted file mode 100644
index 068aef30c01..00000000000
--- a/Master/texmf-dist/doc/latex/xwatermark/Graphics/xwatermarkpic.eps
+++ /dev/null
@@ -1,932 +0,0 @@
-%!PS-Adobe-3.0 EPSF-3.0
-%%Creator: dvips(k) 5.96dev Copyright 2007 Radical Eye Software
-%%Title: draftmarkpic.dvi
-%%CreationDate: Sun May 17 23:07:58 2009
-%%Pages: 1
-%%PageOrder: Ascend
-%%BoundingBox: 115 92 301 747
-%%DocumentFonts: CMR12
-%%DocumentPaperSizes: a4
-%%EndComments
-%DVIPSWebPage: (www.radicaleye.com)
-%DVIPSCommandLine: dvips.exe draftmarkpic.dvi
-%DVIPSParameters: dpi=600
-%DVIPSSource: TeX output 2009.05.17:2307
-%%BeginProcSet: tex.pro 0 0
-%!
-/TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S
-N}B/A{dup}B/TR{translate}N/isls false N/vsize 11 72 mul N/hsize 8.5 72
-mul N/landplus90{false}def/@rigin{isls{[0 landplus90{1 -1}{-1 1}ifelse 0
-0 0]concat}if 72 Resolution div 72 VResolution div neg scale isls{
-landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div hsize
-mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul TR[
-matrix currentmatrix{A A round sub abs 0.00001 lt{round}if}forall round
-exch round exch]setmatrix}N/@landscape{/isls true N}B/@manualfeed{
-statusdict/manualfeed true put}B/@copies{/#copies X}B/FMat[1 0 0 -1 0 0]
-N/FBB[0 0 0 0]N/nn 0 N/IEn 0 N/ctr 0 N/df-tail{/nn 8 dict N nn begin
-/FontType 3 N/FontMatrix fntrx N/FontBBox FBB N string/base X array
-/BitMaps X/BuildChar{CharBuilder}N/Encoding IEn N end A{/foo setfont}2
-array copy cvx N load 0 nn put/ctr 0 N[}B/sf 0 N/df{/sf 1 N/fntrx FMat N
-df-tail}B/dfs{div/sf X/fntrx[sf 0 0 sf neg 0 0]N df-tail}B/E{pop nn A
-definefont setfont}B/Cw{Cd A length 5 sub get}B/Ch{Cd A length 4 sub get
-}B/Cx{128 Cd A length 3 sub get sub}B/Cy{Cd A length 2 sub get 127 sub}
-B/Cdx{Cd A length 1 sub get}B/Ci{Cd A type/stringtype ne{ctr get/ctr ctr
-1 add N}if}B/CharBuilder{save 3 1 roll S A/base get 2 index get S
-/BitMaps get S get/Cd X pop/ctr 0 N Cdx 0 Cx Cy Ch sub Cx Cw add Cy
-setcachedevice Cw Ch true[1 0 0 -1 -.1 Cx sub Cy .1 sub]{Ci}imagemask
-restore}B/D{/cc X A type/stringtype ne{]}if nn/base get cc ctr put nn
-/BitMaps get S ctr S sf 1 ne{A A length 1 sub A 2 index S get sf div put
-}if put/ctr ctr 1 add N}B/I{cc 1 add D}B/bop{userdict/bop-hook known{
-bop-hook}if/SI save N @rigin 0 0 moveto/V matrix currentmatrix A 1 get A
-mul exch 0 get A mul add .99 lt{/QV}{/RV}ifelse load def pop pop}N/eop{
-SI restore userdict/eop-hook known{eop-hook}if showpage}N/@start{
-userdict/start-hook known{start-hook}if pop/VResolution X/Resolution X
-1000 div/DVImag X/IEn 256 array N 2 string 0 1 255{IEn S A 360 add 36 4
-index cvrs cvn put}for pop 65781.76 div/vsize X 65781.76 div/hsize X}N
-/p{show}N/RMat[1 0 0 -1 0 0]N/BDot 260 string N/Rx 0 N/Ry 0 N/V{}B/RV/v{
-/Ry X/Rx X V}B statusdict begin/product where{pop false[(Display)(NeXT)
-(LaserWriter 16/600)]{A length product length le{A length product exch 0
-exch getinterval eq{pop true exit}if}{pop}ifelse}forall}{false}ifelse
-end{{gsave TR -.1 .1 TR 1 1 scale Rx Ry false RMat{BDot}imagemask
-grestore}}{{gsave TR -.1 .1 TR Rx Ry scale 1 1 false RMat{BDot}
-imagemask grestore}}ifelse B/QV{gsave newpath transform round exch round
-exch itransform moveto Rx 0 rlineto 0 Ry neg rlineto Rx neg 0 rlineto
-fill grestore}B/a{moveto}B/delta 0 N/tail{A/delta X 0 rmoveto}B/M{S p
-delta add tail}B/b{S p tail}B/c{-4 M}B/d{-3 M}B/e{-2 M}B/f{-1 M}B/g{0 M}
-B/h{1 M}B/i{2 M}B/j{3 M}B/k{4 M}B/w{0 rmoveto}B/l{p -4 w}B/m{p -3 w}B/n{
-p -2 w}B/o{p -1 w}B/q{p 1 w}B/r{p 2 w}B/s{p 3 w}B/t{p 4 w}B/x{0 S
-rmoveto}B/y{3 2 roll p a}B/bos{/SS save N}B/eos{SS restore}B end
-
-%%EndProcSet
-%%BeginProcSet: pstricks.pro 0 0
-%!
-% PostScript prologue for pstricks.tex.
-% Version 1.01, 2006/01/11
-% For distribution, see pstricks.tex.
-%
-/tx@Dict 200 dict def tx@Dict begin
-/ADict 25 dict def
-/CM { matrix currentmatrix } bind def
-/SLW /setlinewidth load def
-/CLW /currentlinewidth load def
-/CP /currentpoint load def
-/ED { exch def } bind def
-/L /lineto load def
-/T /translate load def
-/TMatrix { } def
-/RAngle { 0 } def
-/Sqrt { dup 0 lt { pop 0 } { sqrt } ifelse } def % return 0 for negative arguments
-/Atan { /atan load stopped { pop pop 0 } if } def % return 0 if atan not known
-/ATAN1 {neg -1 atan 180 sub } def % atan(x) (only one parameter)
-/Div { dup 0 eq { pop } { div } ifelse } def % control the division
-/NET { neg exch neg exch T } def % change coordinate system to the negative one
-/Pyth { dup mul exch dup mul add sqrt } def % Pythagoras, epects 2 parameter
-/PtoC { 2 copy cos mul 3 1 roll sin mul } def % Polar to Cartesian
-%----------------- hv added 20050516 ---------------
-/Pi 3.14159265359 def
-/TwoPi 6.28318530718 def
-/Euler 2.71828182846 def
-/RadtoDeg { 180 mul Pi div } bind def % convert from radian to degrees
-/DegtoRad { Pi mul 180 div } bind def % viceversa
-%----------------- hv end---------------------------
-/PathLength@ { /z z y y1 sub x x1 sub Pyth add def /y1 y def /x1 x def } def
-/PathLength { flattenpath /z 0 def
- { /y1 ED /x1 ED /y2 y1 def /x2 x1 def
- }{ /y ED /x ED PathLength@ } {} { /y y2 def /x x2 def PathLength@ }
- /pathforall load stopped { pop pop pop pop } if z } def
-/STP { .996264 dup scale } def
-/STV { SDict begin normalscale end STP } def
-%
-%%-------------- DG begin patch 15 ---------------%%
-%/DashLine { dup 0 gt { /a .5 def PathLength exch div } { pop /a 1 def
-%PathLength } ifelse /b ED /x ED /y ED /z y x add def b a .5 sub 2 mul y
-%mul sub z Div round z mul a .5 sub 2 mul y mul add b exch Div dup y mul
-%/y ED x mul /x ED x 0 gt y 0 gt and { [ y x ] 1 a sub y mul } { [ 1 0 ]
-%0 } ifelse setdash stroke } def
-/DashLine {
- dup 0 gt { /a .5 def PathLength exch div } { pop /a 1 def PathLength } ifelse
- /b ED /x1 ED /y1 ED /x ED /y ED
- /z y x add y1 add x1 add def
- /Coef b a .5 sub 2 mul y mul sub z Div round
- z mul a .5 sub 2 mul y mul add b exch Div def
- /y y Coef mul def
- /x x Coef mul def
- /y1 y1 Coef mul def
- /x1 x1 Coef mul def
- x1 0 gt y1 0 gt or x 0 gt or y 0 gt and
- { [ y x y1 x1 ] 1 a sub y mul }
- { [ 1 0 ] 0 } ifelse
- setdash stroke
-} def
-%%-------------- DG end patch 15 ---------------%%
-/DotLine {
- /b PathLength def
- /a ED /z ED /y CLW def
- /z y z add def
- a 0 gt {
- /b b a div def
- }{
- a 0 eq {
- /b b y sub def
- }{ a -3 eq {
- /b b y add def } if
- } ifelse
- } ifelse
- [ 0 b b z Div round Div dup 0 le { pop 1 } if ]
- a 0 gt { 0 }{ y 2 div a -2 gt { neg }if } ifelse
- setdash 1 setlinecap stroke
-} def
-%
-/LineFill { % hv ------------ patch 7 -------------
- gsave
- abs /hatchWidthInc ED
- abs /hatchSepInc ED
- abs CLW add /a ED
- a 0 dtransform round exch round exch
- 2 copy idtransform
- exch Atan rotate
- idtransform pop /a ED
- .25 .25 itransform pathbbox
- /y2 ED
- a Div ceiling cvi /x2 ED /y1 ED
- a Div cvi /x1 ED /y2 y2 y1 sub def
- clip
- newpath
- 2 setlinecap
- systemdict
- /setstrokeadjust known { true setstrokeadjust } if
- x2 x1 sub 1 add {
- x1 a mul y1 moveto 0 y2 rlineto stroke
- /x1 x1 1 add
- hatchWidthInc 0 gt { CLW add } if
- def
- hatchSepInc 0 gt hatchWidthInc 0 gt or {
- /a a hatchSepInc add def
- CLW hatchWidthInc add SLW
- } if
- } repeat
- grestore
- pop pop } def
-%
-%gsave abs CLW add /a ED a 0 dtransform round exch round exch
-%2 copy idtransform exch Atan rotate idtransform pop /a ED .25 .25
-%% DG/SR modification begin - Dec. 12, 1997 - Patch 2
-%%itransform translate pathbbox /y2 ED a Div ceiling cvi /x2 ED /y1 ED a
-%itransform pathbbox /y2 ED a Div ceiling cvi /x2 ED /y1 ED a
-%% DG/SR modification end
-%Div cvi /x1 ED /y2 y2 y1 sub def clip newpath 2 setlinecap systemdict
-%/setstrokeadjust known { true setstrokeadjust } if x2 x1 sub 1 add { x1
-%% DG/SR modification begin - Jun. 1, 1998 - Patch 3 (from Michael Vulis)
-%% a mul y1 moveto 0 y2 rlineto stroke /x1 x1 1 add def } repeat grestore }
-%% def
-%a mul y1 moveto 0 y2 rlineto stroke /x1 x1 1 add def } repeat grestore
-%pop pop } def
-%% DG/SR modification end
-%
-/BeginArrow { ADict begin /@mtrx CM def gsave 2 copy T 2 index sub neg
-exch 3 index sub exch Atan rotate newpath } def
-/EndArrow { @mtrx setmatrix CP grestore end } def
-/Arrow { CLW mul add dup 2 div /w ED mul dup /h ED mul /a ED { 0 h T 1 -1
-scale } if w neg h moveto 0 0 L w h L w neg a neg rlineto gsave fill
-grestore } def
-/Tbar { CLW mul add /z ED z -2 div CLW 2 div moveto z 0 rlineto stroke 0
-CLW moveto } def
-/Bracket { CLW mul add dup CLW sub 2 div /x ED mul CLW add /y ED /z CLW 2
-div def x neg y moveto x neg CLW 2 div L x CLW 2 div L x y L stroke 0
-CLW moveto } def
-/RoundBracket { CLW mul add dup 2 div /x ED mul /y ED /mtrx CM def 0 CLW
-2 div T x y mul 0 ne { x y scale } if 1 1 moveto .85 .5 .35 0 0 0
-curveto -.35 0 -.85 .5 -1 1 curveto mtrx setmatrix stroke 0 CLW moveto }
-def
-/SD { 0 360 arc fill } def
-/EndDot { % DS is the dot size
- { /z DS def } { /z 0 def } ifelse
- /b ED 0 z DS SD b { 0 z DS CLW sub SD } if
- 0 DS z add CLW 4 div sub moveto } def
-%
-/Shadow { [ { /moveto load } { /lineto load } { /curveto load } {
- /closepath load } /pathforall load stopped { pop pop pop pop CP /moveto
- load } if ] cvx newpath 3 1 roll T exec } def
-%
-/NArray { aload length 2 div dup dup cvi eq not { exch pop } if /n exch
-cvi def } def
-/NArray { % holds the coordinates and on top of stack the showpoints boolean
- /f ED
- counttomark 2 div dup cvi /n ED
- n eq not { exch pop } if
- f { ] aload /Points ED } { n 2 mul 1 add -1 roll pop } ifelse
-} def
-/Line {
- NArray n 0 eq not
- { n 1 eq { 0 0 /n 2 def } if ArrowA /n n 2 sub def
- n { Lineto } repeat
- CP 4 2 roll ArrowB L pop pop
- } if
-} def
-/Arcto { /a [ 6 -2 roll ] cvx def a r /arcto load stopped { 5 } { 4 }
- ifelse { pop } repeat a } def
-/CheckClosed { dup n 2 mul 1 sub index eq 2 index n 2 mul 1 add index eq
- and { pop pop /n n 1 sub def } if } def
-/Polygon { NArray n 2 eq { 0 0 /n 3 def } if n 3 lt { n { pop pop }
- repeat } { n 3 gt { CheckClosed } if n 2 mul -2 roll /y0 ED /x0 ED /y1
- ED /x1 ED x1 y1 /x1 x0 x1 add 2 div def /y1 y0 y1 add 2 div def x1 y1
- moveto /n n 2 sub def n { Lineto } repeat x1 y1 x0 y0 6 4 roll Lineto
- Lineto pop pop closepath } ifelse } def
-/Diamond {
- /mtrx CM def
- T rotate
- /h ED
- /w ED
- dup 0 eq { pop } { CLW mul neg
- /d ED
- /a w h Atan def
- /h d a sin Div h add def
- /w d a cos Div w add def } ifelse
- mark w 2 div h 2 div w 0 0 h neg w neg 0 0 h w 2 div h 2 div
- /ArrowA { moveto } def
- /ArrowB { } def
- false Line
- closepath mtrx setmatrix } def
-% DG modification begin - Jan. 15, 1997
-%/Triangle { /mtrx CM def translate rotate /h ED 2 div /w ED dup 0 eq {
-%pop } { CLW mul /d ED /h h d w h Atan sin Div sub def /w w d h w Atan 2
-%div dup cos exch sin Div mul sub def } ifelse mark 0 d w neg d 0 h w d 0
-%d /ArrowA { moveto } def /ArrowB { } def false Line closepath mtrx
-%setmatrix } def
-/Triangle { /mtrx CM def translate rotate /h ED 2 div /w ED dup
-CLW mul /d ED /h h d w h Atan sin Div sub def /w w d h w Atan 2
-div dup cos exch sin Div mul sub def mark 0 d w neg d 0 h w d 0
-d /ArrowA { moveto } def /ArrowB { } def false Line closepath mtrx
-% DG/SR modification begin - Jun. 1, 1998 - Patch 3 (from Michael Vulis)
-% setmatrix } def
-setmatrix pop } def
-% DG/SR modification end
-/CCA { /y ED /x ED 2 copy y sub /dy1 ED x sub /dx1 ED /l1 dx1 dy1 Pyth
-def } def
-/CCA { /y ED /x ED 2 copy y sub /dy1 ED x sub /dx1 ED /l1 dx1 dy1 Pyth
-def } def
-/CC { /l0 l1 def /x1 x dx sub def /y1 y dy sub def /dx0 dx1 def /dy0 dy1
-def CCA /dx dx0 l1 c exp mul dx1 l0 c exp mul add def /dy dy0 l1 c exp
-mul dy1 l0 c exp mul add def /m dx0 dy0 Atan dx1 dy1 Atan sub 2 div cos
-abs b exp a mul dx dy Pyth Div 2 div def /x2 x l0 dx mul m mul sub def
-/y2 y l0 dy mul m mul sub def /dx l1 dx mul m mul neg def /dy l1 dy mul
-m mul neg def } def
-/IC { /c c 1 add def c 0 lt { /c 0 def } { c 3 gt { /c 3 def } if }
-ifelse /a a 2 mul 3 div 45 cos b exp div def CCA /dx 0 def /dy 0 def }
-def
-/BOC { IC CC x2 y2 x1 y1 ArrowA CP 4 2 roll x y curveto } def
-/NC { CC x1 y1 x2 y2 x y curveto } def
-/EOC { x dx sub y dy sub 4 2 roll ArrowB 2 copy curveto } def
-/BAC { IC CC x y moveto CC x1 y1 CP ArrowA } def
-/NAC { x2 y2 x y curveto CC x1 y1 } def
-/EAC { x2 y2 x y ArrowB curveto pop pop } def
-/OpenCurve {
- NArray n 3 lt
- { n { pop pop } repeat }
- { BOC /n n 3 sub def n { NC } repeat EOC } ifelse
-} def
-/AltCurve { { false NArray n 2 mul 2 roll [ n 2 mul 3 sub 1 roll ] aload
-/Points ED n 2 mul -2 roll } { false NArray } ifelse n 4 lt { n { pop
-pop } repeat } { BAC /n n 4 sub def n { NAC } repeat EAC } ifelse } def
-/ClosedCurve { NArray n 3 lt { n { pop pop } repeat } { n 3 gt {
-CheckClosed } if 6 copy n 2 mul 6 add 6 roll IC CC x y moveto n { NC }
-repeat closepath pop pop } ifelse } def
-/SQ { /r ED r r moveto r r neg L r neg r neg L r neg r L fill } def
-/ST { /y ED /x ED x y moveto x neg y L 0 x L fill } def
-/SP { /r ED gsave 0 r moveto 4 { 72 rotate 0 r L } repeat fill grestore }
-def
-/FontDot { DS 2 mul dup matrix scale matrix concatmatrix exch matrix
-rotate matrix concatmatrix exch findfont exch makefont setfont } def
-/Rect { x1 y1 y2 add 2 div moveto x1 y2 lineto x2 y2 lineto x2 y1 lineto
-x1 y1 lineto closepath } def
-/OvalFrame { x1 x2 eq y1 y2 eq or { pop pop x1 y1 moveto x2 y2 L } { y1
-y2 sub abs x1 x2 sub abs 2 copy gt { exch pop } { pop } ifelse 2 div
-exch { dup 3 1 roll mul exch } if 2 copy lt { pop } { exch pop } ifelse
-/b ED x1 y1 y2 add 2 div moveto x1 y2 x2 y2 b arcto x2 y2 x2 y1 b arcto
-x2 y1 x1 y1 b arcto x1 y1 x1 y2 b arcto 16 { pop } repeat closepath }
-ifelse } def
-/Frame { CLW mul /a ED 3 -1 roll 2 copy gt { exch } if a sub /y2 ED a add
-/y1 ED 2 copy gt { exch } if a sub /x2 ED a add /x1 ED 1 index 0 eq {
-pop pop Rect } { OvalFrame } ifelse } def
-/BezierNArray { /f ED counttomark 2 div dup cvi /n ED n eq not { exch pop
-} if n 1 sub neg 3 mod 3 add 3 mod { 0 0 /n n 1 add def } repeat f { ]
-aload /Points ED } { n 2 mul 1 add -1 roll pop } ifelse } def
-/OpenBezier { BezierNArray n 1 eq { pop pop } { ArrowA n 4 sub 3 idiv { 6
-2 roll 4 2 roll curveto } repeat 6 2 roll 4 2 roll ArrowB curveto }
-ifelse } def
-/ClosedBezier { BezierNArray n 1 eq { pop pop } { moveto n 1 sub 3 idiv {
-6 2 roll 4 2 roll curveto } repeat closepath } ifelse } def
-/BezierShowPoints { gsave Points aload length 2 div cvi /n ED moveto n 1
-sub { lineto } repeat CLW 2 div SLW [ 4 4 ] 0 setdash stroke grestore }
-def
-/Parab { /y0 exch def /x0 exch def /y1 exch def /x1 exch def /dx x0 x1
-sub 3 div def /dy y0 y1 sub 3 div def x0 dx sub y0 dy add x1 y1 ArrowA
-x0 dx add y0 dy add x0 2 mul x1 sub y1 ArrowB curveto /Points [ x1 y1 x0
-y0 x0 2 mul x1 sub y1 ] def } def
-/Grid { newpath /a 4 string def /b ED /c ED /n ED cvi dup 1 lt { pop 1 }
-if /s ED s div dup 0 eq { pop 1 } if /dy ED s div dup 0 eq { pop 1 } if
-/dx ED dy div round dy mul /y0 ED dx div round dx mul /x0 ED dy div
-round cvi /y2 ED dx div round cvi /x2 ED dy div round cvi /y1 ED dx div
-round cvi /x1 ED /h y2 y1 sub 0 gt { 1 } { -1 } ifelse def /w x2 x1 sub
-0 gt { 1 } { -1 } ifelse def b 0 gt { /z1 b 4 div CLW 2 div add def
-/Helvetica findfont b scalefont setfont /b b .95 mul CLW 2 div add def }
-if systemdict /setstrokeadjust known { true setstrokeadjust /t { } def }
-{ /t { transform 0.25 sub round 0.25 add exch 0.25 sub round 0.25 add
-exch itransform } bind def } ifelse gsave n 0 gt { 1 setlinecap [ 0 dy n
-div ] dy n div 2 div setdash } { 2 setlinecap } ifelse /i x1 def /f y1
-dy mul n 0 gt { dy n div 2 div h mul sub } if def /g y2 dy mul n 0 gt {
-dy n div 2 div h mul add } if def x2 x1 sub w mul 1 add dup 1000 gt {
-pop 1000 } if { i dx mul dup y0 moveto b 0 gt { gsave c i a cvs dup
-stringwidth pop /z2 ED w 0 gt {z1} {z1 z2 add neg} ifelse h 0 gt {b neg}
-{z1} ifelse rmoveto show grestore } if dup t f moveto g t L stroke /i i
-w add def } repeat grestore gsave n 0 gt
-% DG/SR modification begin - Nov. 7, 1997 - Patch 1
-%{ 1 setlinecap [ 0 dx n div ] dy n div 2 div setdash }
-{ 1 setlinecap [ 0 dx n div ] dx n div 2 div setdash }
-% DG/SR modification end
-{ 2 setlinecap } ifelse /i y1 def /f x1 dx mul
-n 0 gt { dx n div 2 div w mul sub } if def /g x2 dx mul n 0 gt { dx n
-div 2 div w mul add } if def y2 y1 sub h mul 1 add dup 1000 gt { pop
-1000 } if { newpath i dy mul dup x0 exch moveto b 0 gt { gsave c i a cvs
-dup stringwidth pop /z2 ED w 0 gt {z1 z2 add neg} {z1} ifelse h 0 gt
-{z1} {b neg} ifelse rmoveto show grestore } if dup f exch t moveto g
-exch t L stroke /i i h add def } repeat grestore } def
-/ArcArrow { /d ED /b ED /a ED gsave newpath 0 -1000 moveto clip newpath 0
-1 0 0 b grestore c mul /e ED pop pop pop r a e d PtoC y add exch x add
-exch r a PtoC y add exch x add exch b pop pop pop pop a e d CLW 8 div c
-mul neg d } def
-/Ellipse { /mtrx CM def T scale 0 0 1 5 3 roll arc mtrx setmatrix } def
-%
-/ArcAdjust { %%%% Vincent Guirardel
-% given a target length (targetLength) and an initial angle (angle0) [in the stack],
-% let M(angle0)=(rx*cos(angle0),ry*sin(angle0))=(x0,y0).
-% This computes an angle t such that (x0,y0) is at distance
-% targetLength from the point M(t)=(rx*cos(t),ry*sin(t)).
-% NOTE: this an absolute angle, it does not have to be added or substracted to angle0
-% contrary to TvZ's code.
-% To achieve, this, one iterates the following process: start with some angle t,
-% compute the point M' at distance targetLength of (x0,y0) on the semi-line [(x0,y0) M(t)].
-% Now take t' (= new angle) so that (0,0) M(t') and M' are aligned.
-%
-% Another difference with TvZ's code is that we need d (=add/sub) to be defined.
-% the value of d = add/sub is used to know on which side we have to move.
-% It is only used in the initialisation of the angle before the iteration.
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% Input stack: 1: target length 2: initial angle
-% variables used : rx, ry, d (=add/sub)
-%
- /targetLength ED /angle0 ED
- /x0 rx angle0 cos mul def
- /y0 ry angle0 sin mul def
-% we are looking for an angle t such that (x0,y0) is at distance targetLength
-% from the point M(t)=(rx*cos(t),ry*sin(t)))
-%initialisation of angle (using 1st order approx = TvZ's code)
- targetLength 57.2958 mul
- angle0 sin rx mul dup mul
- angle0 cos ry mul dup mul
- add sqrt div
-% if initialisation angle is two large (more than 90 degrees) set it to 90 degrees
-% (if the ellipse is very curved at the point where we draw the arrow, %
-% the value can be much more than 360 degrees !)
-% this should avoid going on the wrong side (more than 180 degrees) or go near
-% a bad attractive point (at 180 degrees)
- dup 90 ge { pop 90 } if
- angle0 exch d % add or sub
-% maximum number of times to iterate the iterative procedure:
-% iterative procedure: takes an angle t on top of stack, computes a
-% better angle (and put it on top of stack)
- 30 { dup
-% compute distance D between (x0,y0) and M(t)
- dup cos rx mul x0 sub dup mul exch sin ry mul y0 sub dup mul add sqrt
-% if D almost equals targetLength, we stop
- dup targetLength sub abs 1e-5 le { pop exit } if
-% stack now contains D t
-% compute the point M(t') at distance targetLength of (x0,y0) on the semi-line [(x0,y0) M(t)]:
-% M(t')= ( (x(t)-x0)*targetLength/d+x0 , (y(t)-y0)*targetLength/d+y0 )
- exch dup cos rx mul x0 sub exch sin ry mul y0 sub
-% stack contains: y(t)-y0, x(t)-x0, d
- 2 index Div targetLength mul y0 add ry Div exch
- 2 index Div targetLength mul x0 add rx Div
-% stack contains x(t')/rx , y(t')/ry , d
-% now compute t', and remove D from stack
- atan exch pop
- } repeat
-% we don't look at what happened... in particular, if targetLength is greater
-% than the diameter of the ellipse...
-% the final angle will be around /angle0 + 180. maybe we should treat this pathological case...
-% after iteration, stack contains an angle t such that M(t) is the tail of the arrow
-% to give back the result as a an angle relative to angle0 we could add the following line:
-% angle0 sub 0 exch d
-%
-% begin bug fix 2006-01-11
-% we want to adjust the new angle t' by a multiple of 360 so that | t'-angle0 | <= 180
-%(we don't want to make the ellipse turn more or less than it should)...
-dup angle0 sub dup abs 180 gt { 180 add 360 div floor 360 mul sub } { pop } ifelse
-% end bug fix
-} def
-%
-/EllipticArcArrow {
- /d ED % add/sub
- /b ED % arrow procedure
- /a1 ED % angle
- gsave
- newpath
- 0 -1000 moveto
- clip % Set clippath far from arrow.
- newpath
- 0 1 0 0 b % Draw arrow to determine length.
- grestore
-% Length of arrow is on top of stack. Next 3 numbers are junk.
-%
- a1 exch ArcAdjust % Angular position of base of arrow.
- /a2 ED
- pop pop pop
- a2 cos rx mul x add
- a2 sin ry mul y add
- a1 cos rx mul x add
- a1 sin ry mul y add
-% Now arrow tip coor and base coor are on stack.
- b pop pop pop pop % Draw arrow, and discard coordinates.
- a2 CLW 8 div
-% change value of d (test it by looking if `` 1 1 d '' gives 2 or not )
- 1 1 d 2 eq { /d { sub } def } { /d { add } def } ifelse
- ArcAdjust
-% resets original value of d
- 1 1 d 2 eq { /d { sub } def } { /d { add } def } ifelse % Adjust angle to give overlap.
-} def
-%%------------------ tvz/DG/hv (2004-05-10) end -------------------%%
-%
-/Rot { CP CP translate 3 -1 roll neg rotate NET } def
-/RotBegin { tx@Dict /TMatrix known not { /TMatrix { } def /RAngle { 0 }
-def } if /TMatrix [ TMatrix CM ] cvx def /a ED a Rot /RAngle [ RAngle
-dup a add ] cvx def } def
-/RotEnd { /TMatrix [ TMatrix setmatrix ] cvx def /RAngle [ RAngle pop ]
-cvx def } def
-/PutCoor { gsave CP T CM STV exch exec moveto setmatrix CP grestore } def
-/PutBegin { /TMatrix [ TMatrix CM ] cvx def CP 4 2 roll T moveto } def
-/PutEnd { CP /TMatrix [ TMatrix setmatrix ] cvx def moveto } def
-/Uput { /a ED add 2 div /h ED 2 div /w ED /s a sin def /c a cos def /b s
-abs c abs 2 copy gt dup /q ED { pop } { exch pop } ifelse def /w1 c b
-div w mul def /h1 s b div h mul def q { w1 abs w sub dup c mul abs } {
-h1 abs h sub dup s mul abs } ifelse } def
-/UUput { /z ED abs /y ED /x ED q { x s div c mul abs y gt } { x c div s
-mul abs y gt } ifelse { x x mul y y mul sub z z mul add sqrt z add } { q
-{ x s div } { x c div } ifelse abs } ifelse a PtoC h1 add exch w1 add
-exch } def
-/BeginOL { dup (all) eq exch TheOL eq or { IfVisible not { Visible
-/IfVisible true def } if } { IfVisible { Invisible /IfVisible false def
-} if } ifelse } def
-/InitOL { /OLUnit [ 3000 3000 matrix defaultmatrix dtransform ] cvx def
-/Visible { CP OLUnit idtransform T moveto } def /Invisible { CP OLUnit
-neg exch neg exch idtransform T moveto } def /BOL { BeginOL } def
-/IfVisible true def } def
-end
-% END pstricks.pro
-
-%%EndProcSet
-%%BeginProcSet: pst-dots.pro 0 0
-%!
-%% PostScript prologue for pstricks.tex.
-%% Version 2.00, Suggestion of 2006/12/19
-%% For distribution, see pstricks.tex.
-%%
-%% Timothy Van Zandt <tvz@Princeton.EDU>
-%%
-%% Modified by Etienne Riga - Dec. 16, 1999
-%% Modified by Herbert Voss (hv) - 2004/12/27
-%% Modified by Etienne Riga - 2005/01/01 (er)
-%% to add /Diamond, /SolidDiamond and /BoldDiamond
-%
-10 dict dup begin
- /FontType 3 def
- /FontMatrix [.001 0 0 .001 0 0] def
- /FontBBox [-571.5 -742.5 571.5 742.5] def
-% /FontBBox [-1000 -1000 1000 1000] def
-% See end of file in /BuildGlyph
- /Encoding 256 array def
- 0 1 255 {Encoding exch/.notdef put} for
- Encoding
- dup (b) 0 get /Bullet put
- dup (c) 0 get /Circle put
- dup (C) 0 get /BoldCircle put
- dup (u) 0 get /SolidTriangle put
- dup (t) 0 get /Triangle put
- dup (T) 0 get /BoldTriangle put
- dup (r) 0 get /SolidSquare put
- dup (s) 0 get /Square put
- dup (S) 0 get /BoldSquare put
- dup (q) 0 get /SolidPentagon put
- dup (p) 0 get /Pentagon put
- dup (P) 0 get /BoldPentagon put
-%%%
- dup (k) 0 get /Asterisk put
- dup (K) 0 get /BoldAsterisk put
- dup (J) 0 get /SolidAsterisk put
- dup (h) 0 get /Hexagon put
- dup (H) 0 get /BoldHexagon put
- dup (G) 0 get /SolidHexagon put
- dup (a) 0 get /Add put
- dup (A) 0 get /BoldAdd put
- dup (x) 0 get /Mul put
- dup (X) 0 get /BoldMul put
- dup (m) 0 get /Oplus put
- dup (M) 0 get /BOplus put
- dup (e) 0 get /SolidOplus put
- dup (n) 0 get /Otimes put
- dup (N) 0 get /BOtimes put
- dup (E) 0 get /SolidOtimes put
- dup (i) 0 get /Bar put
- dup (I) 0 get /BoldBar put
- dup (l) 0 get /SolidDiamond put
- dup (d) 0 get /Diamond put
- (D) 0 get /BoldDiamond put
-%%%
-/CharProcs 47 dict def
- CharProcs begin
- /CirclePath {0 0 500 0 360 arc closepath} def
- /Bullet {CirclePath fill} def
- /Circle {CirclePath .9 .9 scale CirclePath eofill} def
- /BoldCircle {CirclePath .8 .8 scale CirclePath eofill} def
- /TrianglePath {0 660 moveto -571.5 -330 lineto 571.5 -330 lineto
- closepath} def
- /SolidTriangle {TrianglePath fill} def
- /Triangle {TrianglePath .85 .85 scale TrianglePath eofill} def
- /BoldTriangle {TrianglePath .7 .7 scale TrianglePath eofill} def
- /SquarePath {-450 450 moveto 450 450 lineto 450 -450 lineto -450 -450 lineto
- closepath} def
- /SolidSquare {SquarePath fill} def
- /Square {SquarePath .89 .89 scale SquarePath eofill} def
- /BoldSquare {SquarePath .78 .78 scale SquarePath eofill} def
- /PentagonPath {-337.8 -465 moveto 337.8 -465 lineto 546.6 177.6 lineto
- 0 574.7 lineto -546.6 177.6 lineto closepath} def
- /SolidPentagon {PentagonPath fill} def
- /Pentagon {PentagonPath .89 .89 scale PentagonPath eofill} def
- /BoldPentagon {PentagonPath .78 .78 scale PentagonPath eofill} def
-%-------------- hv begin 2004/07/25 from: er 2003/03/24
- /HexagonPath {0 550 moveto -476 275 lineto -476 -275 lineto
- 0 -550 lineto 476 -275 lineto 476 275 lineto closepath} def
- /SolidHexagon {HexagonPath fill} def
- /Hexagon {HexagonPath .89 .89 scale HexagonPath eofill} def
- /BoldHexagon {HexagonPath .79 .79 scale HexagonPath eofill} def
- /AsteriskPath {20 0 moveto 10 250 180 500 0 500 curveto
- -180 500 -10 250 -20 0 curveto closepath} def
- /Asterisk {AsteriskPath 60 rotate AsteriskPath 60 rotate AsteriskPath
- 60 rotate AsteriskPath 60 rotate AsteriskPath 60 rotate AsteriskPath
- fill} def
- /Basterp {50 250 220 500 0 500 curveto
- -220 500 -50 250 -50 30 cos 100 mul curveto} def
- /BoldAsteriskPath {50 30 cos 100 mul moveto Basterp
- 60 rotate Basterp 60 rotate Basterp
- 60 rotate Basterp 60 rotate Basterp
- 60 rotate Basterp closepath} def
- /BoldAsterisk {BoldAsteriskPath fill} def
- /SolidAsterisk {CirclePath .9 .9 scale BoldAsteriskPath eofill} def
- /CrossPath {40 550 moveto -40 550 lineto -40 40 lineto -550 40 lineto
- -550 -40 lineto -40 -40 lineto -40 -550 lineto 40 -550 lineto
- 40 -40 lineto 550 -40 lineto 550 40 lineto 40 40 lineto closepath} def
- /BoldCrossPath {80 550 moveto -80 550 lineto -80 80 lineto -550 80 lineto
- -550 -80 lineto -80 -80 lineto -80 -550 lineto 80 -550 lineto
- 80 -80 lineto 550 -80 lineto 550 80 lineto 80 80 lineto closepath} def
- /Add {CrossPath fill} def
- /Mul {45 rotate CrossPath fill} def
- /BoldAdd {BoldCrossPath fill} def
- /BoldMul {45 rotate BoldCrossPath fill} def
- /Oplus {CirclePath .9 .9 scale CirclePath eofill
- .775 .775 scale CrossPath fill} def
- /SolidOplus {CirclePath .775 .775 scale BoldCrossPath eofill} def
- /BOplus {CirclePath .8 .8 scale CirclePath eofill
- .775 .775 scale BoldCrossPath fill} def
- /Otimes {CirclePath .9 .9 scale CirclePath eofill
- 45 rotate .775 .775 scale CrossPath fill} def
- /BOtimes {CirclePath .8 .8 scale CirclePath eofill
- 45 rotate .775 .775 scale BoldCrossPath fill } def
- /SolidOtimes {CirclePath 45 rotate .775 .775 scale BoldCrossPath eofill} def
- /BarPath {40 660 moveto -40 660 lineto -40 -660 lineto 40 -660 lineto
- closepath} def
- /Bar {BarPath fill} def
- /BoldBarPath {80 660 moveto -80 660 lineto -80 -660 lineto 80 -660 lineto
- closepath} def
- /BoldBar {BoldBarPath fill} def
- /DiamondPath {0 742.5 moveto -428.5 0 lineto 0 -742.5 lineto
- 428.5 0 lineto closepath} def
- /SolidDiamond {DiamondPath fill} def
- /Diamond {DiamondPath .865 .865 scale DiamondPath eofill} def
- /BoldDiamond {DiamondPath .73 .73 scale DiamondPath eofill} def
-%%%
- /.notdef { } def
- end
- /BuildGlyph {
- exch
- begin
-% Metrics 1 index get exec 0
- 0 0
-% BBoxes 3 index get exec
- -1000 -1000 1000 1000
-% -571.5 -742.5 571.5 742.5
- setcachedevice
- CharProcs begin load exec end
- end
- } def
- /BuildChar {
- 1 index /Encoding get exch get
- 1 index /BuildGlyph get exec
- } bind def
-end
-/PSTricksDotFont exch definefont pop
-
-
-%%EndProcSet
-%%BeginProcSet: texps.pro 0 0
-%!
-TeXDict begin/rf{findfont dup length 1 add dict begin{1 index/FID ne 2
-index/UniqueID ne and{def}{pop pop}ifelse}forall[1 index 0 6 -1 roll
-exec 0 exch 5 -1 roll VResolution Resolution div mul neg 0 0]/Metrics
-exch def dict begin Encoding{exch dup type/integertype ne{pop pop 1 sub
-dup 0 le{pop}{[}ifelse}{FontMatrix 0 get div Metrics 0 get div def}
-ifelse}forall Metrics/Metrics currentdict end def[2 index currentdict
-end definefont 3 -1 roll makefont/setfont cvx]cvx def}def/ObliqueSlant{
-dup sin S cos div neg}B/SlantFont{4 index mul add}def/ExtendFont{3 -1
-roll mul exch}def/ReEncodeFont{CharStrings rcheck{/Encoding false def
-dup[exch{dup CharStrings exch known not{pop/.notdef/Encoding true def}
-if}forall Encoding{]exch pop}{cleartomark}ifelse}if/Encoding exch def}
-def end
-
-%%EndProcSet
-%%BeginProcSet: special.pro 0 0
-%!
-TeXDict begin/SDict 200 dict N SDict begin/@SpecialDefaults{/hs 612 N
-/vs 792 N/ho 0 N/vo 0 N/hsc 1 N/vsc 1 N/ang 0 N/CLIP 0 N/rwiSeen false N
-/rhiSeen false N/letter{}N/note{}N/a4{}N/legal{}N}B/@scaleunit 100 N
-/@hscale{@scaleunit div/hsc X}B/@vscale{@scaleunit div/vsc X}B/@hsize{
-/hs X/CLIP 1 N}B/@vsize{/vs X/CLIP 1 N}B/@clip{/CLIP 2 N}B/@hoffset{/ho
-X}B/@voffset{/vo X}B/@angle{/ang X}B/@rwi{10 div/rwi X/rwiSeen true N}B
-/@rhi{10 div/rhi X/rhiSeen true N}B/@llx{/llx X}B/@lly{/lly X}B/@urx{
-/urx X}B/@ury{/ury X}B/magscale true def end/@MacSetUp{userdict/md known
-{userdict/md get type/dicttype eq{userdict begin md length 10 add md
-maxlength ge{/md md dup length 20 add dict copy def}if end md begin
-/letter{}N/note{}N/legal{}N/od{txpose 1 0 mtx defaultmatrix dtransform S
-atan/pa X newpath clippath mark{transform{itransform moveto}}{transform{
-itransform lineto}}{6 -2 roll transform 6 -2 roll transform 6 -2 roll
-transform{itransform 6 2 roll itransform 6 2 roll itransform 6 2 roll
-curveto}}{{closepath}}pathforall newpath counttomark array astore/gc xdf
-pop ct 39 0 put 10 fz 0 fs 2 F/|______Courier fnt invertflag{PaintBlack}
-if}N/txpose{pxs pys scale ppr aload pop por{noflips{pop S neg S TR pop 1
--1 scale}if xflip yflip and{pop S neg S TR 180 rotate 1 -1 scale ppr 3
-get ppr 1 get neg sub neg ppr 2 get ppr 0 get neg sub neg TR}if xflip
-yflip not and{pop S neg S TR pop 180 rotate ppr 3 get ppr 1 get neg sub
-neg 0 TR}if yflip xflip not and{ppr 1 get neg ppr 0 get neg TR}if}{
-noflips{TR pop pop 270 rotate 1 -1 scale}if xflip yflip and{TR pop pop
-90 rotate 1 -1 scale ppr 3 get ppr 1 get neg sub neg ppr 2 get ppr 0 get
-neg sub neg TR}if xflip yflip not and{TR pop pop 90 rotate ppr 3 get ppr
-1 get neg sub neg 0 TR}if yflip xflip not and{TR pop pop 270 rotate ppr
-2 get ppr 0 get neg sub neg 0 S TR}if}ifelse scaleby96{ppr aload pop 4
--1 roll add 2 div 3 1 roll add 2 div 2 copy TR .96 dup scale neg S neg S
-TR}if}N/cp{pop pop showpage pm restore}N end}if}if}N/normalscale{
-Resolution 72 div VResolution 72 div neg scale magscale{DVImag dup scale
-}if 0 setgray}N/psfts{S 65781.76 div N}N/startTexFig{/psf$SavedState
-save N userdict maxlength dict begin/magscale true def normalscale
-currentpoint TR/psf$ury psfts/psf$urx psfts/psf$lly psfts/psf$llx psfts
-/psf$y psfts/psf$x psfts currentpoint/psf$cy X/psf$cx X/psf$sx psf$x
-psf$urx psf$llx sub div N/psf$sy psf$y psf$ury psf$lly sub div N psf$sx
-psf$sy scale psf$cx psf$sx div psf$llx sub psf$cy psf$sy div psf$ury sub
-TR/showpage{}N/erasepage{}N/copypage{}N/p 3 def @MacSetUp}N/doclip{
-psf$llx psf$lly psf$urx psf$ury currentpoint 6 2 roll newpath 4 copy 4 2
-roll moveto 6 -1 roll S lineto S lineto S lineto closepath clip newpath
-moveto}N/endTexFig{end psf$SavedState restore}N/@beginspecial{SDict
-begin/SpecialSave save N gsave normalscale currentpoint TR
-@SpecialDefaults count/ocount X/dcount countdictstack N}N/@setspecial{
-CLIP 1 eq{newpath 0 0 moveto hs 0 rlineto 0 vs rlineto hs neg 0 rlineto
-closepath clip}if ho vo TR hsc vsc scale ang rotate rwiSeen{rwi urx llx
-sub div rhiSeen{rhi ury lly sub div}{dup}ifelse scale llx neg lly neg TR
-}{rhiSeen{rhi ury lly sub div dup scale llx neg lly neg TR}if}ifelse
-CLIP 2 eq{newpath llx lly moveto urx lly lineto urx ury lineto llx ury
-lineto closepath clip}if/showpage{}N/erasepage{}N/copypage{}N newpath}N
-/@endspecial{count ocount sub{pop}repeat countdictstack dcount sub{end}
-repeat grestore SpecialSave restore end}N/@defspecial{SDict begin}N
-/@fedspecial{end}B/li{lineto}B/rl{rlineto}B/rc{rcurveto}B/np{/SaveX
-currentpoint/SaveY X N 1 setlinecap newpath}N/st{stroke SaveX SaveY
-moveto}N/fil{fill SaveX SaveY moveto}N/ellipse{/endangle X/startangle X
-/yrad X/xrad X/savematrix matrix currentmatrix N TR xrad yrad scale 0 0
-1 startangle endangle arc savematrix setmatrix}N end
-
-%%EndProcSet
-%%BeginProcSet: color.pro 0 0
-%!
-TeXDict begin/setcmykcolor where{pop}{/setcmykcolor{dup 10 eq{pop
-setrgbcolor}{1 sub 4 1 roll 3{3 index add neg dup 0 lt{pop 0}if 3 1 roll
-}repeat setrgbcolor pop}ifelse}B}ifelse/TeXcolorcmyk{setcmykcolor}def
-/TeXcolorrgb{setrgbcolor}def/TeXcolorgrey{setgray}def/TeXcolorgray{
-setgray}def/TeXcolorhsb{sethsbcolor}def/currentcmykcolor where{pop}{
-/currentcmykcolor{currentrgbcolor 10}B}ifelse/DC{exch dup userdict exch
-known{pop pop}{X}ifelse}B/GreenYellow{0.15 0 0.69 0 setcmykcolor}DC
-/Yellow{0 0 1 0 setcmykcolor}DC/Goldenrod{0 0.10 0.84 0 setcmykcolor}DC
-/Dandelion{0 0.29 0.84 0 setcmykcolor}DC/Apricot{0 0.32 0.52 0
-setcmykcolor}DC/Peach{0 0.50 0.70 0 setcmykcolor}DC/Melon{0 0.46 0.50 0
-setcmykcolor}DC/YellowOrange{0 0.42 1 0 setcmykcolor}DC/Orange{0 0.61
-0.87 0 setcmykcolor}DC/BurntOrange{0 0.51 1 0 setcmykcolor}DC
-/Bittersweet{0 0.75 1 0.24 setcmykcolor}DC/RedOrange{0 0.77 0.87 0
-setcmykcolor}DC/Mahogany{0 0.85 0.87 0.35 setcmykcolor}DC/Maroon{0 0.87
-0.68 0.32 setcmykcolor}DC/BrickRed{0 0.89 0.94 0.28 setcmykcolor}DC/Red{
-0 1 1 0 setcmykcolor}DC/OrangeRed{0 1 0.50 0 setcmykcolor}DC/RubineRed{
-0 1 0.13 0 setcmykcolor}DC/WildStrawberry{0 0.96 0.39 0 setcmykcolor}DC
-/Salmon{0 0.53 0.38 0 setcmykcolor}DC/CarnationPink{0 0.63 0 0
-setcmykcolor}DC/Magenta{0 1 0 0 setcmykcolor}DC/VioletRed{0 0.81 0 0
-setcmykcolor}DC/Rhodamine{0 0.82 0 0 setcmykcolor}DC/Mulberry{0.34 0.90
-0 0.02 setcmykcolor}DC/RedViolet{0.07 0.90 0 0.34 setcmykcolor}DC
-/Fuchsia{0.47 0.91 0 0.08 setcmykcolor}DC/Lavender{0 0.48 0 0
-setcmykcolor}DC/Thistle{0.12 0.59 0 0 setcmykcolor}DC/Orchid{0.32 0.64 0
-0 setcmykcolor}DC/DarkOrchid{0.40 0.80 0.20 0 setcmykcolor}DC/Purple{
-0.45 0.86 0 0 setcmykcolor}DC/Plum{0.50 1 0 0 setcmykcolor}DC/Violet{
-0.79 0.88 0 0 setcmykcolor}DC/RoyalPurple{0.75 0.90 0 0 setcmykcolor}DC
-/BlueViolet{0.86 0.91 0 0.04 setcmykcolor}DC/Periwinkle{0.57 0.55 0 0
-setcmykcolor}DC/CadetBlue{0.62 0.57 0.23 0 setcmykcolor}DC
-/CornflowerBlue{0.65 0.13 0 0 setcmykcolor}DC/MidnightBlue{0.98 0.13 0
-0.43 setcmykcolor}DC/NavyBlue{0.94 0.54 0 0 setcmykcolor}DC/RoyalBlue{1
-0.50 0 0 setcmykcolor}DC/Blue{1 1 0 0 setcmykcolor}DC/Cerulean{0.94 0.11
-0 0 setcmykcolor}DC/Cyan{1 0 0 0 setcmykcolor}DC/ProcessBlue{0.96 0 0 0
-setcmykcolor}DC/SkyBlue{0.62 0 0.12 0 setcmykcolor}DC/Turquoise{0.85 0
-0.20 0 setcmykcolor}DC/TealBlue{0.86 0 0.34 0.02 setcmykcolor}DC
-/Aquamarine{0.82 0 0.30 0 setcmykcolor}DC/BlueGreen{0.85 0 0.33 0
-setcmykcolor}DC/Emerald{1 0 0.50 0 setcmykcolor}DC/JungleGreen{0.99 0
-0.52 0 setcmykcolor}DC/SeaGreen{0.69 0 0.50 0 setcmykcolor}DC/Green{1 0
-1 0 setcmykcolor}DC/ForestGreen{0.91 0 0.88 0.12 setcmykcolor}DC
-/PineGreen{0.92 0 0.59 0.25 setcmykcolor}DC/LimeGreen{0.50 0 1 0
-setcmykcolor}DC/YellowGreen{0.44 0 0.74 0 setcmykcolor}DC/SpringGreen{
-0.26 0 0.76 0 setcmykcolor}DC/OliveGreen{0.64 0 0.95 0.40 setcmykcolor}
-DC/RawSienna{0 0.72 1 0.45 setcmykcolor}DC/Sepia{0 0.83 1 0.70
-setcmykcolor}DC/Brown{0 0.81 1 0.60 setcmykcolor}DC/Tan{0.14 0.42 0.56 0
-setcmykcolor}DC/Gray{0 0 0 0.50 setcmykcolor}DC/Black{0 0 0 1
-setcmykcolor}DC/White{0 0 0 0 setcmykcolor}DC end
-
-%%EndProcSet
-%%BeginFont: CMR12
-%!PS-AdobeFont-1.1: CMR12 1.0
-%%CreationDate: 1991 Aug 20 16:38:05
-% Copyright (C) 1997 American Mathematical Society. All Rights Reserved.
-11 dict begin
-/FontInfo 7 dict dup begin
-/version (1.0) readonly def
-/Notice (Copyright (C) 1997 American Mathematical Society. All Rights Reserved) readonly def
-/FullName (CMR12) readonly def
-/FamilyName (Computer Modern) readonly def
-/Weight (Medium) readonly def
-/ItalicAngle 0 def
-/isFixedPitch false def
-end readonly def
-/FontName /CMR12 def
-/PaintType 0 def
-/FontType 1 def
-/FontMatrix [0.001 0 0 0.001 0 0] readonly def
-/Encoding 256 array
-0 1 255 {1 index exch /.notdef put} for
-dup 49 /one put
-readonly def
-/FontBBox{-34 -251 988 750}readonly def
-currentdict end
-currentfile eexec
-D9D66F633B846A97B686A97E45A3D0AA052A014267B7904EB3C0D3BD0B83D891
-016CA6CA4B712ADEB258FAAB9A130EE605E61F77FC1B738ABC7C51CD46EF8171
-9098D5FEE67660E69A7AB91B58F29A4D79E57022F783EB0FBBB6D4F4EC35014F
-D2DECBA99459A4C59DF0C6EBA150284454E707DC2100C15B76B4C19B84363758
-469A6C558785B226332152109871A9883487DD7710949204DDCF837E6A8708B8
-2BDBF16FBC7512FAA308A093FE5CF4E9D2405B169CD5365D6ECED5D768D66D6C
-68618B8C482B341F8CA38E9BB9BAFCFAAD9C2F3FD033B62690986ED43D9C9361
-3645B82392D5CAE11A7CB49D7E2E82DCD485CBA04C77322EB2E6A79D73DC194E
-59C120A2DABB9BF72E2CF256DD6EB54EECBA588101ABD933B57CE8A3A0D16B28
-51D7494F73096DF53BDC66BBF896B587DF9643317D5F610CD9088F9849126F23
-DDE030F7B277DD99055C8B119CAE9C99158AC4E150CDFC2C66ED92EBB4CC092A
-AA078CE16247A1335AD332DAA950D20395A7384C33FF72EAA31A5B89766E635F
-45C4C068AD7EE867398F0381B07CB94D29FF097D59FF9961D195A948E3D87C31
-821E9295A56D21875B41988F7A16A1587050C3C71B4E4355BB37F255D6B237CE
-96F25467F70FA19E0F85785FF49068949CCC79F2F8AE57D5F79BB9C5CF5EED5D
-9857B9967D9B96CDCF73D5D65FF75AFABB66734018BAE264597220C89FD17379
-26764A9302D078B4EB0E29178C878FD61007EEA2DDB119AE88C57ECFEF4B71E4
-140A34951DDC3568A84CC92371A789021A103A1A347050FDA6ECF7903F67D213
-1D0C7C474A9053866E9C88E65E6932BA87A73686EAB0019389F84D159809C498
-1E7A30ED942EB211B00DBFF5BCC720F4E276C3339B31B6EABBB078430E6A09BB
-377D3061A20B1EB98796B8607EECBC699445EAA866C38E02DF59F5EDD378303A
-0733B90E7835C0AAF32BA04F1566D8161EA89CD4D14DDB953F8B910BFC8A7F03
-5020F55EF8FC2640ADADA156F6CF8F2EB6610F7EE8874A26CBE7CD154469B9F4
-ED76886B3FB679FFDEB59BB6C55AF7087BA48B75EE2FB374B19BCC421A963E15
-FE05ECAAF9EECDF4B2715010A320102E6F8CCAA342FA11532671CD9B29E43E50
-0DDD39AA60A89537A4286846D3B157372553EBA80472B69EB167FC456F6D9994
-EDCB14D165A89144CD8FAA40BAAF767E880172FF8D6D8F5658A45BBAB2764D65
-5EF40FF9C69878DEF326E32397C36C5632486A97C6F36F488F57F67F26E44E8C
-F57EF76AE4A24BCBD128A83274528DB9962F55659FF3E794F56FD6E2AB2080CC
-2FEFC831E43B311B2716FE5D14890F16DF0F6D563BF5A2DB37DE4A02C25F55FE
-EE7C4808887CB4D21AAD4C8589F04FF484EB715134014A79BD895E3B48C72C88
-0E6D1A317ABF010A4104A07813781180DB221A43BC6E19BBF2E9C9042B01126C
-CCDC015D5155237EBE9A41FC5C8763F95D144AD84D3C5A96BE90
-0000000000000000000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000000000000000000000000000000
-cleartomark
-%%EndFont
-TeXDict begin 39139632 55387786 1000 600 600 (draftmarkpic.dvi)
-@start /Fa 206[49 49[{}1 99.6264 /CMR12 rf end
-%%EndProlog
-%%BeginSetup
-%%Feature: *Resolution 600dpi
-TeXDict begin
-%%PaperSize: A4
- end
-%%EndSetup
-%%Page: 1 1
-TeXDict begin 1 0 bop 0 TeXcolorgray Black 0 TeXcolorgray
-1 0 0 0 TeXcolorcmyk 3 setlinewidth np 876 709 12 0 360.001
-arc st 3 setlinewidth np 876 709 35.4 0 360.001 arc st
-3 setlinewidth np 876 709 70.8 0 360.001 arc st 3 setlinewidth
-np 876 709 106.2 0 360.001 arc st 3 setlinewidth np 876
-709 141.6 0 360.001 arc st 3 setlinewidth np 876 709
-177 0 360.001 arc st 3 setlinewidth np 876 709 212.4
-0 360.001 arc st 3 setlinewidth np 876 709 247.8 0 360.001
-arc st 3 setlinewidth np 876 709 283.2 0 360.001 arc
-st 3 setlinewidth np 876 709 318.6 0 360.001 arc st 3
-setlinewidth np 876 709 354.6 0 360.001 arc st 3 setlinewidth
-np 876 709 390 0 360.001 arc st 3 setlinewidth np 876
-709 425.4 0 360.001 arc st 3 setlinewidth np 876 709
-460.8 0 360.001 arc st 3 setlinewidth np 876 709 496.2
-0 360.001 arc st 0.75 0.5 0.25 TeXcolorrgb 3 setlinewidth
-np 1112 709 12 0 360.001 arc st 3 setlinewidth np 1112
-709 23.4 0 360.001 arc st 3 setlinewidth np 1112 709
-35.4 0 360.001 arc st 3 setlinewidth np 1112 709 47.4
-0 360.001 arc st 3 setlinewidth np 1112 709 58.8 0 360.001
-arc st 3 setlinewidth np 1112 709 70.8 0 360.001 arc
-st 3 setlinewidth np 1112 709 82.8 0 360.001 arc st 3
-setlinewidth np 1112 709 94.2 0 360.001 arc st 3 setlinewidth
-np 1112 709 106.2 0 360.001 arc st 3 setlinewidth np
-1112 709 118.2 0 360.001 arc st 3 setlinewidth np 1112
-709 130.2 0 360.001 arc st 3 setlinewidth np 1112 709
-141.6 0 360.001 arc st 3 setlinewidth np 1112 709 153.6
-0 360.001 arc st 3 setlinewidth np 1112 709 165.6 0 360.001
-arc st 3 setlinewidth np 1112 709 177 0 360.001 arc st
-3 setlinewidth np 1112 709 189 0 360.001 arc st 3 setlinewidth
-np 1112 709 201 0 360.001 arc st 3 setlinewidth np 1112
-709 212.4 0 360.001 arc st 3 setlinewidth np 1112 709
-224.4 0 360.001 arc st 3 setlinewidth np 1112 709 236.4
-0 360.001 arc st 0 1 0 0 TeXcolorcmyk 3 setlinewidth
-np 640 709 12 0 360.001 arc st 3 setlinewidth np 640
-709 23.4 0 360.001 arc st 3 setlinewidth np 640 709 35.4
-0 360.001 arc st 3 setlinewidth np 640 709 47.4 0 360.001
-arc st 3 setlinewidth np 640 709 58.8 0 360.001 arc st
-3 setlinewidth np 640 709 70.8 0 360.001 arc st 3 setlinewidth
-np 640 709 82.8 0 360.001 arc st 3 setlinewidth np 640
-709 94.2 0 360.001 arc st 3 setlinewidth np 640 709 106.2
-0 360.001 arc st 3 setlinewidth np 640 709 118.2 0 360.001
-arc st 3 setlinewidth np 640 709 130.2 0 360.001 arc
-st 3 setlinewidth np 640 709 141.6 0 360.001 arc st 3
-setlinewidth np 640 709 153.6 0 360.001 arc st 3 setlinewidth
-np 640 709 165.6 0 360.001 arc st 3 setlinewidth np 640
-709 177 0 360.001 arc st 3 setlinewidth np 640 709 189
-0 360.001 arc st 3 setlinewidth np 640 709 201 0 360.001
-arc st 3 setlinewidth np 640 709 212.4 0 360.001 arc
-st 3 setlinewidth np 640 709 224.4 0 360.001 arc st 3
-setlinewidth np 640 709 236.4 0 360.001 arc st 1 0.5 0
-TeXcolorrgb 3 setlinewidth np 876 946 12 0 360.001 arc
-st 3 setlinewidth np 876 946 23.4 0 360.001 arc st 3
-setlinewidth np 876 946 35.4 0 360.001 arc st 3 setlinewidth
-np 876 946 47.4 0 360.001 arc st 3 setlinewidth np 876
-946 58.8 0 360.001 arc st 3 setlinewidth np 876 946 70.8
-0 360.001 arc st 3 setlinewidth np 876 946 82.8 0 360.001
-arc st 3 setlinewidth np 876 946 94.2 0 360.001 arc st
-3 setlinewidth np 876 946 106.2 0 360.001 arc st 3 setlinewidth
-np 876 946 118.2 0 360.001 arc st 3 setlinewidth np 876
-946 130.2 0 360.001 arc st 3 setlinewidth np 876 946
-141.6 0 360.001 arc st 3 setlinewidth np 876 946 153.6
-0 360.001 arc st 3 setlinewidth np 876 946 165.6 0 360.001
-arc st 3 setlinewidth np 876 946 177 0 360.001 arc st
-3 setlinewidth np 876 946 189 0 360.001 arc st 3 setlinewidth
-np 876 946 201 0 360.001 arc st 3 setlinewidth np 876
-946 212.4 0 360.001 arc st 3 setlinewidth np 876 946
-224.4 0 360.001 arc st 3 setlinewidth np 876 946 236.4
-0 360.001 arc st 0 1 0 TeXcolorrgb 3 setlinewidth np
-876 473 12 0 360.001 arc st 3 setlinewidth np 876 473
-23.4 0 360.001 arc st 3 setlinewidth np 876 473 35.4
-0 360.001 arc st 3 setlinewidth np 876 473 47.4 0 360.001
-arc st 3 setlinewidth np 876 473 58.8 0 360.001 arc st
-3 setlinewidth np 876 473 70.8 0 360.001 arc st 3 setlinewidth
-np 876 473 82.8 0 360.001 arc st 3 setlinewidth np 876
-473 94.2 0 360.001 arc st 3 setlinewidth np 876 473 106.2
-0 360.001 arc st 3 setlinewidth np 876 473 118.2 0 360.001
-arc st 3 setlinewidth np 876 473 130.2 0 360.001 arc
-st 3 setlinewidth np 876 473 141.6 0 360.001 arc st 3
-setlinewidth np 876 473 153.6 0 360.001 arc st 3 setlinewidth
-np 876 473 165.6 0 360.001 arc st 3 setlinewidth np 876
-473 177 0 360.001 arc st 3 setlinewidth np 876 473 189
-0 360.001 arc st 3 setlinewidth np 876 473 201 0 360.001
-arc st 3 setlinewidth np 876 473 212.4 0 360.001 arc
-st 3 setlinewidth np 876 473 224.4 0 360.001 arc st 3
-setlinewidth np 876 473 236.4 0 360.001 arc st 1 0.5 0
-TeXcolorrgb 0 1 0 0 TeXcolorcmyk 0.75 0.5 0.25 TeXcolorrgb
-1 0 0 0 TeXcolorcmyk 0 TeXcolorgray 0 TeXcolorgray 1852
-5637 a Fa(1)p 0 TeXcolorgray eop end
-%%Trailer
-
-userdict /end-hook known{end-hook}if
-%%EOF
diff --git a/Master/texmf-dist/doc/latex/xwatermark/Graphics/xwatermarkpic.pdf b/Master/texmf-dist/doc/latex/xwatermark/Graphics/xwatermarkpic.pdf
deleted file mode 100644
index 7e7ef09d83f..00000000000
--- a/Master/texmf-dist/doc/latex/xwatermark/Graphics/xwatermarkpic.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/xwatermark/Graphics/xwatermarkpic.tex b/Master/texmf-dist/doc/latex/xwatermark/Graphics/xwatermarkpic.tex
deleted file mode 100644
index c4b62a2cf8f..00000000000
--- a/Master/texmf-dist/doc/latex/xwatermark/Graphics/xwatermarkpic.tex
+++ /dev/null
@@ -1,107 +0,0 @@
-\documentclass[12pt,a4paper]{article}
-\usepackage{epic,pict2e,eepic,pstricks,curve2e}
-\begin{document}
-\setlength{\unitlength}{1mm}
- \begin{picture}(60,40)
- \color{cyan}
- \put(20,30){\circle{1}}
- \put(20,30){\circle{3}}
- \put(20,30){\circle{6}}
- \put(20,30){\circle{9}}
- \put(20,30){\circle{12}}
- \put(20,30){\circle{15}}
- \put(20,30){\circle{18}}
- \put(20,30){\circle{21}}
- \put(20,30){\circle{24}}
- \put(20,30){\circle{27}}
- \put(20,30){\circle{30}}
- \put(20,30){\circle{33}}
- \put(20,30){\circle{36}}
- \put(20,30){\circle{39}}
- \put(20,30){\circle{42}}
- \color{brown}
- \put(30,30){\circle{1}}
- \put(30,30){\circle{2}}
- \put(30,30){\circle{3}}
- \put(30,30){\circle{4}}
- \put(30,30){\circle{5}}
- \put(30,30){\circle{6}}
- \put(30,30){\circle{7}}
- \put(30,30){\circle{8}}
- \put(30,30){\circle{9}}
- \put(30,30){\circle{10}}
- \put(30,30){\circle{11}}
- \put(30,30){\circle{12}}
- \put(30,30){\circle{13}}
- \put(30,30){\circle{14}}
- \put(30,30){\circle{15}}
- \put(30,30){\circle{16}}
- \put(30,30){\circle{17}}
- \put(30,30){\circle{18}}
- \put(30,30){\circle{19}}
- \put(30,30){\circle{20}}
- \color{magenta}
- \put(10,30){\circle{1}}
- \put(10,30){\circle{2}}
- \put(10,30){\circle{3}}
- \put(10,30){\circle{4}}
- \put(10,30){\circle{5}}
- \put(10,30){\circle{6}}
- \put(10,30){\circle{7}}
- \put(10,30){\circle{8}}
- \put(10,30){\circle{9}}
- \put(10,30){\circle{10}}
- \put(10,30){\circle{11}}
- \put(10,30){\circle{12}}
- \put(10,30){\circle{13}}
- \put(10,30){\circle{14}}
- \put(10,30){\circle{15}}
- \put(10,30){\circle{16}}
- \put(10,30){\circle{17}}
- \put(10,30){\circle{18}}
- \put(10,30){\circle{19}}
- \put(10,30){\circle{20}}
- \color{orange}
- \put(20,20){\circle{1}}
- \put(20,20){\circle{2}}
- \put(20,20){\circle{3}}
- \put(20,20){\circle{4}}
- \put(20,20){\circle{5}}
- \put(20,20){\circle{6}}
- \put(20,20){\circle{7}}
- \put(20,20){\circle{8}}
- \put(20,20){\circle{9}}
- \put(20,20){\circle{10}}
- \put(20,20){\circle{11}}
- \put(20,20){\circle{12}}
- \put(20,20){\circle{13}}
- \put(20,20){\circle{14}}
- \put(20,20){\circle{15}}
- \put(20,20){\circle{16}}
- \put(20,20){\circle{17}}
- \put(20,20){\circle{18}}
- \put(20,20){\circle{19}}
- \put(20,20){\circle{20}}
- \color{green}
- \put(20,40){\circle{1}}
- \put(20,40){\circle{2}}
- \put(20,40){\circle{3}}
- \put(20,40){\circle{4}}
- \put(20,40){\circle{5}}
- \put(20,40){\circle{6}}
- \put(20,40){\circle{7}}
- \put(20,40){\circle{8}}
- \put(20,40){\circle{9}}
- \put(20,40){\circle{10}}
- \put(20,40){\circle{11}}
- \put(20,40){\circle{12}}
- \put(20,40){\circle{13}}
- \put(20,40){\circle{14}}
- \put(20,40){\circle{15}}
- \put(20,40){\circle{16}}
- \put(20,40){\circle{17}}
- \put(20,40){\circle{18}}
- \put(20,40){\circle{19}}
- \put(20,40){\circle{20}}
- \end{picture}
-\end{document} \ No newline at end of file
diff --git a/Master/texmf-dist/doc/latex/xwatermark/README b/Master/texmf-dist/doc/latex/xwatermark/README
index 2c44eda0933..4618a62282d 100644
--- a/Master/texmf-dist/doc/latex/xwatermark/README
+++ b/Master/texmf-dist/doc/latex/xwatermark/README
@@ -1,26 +1,38 @@
-This is the README file for 'xwatermark' package, version 1.4.
-
-This package puts user-specified watermarks (graphics and arbitrary texts)
-on select pages of documents. It is more general than the packages
-'draftwatermark' by Sergio Callegari (2006), 'watermark' by Alexander
-Rozhenko (2004), and 'draftmark' by Ahmed Musa (2009). The advantages of
-xwatermark over these packages include: the user can specify the
-watermark and color, the watermark position and orientation,
-the page(s) (all pages, odd pages, even pages, a particular page number,
-and a range of pages) on which the watermark should appear, and all the
-options are passed directly to package instead of being defined by macros.
-It extends the functionality of the 'draftmark' package to permit the
-direct use of graphic watermarks.
-
-There is also the macro \watermarksetup, which can be used to dynamically
-specify watermark properties for each page or range of pages. With the
-'xcolor' package (loaded by this package), all colors and those defined
-within the user document can be passed to this package.
-
-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 (LPPL), either version 1.3 of this license or
-any later version. The latest version of this license is in
+This is the README file for the 'xwatermark' package
+
+VERSION
+
+Version 1.5.1, July 2011
+
+SUMMARY
+
+This package puts user-specified watermarks (graphics and arbitrary
+texts) on select pages of documents. It is more general than the
+packages 'draftwatermark', 'watermark', 'draftmark', 'wallpaper' and
+similar packages. The advantages of xwatermark over these packages
+include: the user can specify the watermark and color, the watermark
+position and orientation, the page(s) (all pages, odd pages, even pages,
+a particular page number, and a range of pages) on which the watermark
+should appear, and all the options are passed directly to package instead
+of being defined by macros. Also, multiple text and/or picture watermarks
+(or wallpapers) can be put on the same page or range of pages with
+little effort.
+
+Among other macros, there are the macros \newwatermark and
+\newwallpaper, both of which can be used to dynamically specify
+watermark properties for each page or range of pages. With the
+'xcolor' package (not loaded by this package), all colors and
+those defined within the user document can be passed to this package.
+
+
+LICENSE
+
+Copyright (c) July 2011 Ahmed Musa (amusa22@gmail.com)
+
+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 (LPPL), either version 1.3 of this license or
+any later version. The latest version of this license is in
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.
@@ -31,6 +43,5 @@ kind, either expressed or implied, including, but not limited to,
the implied warranties of merchantability and fitness for a
particular purpose.
-Copyright (c) 2010 Ahmed Musa (a.musa@rocketmail.com).
-End of README file. \ No newline at end of file
+
diff --git a/Master/texmf-dist/doc/latex/xwatermark/tab-globaloptions.tex b/Master/texmf-dist/doc/latex/xwatermark/tab-globaloptions.tex
new file mode 100644
index 00000000000..2994761758b
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/xwatermark/tab-globaloptions.tex
@@ -0,0 +1,57 @@
+%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%
+% This is file xwatermark-guide (global options), version 1.5.1 %
+% %
+% Copyright (c) 2009-2011 Ahmed Musa (amusa22@gmail.com). %
+%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%
+
+\documentclass[a4paper,10pt,final,UK-English,table-file]{amltxdoc}
+\makeatletter
+\InputIfFileExists{xwatermark-guide.cfg}{}{%
+ \@latex@error{No file 'xwatermark-guide.cfg' or wrong path}\@ehc
+}
+\usepackage{reviewtools}
+\WrapQuotes
+\NoPrintNotes
+\makeindex
+
+\begin{document}
+
+\colone4cm\coltwo2.5cm
+\colthree=\dimexpr\textwidth-(\colone+\coltwo+1.5cm)\relax
+\coltotal=\dimexpr\colone+\coltwo+\colthree\relax
+\extrarowheight=2pt
+\arrayrulecolor{orange}
+\noindent
+\begin{longtable}[c]{>{\hspace{0pt}\raggedright}m{\colone}m{\coltwo}W}
+\caption{Global options of the package\label{tab:globaloptions}}\\\whline
+
+\multicolumn{3}{M}{All the keys in this table are \quoted{option keys}, \ie, they can appear only in \hx{\documentclass} or \hx{\usepackage}. If a key is an option key and it is issued in functions other than \hx{\documentclass} or \hx{\usepackage}, the package will alert the user to that effect.}\\\hline
+
+\bfblue Option & \bfblue Default & \bfblue Meaning\\\hline
+\endfirsthead
+\hline
+\multicolumn{3}{l}{\emph{Continued from last page}}\\\hline
+\bfblue Option & \bfblue Default & \bfblue Meaning %\\\hline
+\endhead
+\multicolumn{3}{r}{\emph{Continued on next page}}\\\hline
+\endfoot
+\hline
+\endlastfoot
+\ffx{defaultfirstpage, default-first-page} & 1 & The default first page of document, when the first page hasn't been known yet. \\\hline
+\ffx{defaultlastpage, default-last-page} & 1 & The default last page of document, when the last page has't been shipped out yet. \\\hline
+\fx{draft} & \hx{false} & The document is in draft mode.\ltnote{\ffx'{draft,final} are complementary (biboolean) options, \ie, when one is true, the other is automatically set to false.}\\\hline
+\fx{final} & \hx{true} & The document is in final mode.\\\hline
+\ffx{disablegeometry, disable-geometry} & \hx{false} & This option determines whether the page layout settings by the \pkg'{geometry} should be disabled so that the watermarks can be set more readily by \pkg{xwatermark}.\ltnote{Version~5.6 and higher of the \pkg'{geometry} make this option less likely to be needed, unlike the earlier versions of \pkg{geometry}.}\\\hline
+\ffx{frontpagestyle, front-page-style} & empty & The style of the front page, in the sense of the \pkg'{fancyhdr}. \\\hline
+\ffx{picontoptext,pic-on-top-text, picture-on-top-text} & \hx{true} & The boolean that determines if picture watermark is placed on top of text watermark or otherwise, when they occur at the same location on a page.\\\hline
+\ffx{printwatermark, print-watermark} & \hx{true} & The global boolean switch that determines whether watermarks should be printed or not.\ltnote{This option can be passed to package as either \fx{true} or \fx{false} and can appear in the \hx{\documentclass} options list or \hx{\usepackage}. If for any reason you don't want the watermark printed in any run, you can enter \fx{printwatermark}=\hx{false}. If the option \fx{draft} or \fx{final} appears in the \hx{\documentclass} or \hx{\usepackage}, it won't affect the printing or otherwise of the watermark, apart from determining if graphics watermarks are actually inserted instead of framed empty boxes. The printing of the watermark is determined by the option \fx{printwatermark}.}\\\hline
+\ffx{resetpaperorigin,reset-paper-origin} & \hx{false} & The boolean to call to reset the paper origin (\hhx'{\pdfhorigin, \pdfvorigin, \hoffset, \voffset}) to zero unit. \\\hline
+\ffx{showpagecenter, show-page-center} & \hx{false} & Boolean that indicates if the center of the paper should be shown with a cross (and circle).\ltnote{The \pkg'{xwmgrid}, which provides a full gridding functionality consistent with the \pkg'{xwatermark}, will be released shortly.}\\\hline
+\ffx{textontoppic,text-on-top-pic,text-on-top-picture} & \hx{false} & The reverse of \fx{picontoptext}.\\\hline
+\ffx{usedummymarks, use-dummy-marks} & \hx{true} & The boolean that instructs \pkg{xwatermark} to print watermarks that have been defined by the \fx{\dummywatermark} or \fx{\dummywallpaper} in addition to those defined by \fx{\newwatermark} and/or \fx{\newwallpaper}.\\\hline
+\ffx{watermarkparser, watermark-parser} & \fx{;}~(semicolon) & The option determines the watermark parser, a quantity that is used internally to build watermarks into lists.\ltnote{If you do have the \fx{watermarkparser} in your watermark, it must be enclosed in curly braces, otherwise the package will flag a fatal error. You can change the \fx{watermarkparser} to say \quoted{\fx{|}} (vertical bar), in case you have too many \quoted{\fx{;}} (semicolons) in your watermarks and you are fed up with enclosing them in braces.}\\\hline
+\end{longtable}
+
+\normalfont\normalsize
+
+\end{document}
diff --git a/Master/texmf-dist/doc/latex/xwatermark/tab-localoptions.tex b/Master/texmf-dist/doc/latex/xwatermark/tab-localoptions.tex
new file mode 100644
index 00000000000..f0ca5dd4992
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/xwatermark/tab-localoptions.tex
@@ -0,0 +1,170 @@
+%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%
+% This is file xwatermark-guide (local options), version 1.5.1 %
+% %
+% Copyright (c) 2009-2011 Ahmed Musa (amusa22@gmail.com). %
+%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%
+
+\documentclass[
+ use-a4-paper,use-10pt-font,final-version,UK-English,
+ no-hyperref-msg,wrapquote,tablefile,verbose=false
+]{amltxdoc}
+\makeatletter
+\InputIfFileExists{xwatermark-guide.cfg}{}{%
+ \@latex@error{No file 'xwatermark-guide.cfg' or wrong path}\@ehc
+}
+
+\begin{document}
+
+\extrarowheight=2pt
+\colone4cm\coltwo2.8cm
+\colthree=\dimexpr\textwidth-(\colone+\coltwo+1.5cm)\relax
+\coltotal=\dimexpr\colone+\coltwo+\colthree\relax
+\arrayrulecolor{orange}
+
+\begin{longtable}[c]{>{\hspace{0pt}\raggedright}m{\colone}m{\coltwo}W}
+\caption{Local (function-dependent) options of the package
+ \label{tab:localoptions}}\\\whline
+
+\multicolumn{3}{M}{Most of the keys in this table are \quoted{non-option keys}, \ie, they can't appear in \hx{\documentclass} or \hx{\usepackage} but in the arguments of the given functions. If a key is a non-option key and the user submits it to \hx{\documentclass} or \hx{\usepackage}, the package will alert the user.}\\\hline
+
+\bfblue Option & \bfblue Default & \bfblue Meaning\\\hline
+\endfirsthead
+\hline
+\multicolumn{3}{l}{\emph{Continued from last page}}\\\hline
+\bfblue Option & \bfblue Default & \bfblue Meaning %\\\hline
+\endhead
+\multicolumn{3}{r}{\emph{Continued on next page}}\\\hline
+\endfoot
+\hline
+\endlastfoot
+\multicolumn{3}{c}{\bf\bffunc{\newwatermark} macro}\\\hline
+
+\ffx{angle,textangle,text-angle} & $0^\circ$ & The orientation of text watermark. \\\hline
+\ffx{align,textalign,text-align} & \texttt{center} & The internal horizontal alignment of the watermark within a watermark box.\ltnote{The key can assume only one of the values \ffx'{center, left, right, justified}. Any other text alignment value is inadmissible and thus rejected by the package with a fatal error.}\\\hline
+\ffx{page,pages,pagex,firstpage,lastpage,allpages,evenpages,oddpages} & & These determine the pages on which the watermarks are to be printed.\ltnote{The options \fx{allpages}, \fx{evenpages}, \fx{oddpages} are boolean keys, while \ffx'{page,pages,pagex} require values, \eg, \ffx'{page=x,pages=x-y,pagex={x,y,z}}. If the package is loaded and none of these options is passed to it, but the option \fx{printwatermark} is true, the default watermark (DRAFT) will be printed on the first page of the document (but only in draft mode) and a warning message logged in the transcript file. The key \fx{pages} expects a page range with the pages separated by a hyphen, while \fx{pagex} expects a list of pages that will receive the watermarks.}\\\hline
+
+\ffx{boxalign,box-align} & \texttt{center/s} & The alignment of the watermark box.\ltnote{Both text and picture watermarks are normally put in boxes for manipulation before being typeset. This key refers to the horizontal and vertical alignments of the box. The key can assume one of the values \ffx{t-l,t-r,b-l,b-r,s}, or \ffx{top-left, top-right, bottom-left, bottom-right, center, justified}. Elements of these two sets can't be combined. When submitted as key values, the elements of both sets are not to be separated by commas or spaces but by hyphens (\eg, one of \ffx{t-l,t-r,b-l,b-r,s}, or one of \ffx{top-left, top-right, bottom-left, bottom-right, center, justified}).}\\\hline
+\ffx{coordunit,coord-unit,position-unit} & \hx{mm} & The unit for x- and y-coordinates of watermark. \\\hline
+\ffx{color,textcolor,text-color} & \hx{gray!25} & The color of the text watermark.\\\hline
+\fx{draft} & \texttt{false} & This option will insert framed empty boxes in place of graphics watermarks.\\\hline
+\ffx{draftboxcolor,draft-box-color} & \texttt{blue} & The color of the box that is printed in place of graphics watermarks in \fx{draft} document mode. \\\hline
+\fx{final} & \texttt{false} & This option actually does nothing for now. It is included for possible future application.\\\hline
+\ffx{fontfamily,font-family} & \hx{bch} & The \hx{fontfamily} of the text watermark.\\\hline
+\ffx{fontsize,font-size} & 1cm & The \hx{fontsize} of the text watermark.\ltnote{If for some reason you need other fontsizes (\eg, 10pt, 11pt or 12pt for printing text watermarks in \hx{\normalfont}), you will need to submit them as values of \hx{fontsize}.}\\\hline
+
+\ffx{fontseries,font-series} & \hx{b} & The font series of the text watermark.\ltnote{If you need normal document text, put \fx{fontseries=m}, which implies medium weight and width.}\\\hline
+
+\fx{graphicsoptions} & & Additional user-supplied key-value options for the command \hx{\includegraphics}.\ltnote{The command \hx{\includegraphics} is used for all graphics inclusion tasks. Users can directly pass values to admissible options of the command \hx{\includegraphics}. See \autoref{sec:graphicsoptions}.} \\\hline
+\ffx{height,textheight,text-height} & \hx{\paperwidth} & The height of text watermarks.\\\hline
+\ffx{mark,textmark,text-mark} & DRAFT & The default text watermark.\\\hline
+\ffx{picscale,picture-scale} & 1 & Scale of picture watermark.\\\hline
+\ffx{picbb,picture-bb,pic-bounding-box} & 0 0 100 100& The bounding box (dvi mode) or viewport (pdf mode) of the picture watermark.\\\hline
+\ffx{picfile,picture-file} & & The filename of picture watermark.\ltnote{This, with its full path, must be submitted when including picture watermark.}\\\hline
+\ffx{picfileext,pic-file-ext} & eps/pdf & The filename extension of the picture watermark.\ltnote{Valid extensions are \fx{eps}, \fx{pdf}, \fx{png}, \fx{jpeg}, \fx{mps}; the latter four may be used in the case of \pdftex. The file extension should be passed without the dot. If the option is not passed to package, \pkg{xwatermark} selects \fx{eps} (in dvi mode) or \fx{pdf} (in \pdftex mode).} \\\hline
+\ffx{picheight,pic-height,picture-height} & & The height of picture watermarks.\\\hline
+\ffx{picangle,picture-angle} & $0^\circ$ & The orientation of picture watermarks. \\\hline
+\ffx{picwidth,picture-width} & & The width of picture watermarks. \\\hline
+\ffx{picontoptext,picture-on-top-text} & true & Pictures should be placed on top of text watermarks if the two types of watermark occur on the same spot on a page. \\\hline
+\ffx{picxpos,picture-xpos,picture-x-position} & 0 & The horizontal coordinate of the picture watermarks.\\\hline
+\ffx{picypos,picture-ypos,picture-y-position} & 0 & The horizontal coordinate of the picture watermarks. \\\hline
+\ffx{scale,textscale,text-scale} & 1 & The scale of the text watermark.\\\hline
+\ffx{showpagecenter,show-page-center,showpapercenter} & false & Boolean for requesting the indication of the center of the paper. See \pkgg'{xwmgrids} for additional information. \\\hline
+\ffx{textontoppic,text-on-top-pic,text-on-top-picture} & false & Text watermarks should be placed on top of graphics watermarks if the two types of watermark occur on the same spot on a page. This reverses the boolean \fx{picontoptext}.\\\hline
+\ffx{width,textwidth,text-width} & \hx{\paperheight} & The width of text watermarks; doesn't apply to graphics watermarks.\ltnote{For some design reasons we set \hx{\paperheight} as the default value of mark's width instead of mark's height.}\\\hline
+\ffx{xpos,textxpos,text-xpos,text-x-position} & 0 & These specify the horizontal coordinate of watermark (with reference to the center of paper, and not the text center).\ltnote{There is no need to attach a unit to \fx{xpos} or \fx{ypos}; if the user does, the unit will be used in place of \fx{coordunit}.}\\\hline
+\ffx{ypos,textypos,text-ypos,text-y-position} & 0 & The vertical coordinate of the watermark.\\\hline
+
+\multicolumn{3}{c}{\bffunc{\newwallpaper} \textbf{macro}\ltnote{Some of the \fx{\newwatermark} keys can also be called when inserting wallpapers. If you aren't sure if a key is applicable, don't worry: just try it. The package collects all inadmissible keys together and prints them in the transcript file on each run. Normally, the user is alerted by an error message. Indeed if you receive any failed compilation, you should first suspect that the failure is due to the use of an invalid key. The next keys apply specifically to wallpaper watermarks.}}\\\hline
+
+\ffx{align,textalign,text-align} & \texttt{center} & The internal horizontal alignment of the watermark within a watermark box.\ltnote{The key can assume only one of the values \ffx'{center, left, right, justified}.}\\\hline
+\ffx{boxalign,box-align} & center (s) & The horizontal and vertical alignments of the watermark box.\ltnote{The key can assume one of the values \ffx{t-l,t-r,b-l,b-r,s}, or \ffx{top-left, top-right, bottom-left, bottom-right, center, justified}. When submitted as key values, the elements are not to be separated by commas or spaces but by hyphens (\eg, one of \ffx{t-l,t-r,b-l,b-r,s}, or one of \ffx{top-left, top-right, bottom-left, bottom-right, center, justified}).} \\\hline
+\ffx{picheight,picture-height} & .25\hx{\paperheight} & The height of each cell of picture wallpaper. \\\hline
+\ffx{picwidth,picture-width} & .25\hx{\paperwidth} & The width of each cell of picture wallpaper.\\\hline
+\ffx{tilexsize,tile-xsize} & .25\hx{\paperwidth} & The width of each cell of tiled wallpaper.\\\hline
+\ffx{tileysize,tile-ysize} & .25\hx{\paperheight} & The height of each cell of tiled wallpaper.\\\hline
+\ffx{textheight,text-height} & .25\hx{\paperheight} & The height of each cell of text wallpaper. \\\hline
+\ffx{textwidth,text-width} & .25\hx{\paperwidth} & The width of each cell of text wallpaper.\\\hline
+\ffx{tilexoffset,tile-xoffset} & 0pt & The horizontal shift between the tiles of wallpaper.\\\hline
+\ffx{tileyoffset,tile-yoffset} & 0pt & The vertical shift between the tiles of wallpaper.\\\hline
+\ffx{tileno,tilenumber,tile-number,number-of-tiles} & 4 & The maximum number of cells for tiled wallpapers if the parameters \fx{tilexsize} and \fx{tileysize} aren't specified or if the boolean \fx{squaretiles} is true.\ltnote{If \fx{tilexsize} and \fx{tileysize} are given and \fx{squaretiles} is false, \fx{tileno} is ignored.}\\\hline
+\ffx{squaretiles,square-tiles} & true & The boolean that determines if the tiles should be rectangular or square.\ltnote{Sometimes choosing \fx{squaretiles} (\ie, setting it true) can yield an undesired outcome if \ffx'{textalign,boxalign} haven't been properly selected. In such a situation, the user is advised to first experiment with setting \fx{squaretiles} to false and/or \ffx'{textalign,boxalign} to \fx{center}.}\\\hline
+\ffx{wpxoffset,wallpaper-xoffset} & 0pt & The horizontal offset of wallpaper from the margin or edge of paper.\\\hline
+\ffx{wpyoffset,wallpaper-yoffset} & 0pt & The vertical offset of wallpaper from the margin or edge of paper.\\\hline
+
+\multicolumn{3}{c}{\bffunc{\xwmminipage} \textbf{macro}\ltnote{The \fx{\xwmminipage} command can take verbatim material and provides a \keyval alternative to the \hx{\boxedminipage} command of the \pkg'{boxedminipage}.}}\\\hline
+
+\fx{depth} & 0ex & Additional depth of the boxed minipage.\\\hline
+\fx{height} & \hx{.5\textheight} & Additional height of the boxed minipage.\\\hline
+\ffx{framebox,insertframe,insert-frame} & true & The boolean that determines whether the box is
+ framed or not.\\\hline
+\fx{framesep} & 3pt & \hx{\fboxsep} of the boxed minipage.\\\hline
+\fx{framerule} & 0.4pt & \hx{\fboxrule} of the boxed minipage.\\\hline
+\fx{textwidth} & \hx{\paperwidth} & Width of the boxed minipage.\\\hline
+\fx{textcolor} & black & Color of text inside boxed minipage.\\\hline
+\fx{framecolor} & white & Color of frame of boxed minipage.\\\hline
+\ffx{textalign, text-align} & center & Alignment of the text inside the boxed minipage of the command \fx{\xwmminipage} (expected values are \fx{center}, \fx{left}, \fx{right} and \fx{justified}).\\\hline
+
+\multicolumn{3}{c}{\bffunc{\xwmcolorbox} \textbf{macro}}\\\hline
+
+\fx{depth} & 0ex & Additional depth of the colorbox.\\\hline
+\ffx{framebox,insertframe,insert-frame} & true & The boolean that determines whether the box is framed
+ or not.\\\hline
+\fx{framesep} & 3pt & \hx{\fboxsep} of the colorbox.\\\hline
+\fx{framerule} & 0.4pt & \hx{\fboxrule} of the colorbox.\\\hline
+\fx{height} & 0ex & Additional height of the colorbox.\\\hline
+\ffx{innerframecolor,inner-frame-color} & white & Color of the inner frame of colorbox.\\\hline
+\ffx{outerframecolor,outer-frame-color} & white & Color of the outer frame of colorbox.\\\hline
+\fx{textcolor} & black & Color of text inside colorbox.\\\hline
+\ffx{textalign,text-align} & center & Alignment of the text inside the colorbox of
+ \fx{\xwmcolorbox} (expected values are \fx{center}, \fx{left}, \fx{right} and \fx{justified}).\\\hline
+\fx{width} & \hx{\paperwidth} & Width of the colorbox.\\\hline
+
+\multicolumn{3}{c}{\bffunc{\makecolorbox} \textbf{macro}}\\\hline
+\multicolumn{3}{M}{The options of the macro \fx{\makecolorbox} are the same as those of the related macro \fx{\xwmcolorbox}. Please refer to \autoref{sec:makecolorbox} for the syntaxes of these macros.}\\\hline
+
+\multicolumn{3}{c}{\bffunc{\fancypagenos} \textbf{macro}}\\\hline
+
+\ffx{cfoot,center-footer,footer-center} & & Center footer.\ltnote{All headers and footers are as in \pkgg'{fancyhdr}.} \\\hline
+\ffx{chead,center-header,header-center} & & Center header.\\\hline
+\fx{format} & \hx{\fbox} & The desired format of the fancy-page numbers.\\\hline
+\ffx{coordunit,coord-unit,position-unit} & mm & The units of the position/coordinates \fx{x} and \fx{y}.\\\hline
+\ffx{fontfamily,font-family} & cmss & The \hx{fontfamily} of the fancy-page numbers.\\\hline
+\ffx{fontsize,font-size} & 5cm & The \hx{fontsize} of the fancy-page numbers.\\\hline
+\ffx{fontseries,font-series} & \hx{b} & The font series of the fancy-page numbers.\\\hline
+\fx{footrule-height} & .4pt & Foot rule height.\\\hline
+\fx{footrule-depth} & .4pt & Foot rule depth.\\\hline
+\fx{footrule-width} & \hx{\headwidth} & Foot rule width.\\\hline
+\ffx{footrule-sep,footrule-separation} & 2pt & Foot rule vertical separation (\ie, the vertical separation between the two lines. \\\hline
+\fx{footrule-color} & cyan & Foot rule color.\\\hline
+\fx{hfoffset-left} & .5 & Left \hx{\hfoffset} (see \pkgg{fancyhdr} for the meaning of \hx{\hfoffset}). \\\hline
+\fx{hfoffset-right} & .5 & Right \hx{\hfoffset} (see \pkgg{fancyhdr}). \\\hline
+\fx{headrule-height} & .4pt & Head rule height.\\\hline
+\fx{headrule-depth} & .4pt & Head rule depth.\\\hline
+\fx{headrule-width} & \hx{\headwidth} & Head rule width.\\\hline
+\ffx{headrule-sep, headrule-separation} & 2pt & Head rule separation (\ie, the vertical separation between the two lines.\\\hline
+\fx{headrule-color} & blue & Head rule color. \\\hline
+\ffx{lfoot,left-footer,footer-left} & & Left footer. \\\hline
+\ffx{lhead,left-header,header-left} & & Left header.\\\hline
+\ffx{style,printstyle,print-style} & \hx{\thepage} & The presentation style of the fancy-page numbers.\\\hline
+\ffx{rfoot,right-footer,footer-right} & & Right footer. \\\hline
+\ffx{rhead,right-header,header-right} & & Right header.\\\hline
+\ffx{showpagenos,show-pageno,show-pagenos,show-page-numbers} & true & Boolean that determines if fancy-page numbers should be shown.\\\hline
+\ffx{showonpageone,show-on-page-one,show-on-page-1} & false & Boolean that determines if fancy-page numbers should be shown on the first page of the document.\\\hline
+\ffx{showheadrule,show-headrule} & true & Boolean that determines if the head-rule should be shown.\\\hline
+\ffx{showfootrule,show-footrule} & true & Boolean that determines if the foot-rule should be shown. \\\hline
+\ffx{sendtoback, send-to-back} & true & Boolean that determines if the fancy-page numbers should be placed in the background or foreground.\\\hline
+\ffx{align,textalign,text-align} & center & The alignment of the text in the fancy-page number box (if it is boxed).\\\hline
+\ffx{boxalign,box-align} & center & The alignment of the fancy-page number box (if it is boxed).\\\hline
+\ffx{color,textcolor,text-color} & blue & The color of the fancy-page numbers.\\\hline
+\ffx{scale,textscale,text-scale} & 2.5 & The scale of the fancy-page numbers.\\\hline
+\ffx{angle,textangle,text-angle} & 0 & The orientation of the fancy-page numbers.\\\hline
+\ffx{width,textwidth,text-width} & 0ex & Width of the fancy-page numbers.\\\hline
+\ffx{height,textheight,text-height} & 0ex & Height of the fancy-page numbers.\\\hline
+\ffx{xpos,textxpos,x-position} & 0 & The horizontal coordinates of the fancy-page numbers
+ (from page center).\\\hline
+\ffx{ypos,textypos,y-position} & 0 & The vertical coordinates of the fancy-page numbers (from page center).\\\whline
+\end{longtable}
+
+\normalfont\normalsize
+
+\end{document}
diff --git a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-bugreport.tex b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-bugreport.tex
deleted file mode 100644
index 1689ccb25ef..00000000000
--- a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-bugreport.tex
+++ /dev/null
@@ -1,30 +0,0 @@
-%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%
-% This is file xwatermark-bugreport.tex, the bug report file for the %
-% xwatermark package, version 1.4. %
-% %
-% (c) Ahmed Musa 2010 (a.musa@rocketmail.com) %
-%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%
-% %
-% IMPORTANT %
-% %
-% Fill in the details below, compile the file and email the %
-% sample file, the log file, and the auxiliary file to %
-% a.musa@rocketmail.com. %
-% Thank you %
-% %
-%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%
-\documentclass{article}
-\listfiles
-\usepackage[logonly]{trace}
-\traceon
-%\usepackage[Put your options here]{xwatermark}
-% Load your select packages here:
-% Provide other elements of your preamble here:
-\traceoff
-\begin{document}
-\traceon
-% Provide sample text here:
-
-
-\traceoff
-\end{document}
diff --git a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples.cfg b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples.cfg
new file mode 100644
index 00000000000..8ff82f42470
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples.cfg
@@ -0,0 +1,253 @@
+%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%
+% This is file xwatermark-examples.cfg, version 1.5.1 %
+% %
+% Copyright (c) 2009-2011 Ahmed Musa (a.musa@rocketmail.com). %
+%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%
+
+\ProvidesFile{xwatermark-examples.cfg}
+ [2011/07/30 v1.5.1 Configuration file for xwatermark-examples.tex (AM)]
+\NeedsTeXFormat{LaTeX2e}
+\makeatletter
+\@ifundefined{ver@catoptions.sty}{%
+ \csname @\ifx\documentclass\@twoclasseserror
+ first\else second\fi oftwo\endcsname
+ \usepackage\RequirePackage{catoptions}%
+}{}
+\AtBeginDocument{\hypersetup{pdfstartview=Fit,colorlinks}}
+
+\cptloadpackages{%
+ xcolor|dvipsnames,table,hyperref;
+ geometry|left=3cm,right=3cm,top=2.5cm,bottom=2.5cm,
+ includeheadfoot;
+ lipsum;
+ miscdef2;
+ amsmath;
+ amssymb;
+ ltxtools;
+ xwatermark|printwatermark;
+ hyperref|verbose=false,pdfpagemode=UseThumbs,
+ pdfview=FitB,pdfstartview=FitB;
+}
+\WrapQuotes
+\newprovidedcommands{%
+ \newdef\new@def,\renewdef\renew@def,\robustdef\robust@def,
+ \robustredef\robust@redef,\providedef\LTS@providedef,
+ \providerobustdef\LTS@providerobustdef
+}
+\newdef\hspce{\hspace{1cm}}
+\nameabbrev\lppl{\LaTeX\ Project Public License}[LPPL]
+\providerobustdef*\eg{%
+ \CurrIfnextchar.{e.\,g\sspace}{e.\,g.\@\sspace}%
+}
+\providerobustdef*\ie{%
+ \CurrIfnextchar.{i.\,e\sspace}{i.\,e.\@\sspace}%
+}
+\shelllet\tcl=\textcolor
+\providerobustdef*\xcopyright#1{%
+ \unskip\tcl{#1}{\textsuperscript{\copyright}}%
+}
+\robustdef*\xxcopyright{%
+ \mbox{\textcopyright~\lower.7\p@\hbox{\uppercase
+ \expandafter{\romannumeral\year}}}\sspace
+}
+\robustdef*\colorbullet#1{\tcl{#1}{\textbullet}\sspace}
+\providerobustdef*\pkg{%
+ \CurrIfnextchar'%
+ {\@firstoftwo{\@tempswatrue\xwm@pkg}}
+ {\@tempswafalse\xwm@pkg}%
+}
+\robustdef*\xwm@pkg#1{%
+ \tcl{ForestGreen}{\texttt{#1}}\if@tempswa\@space package\fi
+}
+\providerobustdef*\email{\hyper@normalise\xwm@email}
+\robustdef*\xwm@email#1{\href{mailto:#1}{#1}}
+\providedef*\impnote{\emph{Important note}:\space}
+\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 = \tcl{blue}{\today},
+ header-right = Ahmed Musa,
+ footer-center = \pkg'{xwatermark},
+ header-center = \textsf{\tcl{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}
+
+\csndef*{watermark-2}{%
+ % The macro \xxx below is an unlikely example definition,
+ % but it provides a test of xwatermark schemes:
+ \def\xxx##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}\tcl{red}{\textbullet}%
+ \hspce The marks on these pages were
+ placed effortlessly by using the \pkg'{xwatermark}
+ \hspce\tcl{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}\tcl{red}{\textbullet}%
+ \hspce Page~\thepage~of~\pageref*{xwmlastpage}\hspce
+ \tcl{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}%
+ \tcl{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}\tcl{red}{\textbullet}%
+ \hspace{4.3cm}User manual for the \pkg'{xwatermark}
+ \hspace{4.3cm}\tcl{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}%
+}
+\csndef*{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}%
+ }%
+}
+
+\csndef*{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}%
+ \tcl{red}{$\blacktriangleright$}\hspce The~
+ \texttt{\tcl{white}{xwatermark}}~
+ package\hspce\tcl{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}%
+ \tcl{red}{$\blacktriangleright$}\hspace{2.1cm}%
+ Page~\thepage~of~\pageref*{xwmlastpage}%
+ \hspace{2cm}\tcl{red}{$\blacktriangleleft$}\hspce
+ \color{white}\framebox[2.1cm][t]{\phantom{Hello}}%
+ \rotatebox[origin=c]{90}{\makebox[1.4cm][c]{\phantom{Hello}}}%
+ }%
+}
+\csndef*{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!}}%
+}
+\csndef*{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}}%
+ }%
+}
+
+\csndef*{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{\tcl{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-examples.pdf b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples.pdf
deleted file mode 100644
index 5a5ade841fe..00000000000
--- a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples.tex b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples.tex
deleted file mode 100644
index 669457b6437..00000000000
--- a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples.tex
+++ /dev/null
@@ -1,181 +0,0 @@
-%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%
-% This is file xwatermark-examples.tex, which demonstrates the use %
-% of the xwatermark package, version 1.4. %
-% %
-% (c) Ahmed Musa 2010 %
-%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%
-\documentclass[a4paper,11pt,final]{article}
-\InputIfFileExists{xwatermark-guide.cfg}{}{%
- \errmessage{No file xwatermark-guide.cfg or wrong path}}
-\begin{document}
-\MakeShortVerb{\+}
-\title{\bfseries The \texttt{\textcolor{blue}{xwatermark}}
- \xcopyright{Package}{red}\\[1ex]
- \large Version 1.4\\[2ex]
- \Large EXAMPLES}
-\author{Ahmed Musa\\[1ex]University of Central Lancashire\\
- Preston PR1 2HE, United Kingdom\\[1ex]
- \email{a.musa@rocketmail.com}}
-\maketitle
-
-\pagestyle{fancyplain}
-
-\watermarksetup{fontfamily=bch,color=magenta!60!blue!25,align=center,
- angle=45,scale=0.7,xcoord=0,ycoord=0,textmark=\xtempd
-}
-
-\section{Introduction}
-\lletter{T}{he source} file of this document is +xwatermark-examples.tex+ and is available from CTAN as part of the +xwatermark+ bundle. A full user guide is also part of the bundle.
-
-\section{User interface}
-\lletter{T}{he package} may be loaded with full options such as in the following two sample statements:
-
-\begin{xwverbatim}
-\usepackage[printwatermark=true,allpages=true,
- fontfamily=pag,color=gray!25,textmark=DRAFT,
- angle=45,scale=0.8,xcoord=0,ycoord=0]{xwatermark}
-
-\usepackage[printwatermark,pages=1-4,fontfamily=phv,
- color=red!55!yellow!50,textmark=CONFIDENTIAL,angle=55,
- scale=0.8,xcoord=20,ycoord=10]{xwatermark}.
-\end{xwverbatim}
-
-The option +printwatermark=true+ (or +printwatermark=false+) and the one that specifies the pages on which the watermark should appear (+allpages+, +oddpages+, +evenpages+, \etc) should be set when loading the package, \eg,
-\begin{xwverbatim}
-\usepackage[printwatermark,evenpages]{xwatermark}.
-\end{xwverbatim}
-The remaining options can be set dynamically using the +\watermarksetup+ macro. These other options can, if desired, be set for each page of the document.
-\par
-\lipsum[1-3]
-\watermarksetup{textmark={}}
-\watermarksetup{fontfamily=put,color=white,fontsize=3cm,scale=1,
- picbb=112 619 242 751,picscale=3,picfile={./Graphics/xwatermarkpic},picfilex=eps,
- width=\paperheight,align=center,angle=0,xcoord=0,ycoord=0
-}
-
-\newpage
-\lipsum[1-4]
-\watermarksetup{textmark={}}
-\watermarksetup{picfile={}}
-\watermarksetup{fontfamily=put,color=white,fontsize=3cm,scale=1,
- width=\paperwidth,align=center,angle=45,xcoord=0,ycoord=0,
- textmark={%
- \xwcolorbox{framesep=5pt,framerule=6pt,fillcolor=yellow,
- textcolor=white,align=center,width=.9\paperwidth,
- text={New\\[.25ex]
- \color{green}\framebox[1.1\width]{\textcolor{white}{Systems}}%
- \\[.25ex]\color{white}Department}%
- }%
- }%
-}
-\newpage
-\lipsum[1-4]
-\watermarksetup{fontfamily=pbk,color=gray!35,fontsize=3cm,fontseries=b,
- align=center,angle=45,scale=1,xcoord=0,ycoord=0,width=\paperwidth,
- textmark={%
- \xwminipage{width=\paperwidth,align=center,textcolor=gray!35,
- framesep=4pt,framerule=4pt,framecolor=green,
- text={\raggedright\textcolor{blue!65}{Restricted}\\[.25ex]\hfill Document
- }}}%
-}
-
-\newpage
-\lipsum[1-4]
-\watermarksetup{fontfamily=pbk,color=gray!35,fontsize=3cm,fontseries=b,
- align=center,angle=90,scale=.88,xcoord=0,ycoord=-2,width=\paperheight,
- textmark={%
- \xwminipage{framesep=15pt,framerule=6pt,framecolor=orange,
- width=1.2\textheight,align=center,textcolor=gray!35!red,
- text={\raggedright{\color{blue!65}Restricted}\\[.25ex]\hfill Document}%
- }}%
-}
-
-\newpage
-\lipsum[1-4]
-\watermarksetup{fontfamily=bch,color=purple!70,
- width=\paperheight,angle=45,fontsize=5cm,scale=.7,xcoord=-30,ycoord=7,
- textmark={\fboxsep=15pt\fboxrule=6pt\hspace{.5cm}%
- \fbox{\textcolor{orange!85}{@}}%
- \\[.25ex]\fboxsep=15pt\fboxrule=16pt\color{cyan}%
- \fbox{\textcolor{red!85}{Intel}\textcolor{orange!85}{BiZ}%
- \textcolor{red!45}{Forum}}}%
-}
-
-\newpage
-\lipsum[1-4]
-\fboxsep=5pt\fboxrule=4pt
-\watermarksetup{fontfamily=cmss,angle=90,fontsize=5cm,fontseries=bx,
- scale=.8,align=center,color=red!75!blue!25,xcoord=-65,ycoord=0,
- textmark={=\fbox{\color{red!65}Official}=\\[.25ex]Document}%
-}
-
-\newpage
-\lipsum[1-4]
-\watermarksetup{showcenter=false,fontfamily=phv,angle=90,scale=.8,
- align=center,color=yellow!75,coordunit=pc,xcoord=0,ycoord=0,
- width=1.3\textheight,
- textmark={%
- \xwminipage{framesep=10pt,framerule=6pt,framecolor=yellow,
- width=1.3\textheight,align=center,
- text={\color{red!55}Control\\[3.4ex]\color{violet!55}Version}%
- }
- }
-}
-
-\newpage
-\lipsum[1-4]
-\colorlet{lightblue}{cyan!50!blue!25}
-\watermarksetup{fontfamily=pnc,fontsize=5cm,color=lightblue,coordunit,
- width=\paperheight,angle=50,scale=0.8,xcoord=0,ycoord=0,
- textmark={%
- \xwcolorbox{width=\paperheight,fillcolor=cyan!50!blue!25,textcolor=blue,
- framesep=10pt,framerule=6pt,text=PENDING%
- }%
- }%
-}
-
-\newpage
-\lipsum[1-4]
-\watermarksetup{fontfamily=bch,color=xyellow3,coordunit,
- align=center,angle=90,scale=0.7,xcoord=0,ycoord=-5,width=\paperheight,
- textmark={\color{teal!55}\fboxsep=10pt\fboxrule=6pt\fbox{%
- \xwminipage{width=\paperheight,align=center,text={%
- {\color{purple!55}\fbox{\color{xyellow3}%
- \fbox{\textcolor{red}{Unrestricted}}}}\\[.25ex]
- \color{xyellow3}For General\\[.25ex] Circulation
- }}}}%
-}
-
-\newpage
-\lipsum[1-4]
-\watermarksetup{showcenter,fontfamily=txtt,fontseries=m,color=red,
- align=center,scale=0.7,angle=0,xcoord=0,ycoord=0,
- textmark={%
- \xwminipage{width=\paperwidth,text={%
- \xwminipage{width=\paperwidth,align=left,textcolor=magenta,
- text={\TeX\\[.1ex] \LaTeX}}%
- \\[1ex]
- \xwminipage{width=\paperwidth,align=center,textcolor=green,
- text={\TeX\\[.1ex] \LaTeX}}%
- \\[1ex]
- \xwminipage{width=\paperwidth,align=right,textcolor=orange,
- text={\TeX\\[.1ex] \LaTeX}}%
- }}}
-}
-
-\newpage
-\lipsum[1-4]
-\watermarksetup{showcenter=false,fontfamily=cmr,fontsize=11pt,
- fontseries=m,color=red,coordunit=mm,align=center,
- scale=1,angle=90,xcoord=-77,ycoord=62,
- textmark={\fboxsep=4pt\fboxrule=4pt\fbox{%
- \xwminipage{width={0.6\textwidth},textcolor=black,align=left,
- text={\sffamily
- This text was placed here using the \stya{xwatermark} package.
- The wonders of \textcolor{red}{\TeX}\bfseries{!}%
- }}}}%
-}
-
-\end{document}
-
-%%% End of file xwatermark-examples.tex %%%
diff --git a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples1.pdf b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples1.pdf
new file mode 100644
index 00000000000..20f2bd5f96a
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples1.tex b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples1.tex
new file mode 100644
index 00000000000..5bf59158743
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples1.tex
@@ -0,0 +1,95 @@
+%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%
+% This is file 'xwatermark-examples1.tex', version 1.5.1. %
+% %
+% IMPORTANT NOTICE: %
+% This example file is not user compilable! The packages needed %
+% to compile the examples are not yet available in the public %
+% domain. This does not affect the functions of the %
+% xwatermark package. I am sorry, but I can't answer requests for %
+% packages not yet released. Users can copy the examples into their %
+% own files and compile them, removing all undefined commands. %
+% %
+% 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-2011 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.6,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.7,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{\tcl{blue}{xwatermark}} Package
+ \xcopyright{red}\\[1ex]
+ \large Version 1.5.1\\[2ex]
+ \Large EXAMPLES (File 1)%
+}
+\author{%
+ \textbf{Ahmed Musa}\\Preston, United Kingdom\\
+ \email{amusa22@gmail.com}
+}
+\maketitle
+
+\thispagestyle{empty}
+
+\newpage
+\noindent
+\lipsum[1-3]
+
+\newpage
+\lipsum[1-4]
+
+\newpage
+\lipsum[1-4]
+
+\newpage
+\lipsum[1-4]
+
+\newpage
+\lipsum[1-4]
+
+\newpage
+\lipsum[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
new file mode 100644
index 00000000000..d1552264ce7
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples2.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples2.tex b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples2.tex
new file mode 100644
index 00000000000..2c93785bb80
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples2.tex
@@ -0,0 +1,205 @@
+%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%
+% This is file 'xwatermark-examples2.tex', version 1.5.1. %
+% %
+% IMPORTANT NOTICE: %
+% This example file is not user compilable! The packages needed %
+% to compile the examples are not yet available in the public %
+% domain. This does not affect the functionalities of the %
+% xwatermark package. I am sorry, but I can't answer requests for %
+% packages not yet released. Users can copy the examples into their %
+% own files and compile them, removing all undefined commands. %
+% %
+% 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-2011 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
+]{\tcl{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=lt,
+ 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\tcl{red}{\string\knowledge}%
+ \string\by\tcl{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
+]{\tcl{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{%
+ \newwatermark[%
+ pages=6-7,fontfamily=pbk,textcolor=gray!35,fontsize=12pt,fontseries=n,
+ textalign=center,textangle=90,textscale=1,textxpos=#1,textypos=-1,
+ 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}\tcl{red}{$\blacktriangleright$}%
+ \hspace{2.1cm}Page \thepage~of~\pageref{xwmlastpage}%
+ \hspace{2.1cm}\tcl{red}{$\blacktriangleleft$}\hspace{1cm}%
+ \color{white}\framebox[2cm][t]{\phantom{Hello}}%
+ \xwmstrut{9mm}{6mm}%
+ }%
+ }%
+}
+\begin{newcomment}
+The same watermark is placed twice on the same page.
+Compare this with one of the examples in xwatermark-examples1.tex:
+\end{newcomment}
+\usecsn{watermark-2a}{-.43\paperwidth}
+\usecsn{watermark-2a}{.445\paperwidth}
+
+\begin{newcomment}
+Here is an inefficient example. \scalebox and \rotatebox
+could have been more efficiently achieved in the following
+example:
+\end{newcomment}
+\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\tcl{white}{\char`\\advance}%
+ \tcl{red}{\string\knowledge}%
+ \string\by\tcl{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{\tcl{blue}{xwatermark}} Package
+ \xcopyright{red}\\[1ex]
+ \large Version 1.5.1\\[2ex]
+ \Large EXAMPLES (File 2)%
+}
+\author{%
+ \textbf{Ahmed Musa}\\Preston, United Kingdom\\
+ \email{amusa22@gmail.com}
+}
+\maketitle
+\thispagestyle{empty}
+
+\newpage
+
+\llipsum[1-4]
+
+\llipsum
+
+\newpage
+
+\llipsum[1-4]
+
+\newpage
+
+\llipsum[1-4]
+
+\newpage
+
+\llipsum[1-4]
+
+\newpage
+
+\llipsum[1-4]
+
+\newpage
+
+\llipsum[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 c1bab2cf13f..b6f5627ea40 100644
--- a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide.cfg
+++ b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide.cfg
@@ -1,214 +1,95 @@
-%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%
-% This is file xwatermark-guide.cfg, the configuration file for %
-% the files xwatermark-guide.tex and xwatermark-examples.tex, %
-% version 1.4. %
-% %
-% (c) Ahmed Musa 2010 (a.musa@rocketmail.com) %
-%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%
-\ProvidesFile{xwatermark-guide.cfg}%
- [2010/01/10 v1.4 Configuration file for xwatermark-guide.tex (AM)]
+%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%
+% This is file xwatermark-guide.cfg, version 1.5.1 %
+% %
+% Copyright (c) 2009-2011 Ahmed Musa (amusa22@gmail.com). %
+%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%
+
+\ProvidesFile{xwatermark-guide.cfg}
+ [2011/07/30 v1.5.1 Configuration file for xwatermark-guide.tex (AM)]
\NeedsTeXFormat{LaTeX2e}
-\usepackage[left=3cm,right=3cm]{geometry}
-\usepackage[scaled=0.9]{helvet}
-\usepackage{lettrine}
-\usepackage{lipsum}
-\usepackage{fancyhdr}
-\usepackage{shortvrb,fancyvrb}
-\usepackage{lastpage}
-\usepackage{xspace}
-\usepackage{parskip}
-\usepackage{ltxnew}
-\usepackage{varioref}
-\usepackage{multicol}
-\usepackage{array}
-\usepackage{colortbl}
-\usepackage{yfonts}
-\usepackage{amsmath,amssymb}
-\usepackage{pifont}
-\usepackage{bigfoot}
-\DeclareNewFootnote[plain]{default}
-\DeclareNewFootnote[plain]{B}[arabic]
-\MakeSortedPerPage{footnoteB}
-\usepackage[allpages,dgeometry]{xwatermark}
-\usepackage{url}
-\usepackage{ltablex}
-\keepXColumns
-\usepackage{hyperref}
-\hypersetup{colorlinks=true,linkcolor=red,pdfpagemode=UseThumbs,
- implicit=true,breaklinks=true,pagebackref=true,backref=true,
- bookmarks=true,bookmarksnumbered=true,hyperfootnotes=true,debug=true,
- naturalnames=false,citecolor=purple,pdfview=FitH,pdfstartview=FitH}
-\usepackage{doipubmed}
\makeatletter
-\renewcommand\section{\@startsection%
- {section}{1}{0mm}{-\baselineskip}{.5\baselineskip}%
- {\normalfont\normalsize\bfseries\large}}
-\renewcommand\subsection{\@startsection%
- {subsection}{2}{0mm}{-\baselineskip}{.5\baselineskip}%
- {\normalfont\normalsize\bfseries\itshape}}
-\renewcommand\subsubsection{\@startsection%
- {subsubsection}{3}{0mm}{-\baselineskip}{.5\baselineskip}%
- {\normalfont\normalsize\itshape}}
-\renewcommand\@seccntformat[1]{%
- \fboxrule.5pt\fboxsep3pt\fcolorbox{red!65}{yellow!25}{%
- \upshape\expandafter\csname the#1\endcsname}\kern1em%
+\newprovidedcommands{%
+ \newdef\new@def,\renewdef\renew@def,\robustdef\robust@def,
+ \providerobustdef\LTS@providerobustdef
}
-\xglobal\definecolorset{rgb}{x}{1}{green,0.00,0.50,0.00;%
- magenta,0.50,0.00,0.50;blue,0.50,0.00,1.00;purple,0.50,0.00,0.25}
-\colorlet{xyellow2}{brown!25!yellow!75}
-\colorlet{xyellow3}{magenta!10!yellow!85}
-\date{\textcolor{purple}{\today}\vadjust{\kern2ex\hrule}}
-\renewcommand*\reftextcurrent{on this page}
-\newcommand*\nTeX{\TeX\xspace}
-\newcommand*\nLaTeX{\LaTeX\xspace}
-\def\La{\leavevmode L\raise.42ex\hbox{\footnotesize\kern-.35em A}}
-\newcommand*\TeXorLaTeX{\hbox{(\/\La\kern-.15em\/)\kern-.1em\TeX}}
-\newcommand*\TeXL{\TeXorLaTeX\xspace}
-\newcommand*\Xe{\leavevmode X\kern-.125em\lower.5ex\hbox{\reflectbox{E}}}
-\def\XeTeX{\mbox{\Xe\kern-.1667em\TeX}\xspace}
-\def\XeLaTeX{\mbox{\Xe\kern-.15em\TeXorLaTeX}}
-\def\pdfTeX{pdf\nTeX}
-\renewcommand{\LettrineFontHook}{\bfseries\gothfamily\color{red}}
-\renewcommand{\LettrineTextFont}{\sffamily\scshape}
-\def\lettrineops{lines=2,lhang=0.1,loversize=0.1,lraise=0.1,%
- nindent=0pt,findent=0.1em}
-\def\lletter{\begingroup\edef\1{\endgroup\noexpand\lettrine[\lettrineops]}\1}
-\def\bibfont{\normalfont\small}
-\newcommand*\helv{\fontfamily{phv}\selectfont\color{xpurple1}}
-\def\eg{\@ifnextchar.{e.g}{e.g.}\xspace}
-\def\ie{\@ifnextchar.{i.e}{i.e.}\xspace}
-\def\etc{\@ifnextchar.{etc}{etc.}\xspace}
-\newcommand*\email[1]{\href{mailto:#1}{#1}}
-\newrobustcmd*\stya[1]{\textcolor{xgreen1}{#1}\xspace}
-\newrobustcmd*\styb[1]{\textcolor{teal}{#1}\xspace}
-\newrobustcmd*\cmda[1]{\textcolor{xgreen1}{\textbackslash#1}\xspace}
-\newrobustcmd*\cmdb[1]{\textcolor{teal}{\textbackslash#1}\xspace}
-\newrobustcmd*\usepackxwm{\cmda{usepackage\{xwatermark\}}}
-\newrobustcmd*\dclass{\cmdb{documentclass}}
-\newrobustcmd*\wmsetup{\cmda{watermarksetup}}
-\def\copyrightyear{\copyright~\uppercase\expandafter{\romannumeral\year}\xspace}
-\def\colorbullet#1{\textcolor{#1}{\textbullet}\xspace}
-\newrobustcmd*\xcopyright[2]{%
- \leavevmode#1\textcolor{#2}{\textsuperscript{\copyright}}\xspace}
-\newrobustcmd*\XWM{\stya{\bf\textbackslash watermarksetup}\xspace}
-\newrobustcmd*\DCL{\stya{\bf\textbackslash documentclass}\xspace}
-\newrobustcmd*\XWCB{\stya{\bf\textbackslash xwcolorbox}\xspace}
-\newrobustcmd*\YWCB{\stya{\bf\textbackslash ywcolorbox}\xspace}
-\newrobustcmd*\XWMP{\stya{\bf\textbackslash xwminipage}\xspace}
-\newcommand*\xmaketitle[1][plain]{\maketitle\thispagestyle{#1}\pagestyle{#1}}
-\CustomVerbatimEnvironment{xwverbatim}{Verbatim}{numbers=left,
- numberblanklines=false,firstnumber=last,frame=single,rulecolor=\color{xyellow2},
- framerule=2pt,framesep=2pt, fillcolor=\color{violet!55},formatcom=\color{blue},
- xrightmargin=0pc,commandchars=\|\(\),commentchar=\&}
-\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}
-\fancyhf{}
-\fancyhfoffset[R,L]{\dimexpr\marginparsep+\marginparwidth\relax}
-\lhead{\helv The \texttt{\textcolor{blue}{xwatermark}} Package}
-\rhead{\helv Page~\thepage~of~\pageref*{LastPage}}
-\renew\def\headrule{\color{blue}\hrule height1pt width\headwidth\relax
- \vspace{2pt}\hrule height1pt width\headwidth\vspace{-2pt}}
-\renew\def\footrule{\color{green}\hrule height1pt width\headwidth\relax
- \vspace{2pt}\hrule height1pt width\headwidth\vspace{2pt}}
-\new\long\def\xtempa{%
- \xwcolorbox{fillcolor=gray!55,width=\paperheight,align=center,
- framesep=5pt,framerule=2pt,framecolor=white,%
- text={\color{white}\framebox[2cm][c]{\phantom{Hello}}\hspace{1cm}\color{black}%
- \textcolor{red}{\textbullet}\hspace{1cm}The marks on these pages were placed effortlessly
- by using the \textcolor{blue}{xwatermark} package\hspace{1cm}%
- \textcolor{red}{\textbullet}\hspace{1cm}\color{white}\framebox[2cm][c]{\phantom{Hello}}%
- \rotatebox[origin=c]{90}{\makebox[1.4cm][c]{\phantom{Hello}}}%
- }}\\[0cm]%
- \rotatebox[origin=c]{-90}{\raisebox{-13.8cm}[0cm][0cm]{%
- \hspace*{-.1mm}%
- \xwcolorbox{framesep=5pt,framerule=2pt,fillcolor=yellow!75,framecolor=white,
- align=center,width=.81\paperwidth,%
- text={%
- \color{white}\framebox[2cm][c]{\phantom{Hello}}\hspace{1cm}\color{black}%
- \textcolor{red}{\textbullet}%
- \hspace{1cm}Page~\thepage~of~\pageref*{LastPage}\hspace{1cm}%
- \textcolor{red}{\textbullet}\hspace{1cm}%
- \color{white}\framebox[2cm][c]{\phantom{Hello}}%
- \rotatebox[origin=c]{90}{\makebox[1.4cm][c]{\phantom{Hello}}}%
- }}}}\\[0cm]%
- \rotatebox[origin=c]{-90}{\raisebox{13.45cm}[0cm][0cm]{\makebox[0cm][r]{%
- \xwcolorbox{framesep=5pt,framerule=2pt,fillcolor=yellow!55,framecolor=white,
- align=justified,width=.81\paperwidth,%
- text={\normalfont\small\color{blue}\vspace*{-1ex}%
- \begin{center}\colorbullet{red}\copyrightyear Ahmed Musa \colorbullet{red}\end{center}%
- This work (i.e., all the files in the \stya{xwatermark} manifest) may be distributed and/or modified under the conditions of the \LaTeX\ Project Public License (LPPL), either version 1.3 of this license or any later version.
- 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.
- }}}}}%
- \\[0cm]%
- \xwcolorbox{framesep=5pt,framerule=2pt,fillcolor=gray!55,framecolor=white,
- align=center,width=\paperheight,
- text={%
- \color{white}\framebox[2cm][c]{\phantom{Hello}}\hspace{1cm}\color{black}%
- \textcolor{red}{\textbullet}%
- \hspace{4.3cm}User manual for the \textcolor{blue}{xwatermark} package\hspace{4.3cm}%
- \textcolor{red}{\textbullet}\hspace{1cm}%
- \color{white}\framebox[2cm][c]{\phantom{Hello}}%
- \rotatebox[origin=c]{90}{\makebox[1.4cm][c]{\phantom{Hello}}}%
- }}%
-}%
-\new\long\def\xtempb{%
- \centering\xwcolorbox{align=center,fillcolor=white,width=.5\hsize,
- text={\bfseries Abstract}}\\[1ex]%
- The \stya{xwatermark} package enables the user to effortlessly put customized text and graphic watermarks on select pages of documents at desired positions and orientations. The features of the individual watermarks are specified by means of user-friendly key-value interfaces.
+\providerobustdef*\colorbullet#1{\textcolor{#1}{\textbullet}\sspace}
+\newvariables{dimen}[col]{one,two,three,total}[\z@pt]
+\new@def*\whline{%
+ \noalign{\global\let\savedarw\arrayrulewidth
+ \gdef\arrayrulewidth{1pt}}%
+ \hline
+ \noalign{\global\let\arrayrulewidth\savedarw}%
}
-\new\long\def\xtempc{%
- \xwcolorbox{fillcolor=teal,width=\paperheight,align=center,
- framesep=5pt,framerule=2pt,framecolor=magenta,
- text={\color{white}\framebox[2cm][t]{\phantom{Hello}}%
- \hspace{1cm}\color{orange!85!red!55}%
- \textcolor{red}{$\blacktriangleright$}\hspace{1cm}The~%
- \texttt{\textcolor{white}{xwatermark}}~%
- package\hspace{1cm}\textcolor{red}{$\blacktriangleleft$}\hspace{1cm}\color{white}%
- \framebox[2cm][t]{\phantom{Hello}}%
- \rotatebox[origin=c]{90}{\makebox[1.4cm][c]{\phantom{Hello}}}%
- }}\\[0cm]%
- \rotatebox[origin=c]{-90}{\raisebox{-14.35cm}[0cm][0cm]{%
- \hspace*{-.1mm}%
- \xwcolorbox{framesep=5pt,framerule=2pt,fillcolor=red!75!blue!45,framecolor=white,
- align=center,width=.81\paperwidth,%
- text={a.musa@rocketmail.com},textcolor=white}}}%
- \\[0cm]%
- \rotatebox[origin=c]{-90}{\raisebox{14.34cm}[0cm][0cm]{%
- \makebox[0cm][r]{%
- \xwcolorbox{framesep=5pt,framerule=2pt,fillcolor=green!75!blue!50,framecolor=white,
- align=center,width=.81\paperwidth,textcolor=white,
- text={\copyrightyear Ahmed Musa}%
- }}}}\\[0cm]%
- \xwcolorbox{framesep=5pt,framerule=2pt,fillcolor=teal,framecolor=magenta,
- align=center,width=\paperheight,text={%
- \color{white}\framebox[2cm][t]{\phantom{Hello}}\hspace{1cm}\color{orange!85!red!55}%
- \textcolor{red}{$\blacktriangleright$}\hspace{2.1cm}Page~\thepage~of~\pageref*{LastPage}%
- \hspace{2cm}\textcolor{red}{$\blacktriangleleft$}\hspace{1cm}%
- \color{white}\framebox[2.1cm][t]{\phantom{Hello}}%
- \rotatebox[origin=c]{90}{\makebox[1.4cm][c]{\phantom{Hello}}}%
- }}%
+\newcolumntype{I}{!{\color{red}\vrule width 1pt}}
+\newcolumntype{W}{>{\hspace{0pt}\arraybackslash}m{\colthree}}
+\newcolumntype{M}{>{\rightskip-.4cm}m{\dimexpr\coltotal+.5cm}}
+
+\amltxoptions{%
+ geometry-options = {left=3cm,right=3cm,top=2.5cm,%
+ bottom=2.5cm,includeheadfoot},
+ review-document = false,
+ parindent = false,
+ toc = false,
+ frontpagestyle = empty,
+ pretitleskip = 0ex,
+ posttitleskip = 1ex,
+ presuptitleskip = .1\paperheight,%15ex,
+ postsuptitleskip = 0ex,
+ presubtitleskip = 0ex,
+ postsubtitleskip = 0ex,
+ postauthorskip = 3cm,
+ natbib-options = {numbers,sort&compress},
+ command-color = xmagenta1,
+ style-color = xgreen1,
+ special-color = teal,
+ section-head-color = blue
}
-\newcommand\xtempd{%
- \xwcolorbox{framesep=5pt,framerule=2pt,framecolor=blue!35,
- align=center,width=\paperheight,textcolor=magenta!60!blue!25,
- text={Hello world,}}%
- \\[.25ex]%
- \xwcolorbox{framesep=5pt,framerule=2pt,framecolor=white,
- fillcolor=brown!55,align=center,width=\paperheight,
- textcolor=red!45,text={We're here}}%
+\AfterStartOfDocument{%
+ \renewdef*\thefootnote{\fnsymbol{footnote}}%
}
-\makeatother
-\endinput
+\robustdef*\otherchars{\quoted{other} characters\sspace}
+\newdef*\impnote{\emph{Important note}:\space}
+\let\sectionbreak\medbreak
+\newletcs\mccolor\makemaccolor
+\newletcs\pucolor\makepurple
+
+\ifamd@tablefile\else
+
+\usepackage[persistent]{xdocmute}
-%%% End of file xwatermark.cfg %%% \ No newline at end of file
+\fancypagenos[%
+ show-on-page-one = false,
+ show-page-numbers = true,
+ show-headrule = true,
+ show-footrule = false,
+ y-position = -.45\paperheight,
+ x-position = 0,
+ scale = 1,
+ angle = 0,
+ left-header = {The \textcolor{maccolor}{xwatermark} package},
+ style = {\textsc{Page~\thepage~of~\pageref{xwmlastpage}}},
+ right-header = \tcl{black}{\today}
+]
+
+\newwatermark
+[page=1,fontfamily=phv,fontsize=11pt,fontseries=m,align=center,
+ coordunit=pc,width=.975\paperwidth,angle=0,scale=1,xpos=-.62,ypos=31.7]{%
+ \xwmcolorbox[framesep=5pt,framerule=2pt,fillcolor=white,
+ outerframecolor=purple,innerframecolor=brown,textalign=justified,
+ width=.975\paperwidth]{%
+ \normalfont\small\color{black}\vspace*{-1ex}%
+ \parbox{.95\paperwidth}{%
+ \begin{center}\colorbullet{red}\hspace{1cm}\licensename\hspace{1cm}%
+ \colorbullet{red}\end{center}\vspace*{1ex}%
+ 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. \CopyrightYear\vspace*{1ex}%
+ }%
+ }%
+}
+\fi
+
+\endinput
diff --git a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide.pdf b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide.pdf
index 8732326df72..10df084b7f0 100644
--- a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide.pdf
+++ b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide.tex b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide.tex
index 45298543936..7fc6792dc5e 100644
--- a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide.tex
+++ b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide.tex
@@ -1,547 +1,653 @@
-%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%
-% This is file xwatermark-guide.tex, the documentation for the %
-% xwatermark package, version 1.4. %
-% %
-% (c) Ahmed Musa 2010 (a.musa@rocketmail.com) %
-%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%
-\documentclass[a4paper,11pt,final]{article}
-\InputIfFileExists{xwatermark-guide.cfg}{}{%
- \errmessage{No file xwatermark-guide.cfg or wrong path}}
-\begin{document}
-\MakeShortVerb{\+}
-\watermarksetup{fontfamily=phv,fontsize=11pt,fontseries=m,align=center,
- height=\paperheight,width=\paperheight,angle=90,scale=1,xcoord=0,ycoord=-1,
- textmark=\xtempa
+\makeatletter
+\documentclass[
+ use-a4-paper,
+ use-10pt-font,
+ final-version,
+ use-UK-English,
+ fancy-section-headings,
+ frame-section-numbers,
+ para-abstract-style,
+ input-config-file,
+ no-hyperref-messages,
+ option-stack-limit=4,
+ inputfile=true
+]{amltxdoc}
+
+\makeindex
+\ifdefTF\newgeometry{}{%
+ \let\newgeometry\@gobble
+ \let\restoregeometry\relax
}
-\label{page:one}
-\title{\bfseries The \texttt{\textcolor{blue}{xwatermark}}
- \xcopyright{Package}{red}\kern-.25em\FootnoteB{\ding{'111}}{The \stya{xwatermark}
- bundle is available at the Comprehensive \nTeX Archive Network
- \citeurl{http://tug.ctan.org/tex-archive/macros/latex/contrib/xwatermark}}
- \\[1ex]\large Version 1.4
+\begin{document}
+
+\begin{frontmatter}
+\title{The \texttt{\color{blue}xwatermark} Package\titleref{t1}}
+\titlenote[t1]{The package is available at
+ \iftogTF{pdf}{\url{\@titleurl}}{\url{\@shorttitleurl}}.
}
-\author{Ahmed Musa\\[1ex]University of Central Lancashire\\
- Preston PR1 2HE, United Kingdom\\[1ex]
- \email{a.musa@rocketmail.com}
+\version{1.5.1}
+\titleurl{http://www.ctan.org/tex-archive/macros/latex/contrib/xwatermark/}
+\shorttitleurl{http://www.ctan.org/}
+\author{Ahmed Musa\Email{amusa22@gmail.com}\\Preston, Lancashire, UK}
+
+\let\abstractname\relax
+\begin{abstract}
+\makecolorbox[framesep=4pt, framerule=1pt, innerframecolor=red!55,
+ outerframecolor=ForestGreen, align=justified, fillcolor=white,
+ width=\textwidth, boxalign=center, height=.25cm, depth=0cm,framebox]{%
+ \centering\xwmcolorbox[align=center, fillcolor=white, innerframecolor=blue, outerframecolor=orange, width=.5\hsize, height=2.5mm]{\textbf{Abstract}} \\[\baselineskip]
+ The \pkg{xwatermark} package puts user-supplied watermarks (graphics and/or arbitrary texts) on select pages of documents using user-friendly key-value interfaces. It has more functionality and dynamism than, for example, the packages \pkg'{draftcopy, draftwatermark, watermark, draftmark, wallpaper}. More than one (graphics and/or text) watermark can be placed jointly or independently on the same document page or on select pages. Watermarks can be placed in the page background or foreground, and watermarks can conveniently be placed on select pages as rectangular or square tiles, depending on the user's choice. Some utility macros, namely, \ffx'{\xwmminipage, \xwmcolorbox, \makecolobox, \fancypagenos} are also provided by the package for handy use in creating watermarks and for other uses. Watermarks (especially wallpapers) take their toll on computer resources, especially speed and save stack size. The packages in the \pkg{xwatermark} bundle (and beyond) have been optimized as much as currently possible. In many instances more than one run of the document will be needed to get the watermarks on the desired pages, especially if the user calls \fx{\lastdocpage} to get the last page of the document.
}
-\xmaketitle[empty]
+\end{abstract}
+\end{frontmatter}
-\ywcolorbox{framesep=5pt,framerule=2pt,framecolor=red!55!brown,
- align=justified,fillcolor=gray!25,width=\hsize,
- text=\xtempb
-}
+\vspace{4\baselineskip}
-\bgroup\small\tableofcontents\egroup
+\newpage
-\watermarksetup{textmark={}}
-\watermarksetup{fontfamily=phv,fontsize=11pt,fontseries=m,align=center,
- height=\paperheight,width=\paperheight,angle=90,scale=1,xcoord=0,ycoord=-1,
- textmark=\xtempc
-}
+\begin{xwmshade}[fillcolor=white,framecolor=orange,framerule=1pt,framesep=2pt,
+ width=\hsize]\tableofcontents
+\end{xwmshade}
+
+
+\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}. The advantages of \pkg'{xwatermark} over these earlier packages include:
+
+\begin{enum}
+\item Both text and graphics watermarks are admissible within any watermark item or instance.
+\item The user can dynamically customize the attributes (color, position, orientation, scale, the page(s)---first page, last page, all pages, odd pages, even pages, a particular page, and a range of pages---on which the watermark should appear) of each watermark.
+\item Watermarks can be placed in the background and in the foreground of document pages by simple instructions.
+\item Rectangular and square wallpapers can be produced from watermarks to suit user needs without effort.
+\item All the command options/keys are passed directly via user-friendly key-value interfaces, instead of being defined in the source file by several macros. There are only two main user commands: \ffx'{\newwatermark, \newwallpaper}. The user is relieved of the need to remember and deploy several different macros, except, of course, that function keys are used. The list of keys and their default values for these functions are given in \amref{sec:packageoptions}.
+\end{enum}
+
+With the \pkg'{xcolor} (not loaded automatically by the \pkg'{xwatermark}), all colors (including \hx{white}, shades like \hx{-red!75!green!50}, and those defined within the user document) can be passed to this package. And, as mentioned above, both texts and pictures can be submitted and printed as watermarks on the same page, and on different positions.
+
+There are global and local package options. These are listed and explained in
+\amref{sec:packageoptions}.
+
+Users who have since complained of not being able to conveniently place more than one watermark on the same page can now heave a sigh relieve: the current version of the package has enabled this functionality. You can now mix text and graphics watermarks and wallpapers and place as many of them as you like on the same page. This version of the package comes with an optimized looping macro and a key management system (the \pkg'{ltxkeys}) to enable several watermarks and wallpapers to be placed efficiently on the same document pages.
+
+
+\docsection(sec:user-interface){User interfaces}
+
+\docsubsection{Loading the package}
+
+In style files the package may be loaded with \hx{\RequirePackage} and in document files with \hx{\usepackage} together with the package keys that can be passed as options.
+
+\Note Some of the keys are \quoted{option keys}, \ie, they can appear only in \hx{\documentclass} or \hx{\usepackage} and not as, or in, arguments of other functions or macros. The \quoted{non-option keys} are those that can't appear in \hx{\documentclass} or \hx{\usepackage} but in the arguments of other macros. If a key is a non-option key and the user submits it to \hx{\documentclass} or \hx{\usepackage}, the package will alert the user. The same thing can be expected when a key is an option key and is submitted outside of \hx{\documentclass} or \hx{\usepackage}. The \quoted{need value} keys are keys that can't be called without a user-supplied value.
+
+The package keys \ffx'{printwatermark, disablegeometry} are option keys, and hence can be called as follows:
+
+\start'{example}[Package loading]
+\RequirePackage[printwatermark,disablegeometry]{xwatermark}|label(mac:pkgload)
+\usepackage[printwatermark,disablegeometry]{xwatermark}
+\finish{example}
+
+The other options may be submitted via user commands like \ffx'{\newwatermark, \newwallpaper}. Please see \amrefrange[tab:]{globaloptions,localoptions} for a full listing of all the available package and command options. By design, the boolean option \fx{printwatermark} should not appear in the macros \ffx'{\newwatermark, \newwallpaper} but as a package or \hx{\documentclass} option. It is disabled just before \hx{\begin{document}} and any attempt to pass it via \fx{\newwatermark} or \fx{\newwallpaper} thereafter will trigger an error.
+
+When boolean options (\eg, \ffx'{printwatermark,allpages}) are passed without values, they are assumed implicitly \hx{true} by the package.
+
+\Note When your watermark is not printed, first check that the option \fx{printwatermark} is \texttt{true}. This is one of the means to control the printing of watermarks. The others are through the following commands (more details are available in \amref{sec:dummywatermarks}):
+
+\start+'{newmacro}[\dummywatermark, \DiscardAllWatermarks, etc]
+\dummywatermark, \DiscardAllWatermarks, \UseDummyWatermarks,
+\DiscardDummyWatermarks
+\finish{newmacro}
+\fxi*{\dummywatermark, \DiscardAllWatermarks,
+ \UseDummyWatermarks, \DiscardDummyWatermarks}
+
+The option \fx{textmark} implies text watermarks, for which all the font properties can be selected. It does not apply to graphics watermarks. For graphics watermarks you need the keys: \fx{picfile} (the graphics/picture filename, with its full path but without its extension), and \fx{picfileext} (the file extension). Admissible file extensions are \hhx'{ps,eps,pdf,png,mps,jpeg}; they should be submitted without the dot. The extensions \hhx'{ps,eps} are for \hx{dvi} files, while the rest are for \hx{pdf} runs. Additional information is needed (see \amref{sec:pic-watermark})\footnote{When the options \ffx'{align ,height, width, angle, scale, xpos, ypos, color} appear without prefixes such as \fx{pic} or \fx{text}, they refer to the text watermark and not the graphics watermark. The user can thus use these options in place of \ffx'{textalign,textheight,textwidth, textangle, textscale, textxpos, textypos, textcolor}, respectively. However, options referring to graphics watermarks must always be prefixed with \fx{pic} (\eg, picfile).}.
+
+The following points should be noted about the values of the \fx{textmark}:
-\section{Introduction}
-
-\lletter{T}{his package} puts user-specified watermarks, pictures and/or arbitrary texts on select pages of documents. It has more functionality and dynamism than, for example, the packages \styb{draftcopy}, \styb{draftwatermark}, \styb{watermark}, and \styb{draftmark}\footnote{ These and other packages are available at the TUG CTAN website (\url{http://tug.ctan.org/cgi-bin/}).}. The advantages of \stya{xwatermark} package over these earlier packages include: both text and graphic watermarks are admissible; the user can specify his/her own watermark and color, the watermark position, orientation, the page(s) (all pages, odd pages, even pages, a particular page, and a range of pages) on which the watermark should appear; and all the options are passed directly to the package instead of being defined in the source file by several macros. Moreover, all these options can be customized for individual pages and segments of the document. This is achieved by the provision of the user-friendly \wmsetup macro, by which the user can dynamically set the watermark properties for each page or range of pages. The user is relieved of the need to remember and deploy several macros.
-
-With the \styb{xcolor} package (loaded by this package), all colors (including \styb{white}, shades like \styb{-red!75!green!50}, and those defined within the user document) can be passed to this package. And, as mentioned above, both texts and pictures can be submitted as watermarks to the package.
-
-This package uses Heiko Oberdiek's shipout hooks from the \styb{atbegshi} package.
-
-There are global and local package options. These are listed and explained in Appendix~\ref{sec:PackageOptions}.
-
-\section{User interface}
-\lletter{T}{he subsections} under this section describe how the user may interface with (\ie, use) the facilities of the package.
-
-\subsection{Loading the package}
-In the case of text watermarks, the package may be loaded with options such as in
-\begin{xwverbatim}
-\usepackage[
- printwatermark=true,allpages=true,fontfamily=pag,
- color=gray!25,textmark=I am happy,angle=45,fontsize=5cm,
- width=\paperwidth,fontseries=b,scale=0.8,
- xcoord=0,ycoord=0
- ]{xwatermark}
-\end{xwverbatim}
-or
-\begin{xwverbatim}
-\usepackage[printwatermark,pages=1-4,fontfamily=phv,
- fontsize=12pt,width=\paperheight,angle=55,scale=0.8,
- xcoord=20,ycoord=10,color=red!55!yellow!50,
- textmark=CONFIDENTIAL]{xwatermark}.
-\end{xwverbatim}
-
-By design, the boolean option \stya{printwatermark} should not appear in the macro \wmsetup but in the statement \usepackxwm or in the \dclass options list. It is disabled before \cmdb{begin\{document\}} and any attempt to change it thereafter will trigger an error.
-
-When boolean options (\eg, \stya{printwatermark} and \stya{allpages}) are passed without values, they are assumed implicitly \stya{true} by the package. The option \stya{printwatermark} may be set (\stya{printwatermark} or \stya{printwatermark=false}) when invoking the package, within the options list of either \dclass or \usepackxwm. Otherwise, the package will assume it to be \stya{true}.
-
-The \stya{textmark} key applies to text watermarks, for which all the font properties can be selected. It does not apply to graphic watermarks. For graphic watermarks you need the keys: \stya{picfile} (the graphic/picture filename, with its full path but without its extension), and \stya{picfilex} (the file extension). Admissible file extensions are \stya{eps}, \stya{pdf}, \stya{png}, and \stya{jpeg}; they should be submitted without the dot. Additional information is needed (see section~\ref{ssec:Picture-waterma}).
-
-The following points should be noted about the values of the \stya{textmark} key:
-\begin{itemize}
-\item The value of the \stya{textmark} may be any arbitrary multiline text, such as
-\begin{xwverbatim}
-textmark={Hello world,\\[.25\baselineskip] We're here},
-\end{xwverbatim}
-\item The value of \stya{textmark} may be arbitrary (blocks of) texts or even kernel or package commands, but not filenames on their own (except when submitted within, \eg, \cmdb{includegraphics}).
-\item If the \stya{textmark}'s value contains one or more commas, then it has to be enclosed in braces (as above), otherwise \TeXL will report an error. In any case, it is always safer to enclose long mark texts in braces. However, \emph{active characters} need further special treatment (see section~\ref{sec:Active-charact}).
-\item The \stya{width} (=markwidth) should be properly selected to match user's taste and the length of the \stya{textmark}. It may be set to \cmdb{paperwidth} or \cmdb{paperheight}, or any arbitrary length. Its default value is preset to \cmdb{paperheight}. Sometimes it might also be necessary to suitably select the \stya{height} (=markheight), whose default value is \cmdb{paperwidth}.
-\item If the longest line of a \stya{textmark} is longer than \cmdb{paperwidth} and/or \cmdb{paperheight} (depending on the orientation of the \stya{textmark}), then the \stya{fontsize} and \stya{scale} options will have to be suitably chosen.
-\end{itemize}
-
-The package boolean option \stya{allpages} in
-\begin{xwverbatim}
-\usepackage[printwatermark,allpages]{xwatermark},
-\end{xwverbatim}
-which specifies the pages that should receive watermarks, may be replaced by any of the following options:
-\begin{xwverbatim}
-firstpage, oddpages, evenpages, page=x, pages=x-x,
-\end{xwverbatim}
-where \stya{x} means any page number. If you enter, for example, \stya{pages=0-10}, all pages from 1~to 10 will have watermark. On the other hand, an entry like \stya{pages=10-0} will print watermark on page 10 only. If no page-specifying option is given, watermark will appear only on the first page and a warning message will be entered in the transcript file. When passing \stya{page=x} or \stya{pages=x-x} as option to package, don't forget to include the equality sign (\stya{=}), otherwise the option will be ignored by the package and a warning message will logged in the transcript file.
-
-When setting package options either in \cmdb{usepackage} or \dclass (or indeed in \wmsetup, \cmda{xwminipage} or \cmda{xwcolorbox}), the following points should be noted:
-\begin{itemize}
+\begin{enum}
+\item The value of the \fx{textmark} may be any arbitrary multi-line text, such as
+
+\start{example}[textmark]
+textmark=Hello world,\\[.25\baselineskip] We're here.
+\finish{example}
+
+\item The value of \fx{textmark} may be arbitrary (blocks of) texts or even kernel or package commands, but not filenames on their own (except when submitted as values of graphics keys). The package has a user-friendly interface for inserting graphics watermarks and wallpapers, which does not require the user to directly employ \hx{\includegraphics}.
+\item The \ffx'{textwidth, picwidth} should be properly selected to match user's taste and the length of the \fx{textmark}. It may be set to \hx{\paperwidth} or \hx{\paperheight}, or any arbitrary length. Its default value is preset to \hx{\paperheight}. Sometimes it might also be necessary to suitably select the \fx{height}, whose default value is \hx{\paperwidth}.
+\item If the longest line of a \fx{textmark} is longer than \hx{\paperwidth} and/or \hx{\paperheight} (depending on the orientation of the \fx{textmark}), then the \fx{fontsize} and the \fx{textscale} (or \fx{picscale}) options will have to be suitably chosen.
+\end{enum}
+
+The boolean options \ffx'{firstpage,lastpage,allpages, firstpage, oddpages, evenpages},
+which specify the pages that should receive watermarks, may be replaced by any of the options \ffx{page=x, pages=x-y, pagex={x,y,z}}, where \quoted{\fx{x}}, \etcc, stand for any page number. If you enter, for example, \fx{pages=0-10}, all pages from 1~to 10 will receive the watermark. On the other hand, an entry like \fx{pages=10-0} will print watermark on page 10 only. If no page-specifying option is given and \fx{printwatermark} is true, watermark will appear only on the first page and a warning message will be entered in the transcript file. When passing \fx{page=x} or \fx{pages=x-y} as option to package, don't forget to include the equality sign (\fx{=}), otherwise the option will trigger an \quoted{unknown option/key} error. The key \fx{pages} expects a page range with the pages separated by a hyphen, while \fx{pagex} expects a comma-separated list of pages. For obvious reasons, the value of the key \fx{pagex} must always be given in balanced curly braces.
+
+When specifying package options either in \hx{\usepackage} or \hx{\documentclass} (or indeed in the macros \ffx'{\newwatermark, \newwallpaper, \xwmminipage,\xwmcolorbox, \fancypagenos}), the following points should be noted:
+
+\begin{enum}
\item Multiple lines are permitted but not blank lines.
\item Extra paces between options and words are ignored.
-\item No active characters (those of catcode 13) are allowed (but see section~ \ref{sec:Active-charact}).
-\item Options are basically order-agnostic.
-\end{itemize}
-Thus, \eg, the following statement
-\begin{xwverbatim}
-\usepackage
- [ printwatermark = true, scale = 0.8,
- xcoord = 0, ycoord = 0, fontfamily = pag,
- allpages = true,
- color = gray!25, mark = I am happy, angle = 45,
- fontsize=5cm,
- width = \paperwidth, fontseries = b]
- {xwatermark}
-\end{xwverbatim}
-is equivalent to
-\begin{xwverbatim}
-\usepackage[printwatermark,allpages=true,fontfamily=pag,
- color=gray!35,textmark=I am happy,angle=45,fontsize=5cm,
- width=\paperwidth,fontseries=b,scale=0.8,
- xcoord=0,ycoord=0]{xwatermark}.
-\end{xwverbatim}
-
-\subsection{Graphic watermarks\label{ssec:Picture-waterma}}
-For graphic/picture watermarks, the user can issue, \eg,
-\begin{xwverbatim}
-\usepackage[
- printwatermark,page=2,
- picfile={.../graphicsdir/pic-file},picfilex=eps,
- picbb=116 619 242 751,picscale=3,align=center,angle=0,
- xcoord=0,ycoord=0
- ]{xwatermark}.
-\end{xwverbatim}
-For graphic and picture watermarks, you need the \stya{picfile} (the graphic filename, with its full path but without its extension), \stya{picfilex} (the picture filename extension without the dot), \stya{picbb} (the picture bounding box), and \stya{picscale} (the picture scale). Admissible file extensions are \stya{eps}, \stya{pdf}, \stya{png} and \stya{jpeg}; the latter three, but not the first, may be used in the case of \pdfTeX. The file extension should be passed without the dot.
-If the file extension is not passed to package, the package selects it automatically based on whether \pdfTeX mode running or not (normal extensions are \stya{eps} for dvi mode and \stya{pdf} for \pdfTeX mode). If you have the graphic file in both \stya{eps} and \stya{pdf} formats, then you don't have to bother about submitting the file extension to the package: it will automatically select the appropriate file extension, depending on the mode (\pdfTeX or dvi) in which it is running.
-
-\subsection{The \XWM macro}
-The global boolean option \stya{printwatermark=true} (or \stya{=false}) and the one that specifies the pages to receive the watermark(s) (\eg, \stya{evenpages} and \stya{allpages}) should be set when loading the package, \eg,
-\begin{xwverbatim}
-\usepackage[printwatermark,evenpages]{xwatermark},
-\end{xwverbatim}
-or in the \dclass options list:
-\begin{xwverbatim}
+\item Active characters (those of catcode~13) may be allowed (but see \amref{sec:activechar} for further comments).
+\item Options are mostly order-agnostic, except \fxi{graphicsoptions}, whose values take precedence over those supplied via other keys (see \amref{sec:graphicsoptions}).
+\end{enum}
+
+
+The global boolean option \fx{printwatermark}=\hx{true} (or \hx{=false}) should ideally be set when loading the package, \eg,
+
+\start'{example}[Package option: printwatermark]
+\usepackage[printwatermark]{xwatermark}
+\finish{example}
+
+or in the \hx{\documentclass} options list:
+
+\start'{example}[Package option: printwatermark]
\documentclass[a4paper,12pt,printwatermark]{article}
+\usepackage{xwatermark}.
+\finish{example}
+
+The remaining options should ideally be set dynamically using the macro \fx{\newwatermark} or \fx{\newwallpaper}. These other options can be set for each page, as on the pages of the accompanying example files.
+
+
+\docsection(sec:newwatermarks){The \headfx{\newwatermark} macro}
+
+The use syntax for the command \fx{\newwatermark} is as follows
+
+\start{newmacro}[\newwatermark]
+\newwatermark[|A(key-val)]{|A(mark)}
+\newwatermark|R(*')[|A(key-val)]{|A(mark)}
+\finish{newmacro}
+\fxi*{\newwatermark}
+
+where \ang{key-val} is the list of keys and their values (called the watermark attributes) and \ang{mark} is the text watermark. Graphics watermarks are to be specified with their file name, file extension, \etcc. The full lists of the available keys for the macro \fx{\newwatermark} and others are available in \amref{sec:packageoptions}.
+
+The \stform of \fx{\newwatermark} puts the watermark in the foreground instead of the background, and the \pmform is ignored, \ie, no watermark is produced (see \amref{sec:dummywatermarks}).
+
+The macro \fx{\newwatermark} can be used as in
+
+\start{example}[\newwatermark]
+\newwatermark[|R(pagex)={2,5,7},fontfamily=bch,color=gray!25,angle=45,scale=3,
+ xpos=0,ypos=0]{DRAFT},
+\finish{example}
+
+where the \fx{textmark} has been enclosed in curly braces as the last argument of the macro. The options (called the watermark attributes) are expected in square brackets. The \fx{textmark} (which is \quoted{DRAFT} in the above example) can also be given within square brackets, in which case the curly braces will be empty:
+
+\start{example}[\newwatermark]
+\newwatermark|R(*)[page=10,fontfamily=bch,color=gray!25,angle=45,scale=3,xpos=0,
+ ypos=0,textmark=DRAFT]{}.
+\finish{example}
+
+The option \fx{printwatermark} may appear in only \fx{\usepackage} or \hx{\documentclass} options list, since it is disabled at \hx{\begin{document}}. However, the options \ffx'{firstpage, lastpage, allpages, oddpages, evenpages}, \etcc, which specify watermark pages, can and should appear in the command \fx{\newwatermark}. This implies that the instructions that specify watermark pages may be issued and superseded dynamically (page by page or chapter by chapter). For small documents, this feature may be unnecessary, but it will be useful in large documents (such as a report or book), in which the watermark may change from chapter to chapter.
+
+When you want the watermark on only one page of the document, you can conveniently use the \fx{\newwatermark} macro with the page option \mbox{\fx{page}=\ang{no}} in the preamble of your document after issuing
+
+\start+{example}[\usepackage,printwatermark]
+\usepackage[printwatermark]{xwatermark}
+\finish{example}
-\usepackage[evenpages]{xwatermark}.
-\end{xwverbatim}
+In this way, you don't have to bother with locating in the source file the spot that corresponds to the page on which you want the watermark to appear. In fact, you can collect all the watermarks in the document preamble or in a configuration file with the command \fx{\newwatermark}.
-The remaining options can be set dynamically using the \wmsetup macro. These other options can be set for each page, as on the pages of the accompanying file of examples (\stya{xwatermark-examples.tex}). The macro \wmsetup can be used as in
-\begin{xwverbatim}
-\watermarksetup{fontfamily=bch,color=gray!25,textmark=DRAFT,
- angle=45,scale=0.8,xcoord=0,ycoord=0
-}.
-\end{xwverbatim}
+\Note Each call to \fx{\newwatermark} must contain the page(s) that will receive the watermark(s), otherwise the user will be alerted. The page specifiers are:
-The option \stya{printwatermark} should not appear in \wmsetup but in the statement \usepackxwm or in the \dclass options list.
+\start'{example}[page specifiers]
+page=x, pages=x-y, pagex={x,y,z}, firstpage, lastpage, allpages,
+oddpages, evenpages
+\finish{example}
-However, the options \stya{allpages}, \stya{oddpages}, \stya{evenpages}, \etc, which specify watermark pages, can appear in \wmsetup. This implies that the instructions that specify watermark pages may be issued and superseded dynamically (page by page or chapter by chapter). For small documents, this feature may be unnecessary, but will be useful in large documents (such as a report or book), in which the watermark may change from chapter to chapter.
-When you want the watermark on only one page of the document, you can conveniently use the \wmsetup macro with the page option \stya{page=desired page} in the preamble of your document after issuing
-\begin{xwverbatim}
-\usepackage[printwatermark]{xwatermark}.
-\end{xwverbatim}
-In this way, you don't have to bother with locating in the source file the spot that corresponds to the page on which you want the watermark to appear.
+\docsubsection{Options without values}
-\subsection{Options without values}
If you follow an option key with an equality sign but without a value, as in, \eg,
-\begin{xwverbatim}
-\watermarksetup{|color(red)fontfamily={}|color(blue),color=gray!25,|color(red)textmark={}|color(blue),
- angle=45,scale=0.8,xcoord=0,ycoord=0
-},
-\end{xwverbatim}
-then there will be no problem but the outcome may be unpredictable, depending on the key that has no value. In the above example, no watermark will be printed (not even the default mark, which is \stya{DRAFT}) because the entry \stya{textmark=} is valid and implies that no watermark should be printed. The absence of fontfamily in \stya{fontfamily=} will compel \TeXL to use an arbitrary fontfamily that isn't the default (the default fontfamily is \stya{phv} if the key \stya{fontfamily} is not passed, and \stya{cmr} otherwise).
-\subsection{Emptying the watermarks of some pages}
+\start{example}[\newwatermark]
+\newwatermark[firstpage,fontfamily=,color=gray!25,angle=45,scale=0.8,
+ xpos=0,ypos=0,textmark=]{},
+\finish{example}
+
+then there will be no problem but the outcome may be unpredictable, depending on the key that has no value. In the above example, no watermark will be printed (not even the default mark, which is \fx{DRAFT}) because empty textmark is valid and implies that no watermark should be printed. The absence of \texttt{fontfamily} in \quoted{\fx{fontfamily=}} will compel \texorlatex to use an arbitrary \texttt{fontfamily} that isn't the default (the default \texttt{fontfamily} is \fx{phv} if the key \fx{fontfamily} is not passed, and \fx{cmr} otherwise).
+
+
+\docsubsection{Emptying the watermarks of some pages or objects}
If you issue any of the statements
-\begin{xwverbatim}
-allpages=true, evenpages=true, oddpages=true, pages=x-x,
-page=x
-\end{xwverbatim}
-together with \stya{printwatermark=true} but you don't want the mark on any particular page, you can simply set \cmda{watermarksetup\{textmark=\}} or, to the same effect, \cmda{watermarksetup\{textmark=\{\}\}} on that page. In the case of picture watermarks, you will set \cmda{watermarksetup\{picfile=\{\}\}}. These both imply that the watermark for that page is empty. This can be useful when transiting from text watermarks to picture watermarks or vice versa. Some examples are available in \stya{xwatermark-examples.tex}, the example source file that shipped with this package.
-\subsection{The usefulness of the \stya{\bf white} color}
-If you set \stya{allpages=true} or \stya{evenpages=true} or \stya{oddpages=true} together with \stya{printwatermark=true} but you don't want the mark on any particular page, you can simply enter \stya{color=white} in the \wmsetup on that page. This applies only to text watermarks, as such a declaration has no effect on picture watermarks. This may be convenient in circumstances where you may change your mind as to whether to place a watermark on a particular page or not. In this way you don't have to set \cmda{watermarksetup\{textmark=\}} or remove (or comment out) the \wmsetup command for that (or indeed any) page.
+\start{example}[page specifiers]
+page=x, pages=x-y, pagex={x,y,z}, firstpage, lastpage, allpages=true,
+evenpages=true, oddpages=true
+\finish{example}
+
+together with \fx{printwatermark}=\hx{true} but you don't want the mark on any particular page, we can simply set \fx{\newwatermark[other keys,textmark=]{}} or, to the same effect, we may set \fx{\newwatermark[other keys]{}}, where \quoted{other keys} may include the page specifiers\footnote{In the case of graphics watermarks, setting \ftfx{\newwatermark[other keys,picfile=]{}} will prompt a \quoted{no file} error.}. These both imply that the text watermark for the given page is empty. This can be useful when transiting from one watermark type to another. Moreover, since both picture and text marks can be submitted via one and the same command \fx{\newwatermark} (see \amref{sec:pic-text-mark}), this technique may be used to empty the text watermark for the given page or range of pages. For example,
+
+\start{example}[\newwatermark]
+\newwatermark[allpages,fontfamily=put,color=white,fontsize=3cm,scale=1,
+ picbb=112 619 242 751,picscale=3,picfile=./graphics/myfig,picfileext=eps,
+ width=\paperheight,align=center,angle=0,xpos=0,ypos=0]{}
+\finish{example}
+
+will print only the picture watermark, since the \fx{textmark} is empty here.
+
+
+\docsubsection(sec:pic-text-mark){Printing both picture and text watermarks on same page}
+
+Both picture and text marks can be submitted and printed on the same page via one and the same \fx{\newwatermark}. For example,
+
+\start{example}[\newwatermark]
+\newwatermark[pages=1-2,fontfamily=put,color=white,fontsize=3cm,scale=1,
+ picbb=112 619 242 751,picscale=3,picfile={./graphics/myfig},
+ picfileext=eps,width=\paperheight,align=center,angle=0,xpos=0,
+ ypos=0]{Hello World}
+\finish{example}
+
+However, both the picture and text marks will then share the same subset of the attributes (position, angle, align, \etcc). When text and graphics watermarks appear on the same page, the recommended approach is to submit the two types of watermark by two separate calls to \fx{\newwatermark}.
+
+
+\docsubsection{The usefulness of the \headhx{white} color}
+
+You can deploy the white color to great effect in designing text watermarks. Also, if you set \fx{allpages}=\hx{true} or \fx{evenpages}=\hx{true} or \fx{oddpages=true} together with \fx{printwatermark}=\hx{true} but you don't want the mark on any particular page, you can simply enter \fx{color=white} in the \fx{\newwatermark} on that page. This applies only to text watermarks, as such a declaration has no effect on picture watermarks. This may be convenient in circumstances where you may change your mind as to whether to place a watermark on a particular page or not. In this way you don't have to set \fx{\newwatermark[other keys,textmark=]{}} or remove (or comment out) the \fx{\newwatermark} command for that (or indeed any) page. See also \amref{sec:dummywatermarks}.
+
+
+\docsubsection(sec:dummywatermarks){Dummy watermarks}
+
+When you don't need a watermark printed, you can simply replace its \fx{\newwatermark} with \fx{\dummywatermark}, instead of commenting out the entire watermark or using \fx{color=white}. Both the macros \fx{\newwatermark} and \fx{\dummywatermark} have the same syntax and expect the same number and types of arguments:
+
+\start{newmacro}[\dummywatermark]
+\dummywatermark[pages=12-13,fontfamily=phv,fontsize=11pt,fontseries=m,
+ align=center,height=\paperheight,width=\paperwidth,angle=90,scale=1,
+ xpos=0,ypos=-1
+]{Example}
+\finish{newmacro}
+\fxi*{\dummywatermark}
+
+And when you don't want any of your watermarks printed, you could simply issue the option \fx{printwatermark}=\hx{false} or call the command \fxi{\DiscardAllWatermarks}. These will simply turn all instances of \fx{\newwatermark} command into \fx{\dummywatermark}. In any run, you may decide to use some or all of the dummy watermarks. To use all dummy watermarks, you issue the command \fxi{\UseDummyWatermarks} before instances of \fx{\dummywatermark}. To again disregard all subsequent dummy watermarks, which is the default state, simply call the command \fxi{\DiscardDummyWatermarks}. These commands provide a convenient scheme for deciding the watermarks to be printed with minimal typing. For wallpapers, there is the corresponding command \fxi{\dummywallpaper}. Also, putting a prime sign (\RedPrime) on \fx{\newwatermark} or \fx{\newwallpaper} turns the command into a dummy mark, but only for that single instance. Subsequent \fx{\newwatermark} and \fx{\newwallpaper} without primes will produce watermarks and wallpapers.
+
+
+\docsection(sec:wallpapers){Wallpapers}
+
+\docsubsection{The \headfx{\newwallpaper} macro}
+
+The command \fx{\newwallpaper} can be used to produce rectangular and square tiles on document pages. The use syntax for the command \fx{\newwallpaper} is
+
+\start{newmacro}[\newwallpaper]
+\newwallpaper[|A(key-val)]{|A(mark)}
+\newwallpaper|R(*')[|A(key-val)]{|A(mark)}
+\finish{newmacro}
+\fxi*{\newwallpaper}
+
+where \ang{key-val} is the list of keys and their values (called the attributes) and \ang{mark} is the text (and not graphics) watermark. Graphics watermarks are again to be specified with their file name, file extension, \etcc. The full lists of the available keys for the macro \fx{\newwallpaper} are available in \amref{tab:localoptions}.
+
+The \stform of \fx{\newwallpaper} puts the watermark in the foreground instead of the background, and the \pmform is ignored, \ie, no watermark is produced (see \amref{sec:dummywatermarks}).
+
+When you get unexpected tiles, you should consider enabling or disabling the keys \fx{squaretiles} (default \texttt{true}) and/or \fx{boxalign} (default \texttt{center}). The key \fx{boxalign} may assume one of the values in the set \ffx{t-l,t-r,b-l,b-r,s} or \ffx{top-left, top-right, bottom-left, bottom-right, center, justified}.
+
+
+\docsection(sec:pic-watermark){Graphics watermarks}
+
+For graphics/picture watermarks, you need the \fx{picfile} (the graphics filename, with its full path but without its extension), \fx{picfileext} (the picture filename extension without the dot), \fx{picbb} (the picture bounding box), and \fx{picscale} (the picture scale)\footnote{These options have longer, easier to remember, names; see \amref{tab:localoptions}.}. Admissible file extensions are \fx{eps}, \fx{pdf}, \fx{png} and \fx{jpeg}; the latter three, but not the first, may be used in the case of \pdftex. The file extension should be passed without the dot. If the file extension is not passed to package, the package selects it automatically based on whether \pdftex mode is running or not (normal extensions are \fx{eps} for dvi mode and \fx{pdf} for \pdftex mode). In fact, the package does search hard on the given paths for other admissible file types with the base filename the user has specified. If you have the graphics file in both \fx{eps} and \pdf-compatible formats, then you don't have to bother about submitting the file extension to the package: it will automatically select the appropriate file extension, depending on the mode (\pdf or \texttt{dvi}) in which it is running.
+
+
+\docsubsection(sec:graphicsoptions)
+ [Passing key values to \headhx{\includegraphics} directly]
+ {Passing key values to \headhx{\includegraphics} directly}
+\fxim*{graphicsoptions}
+
+The \pkg'{xwatermark} uses \pkg'{graphicx}'s \hxi{\includegraphics} to insert graphics watermarks.
+Users can pass valid key values to the command \hx{\includegraphics} directly via the macros \ffx'{\newwatermark,\newwallpaper}. The key to use for this purpose is \fx{graphicsoptions}. The following points should be noted in respect of the key \fx{graphicsoptions}:
+
+\begin{enum}
+\item Values of the key \fx{graphicsoptions} must always be enclosed in curly braces, since they are expected to be more than one.
+\item Only keys and values valid for the command \hx{\includegraphics} may appear in the command \fx{graphicsoptions}. Valid keys for \hx{\includegraphics} are
+
+\start'{example}[\includegraphics keys]
+bb, bbllx, bblly, hiresbb, viewport, trim, height, width, natheight,
+natwidth, totalheight, angle, origin, keepaspectratio, scale, clip,
+draft, type, ext, read, command
+\finish{example}
+
+\item Key values submitted via \fx{graphicsoptions} supersede those submitted outside it, even if those outside \fx{graphicsoptions} appear earlier than \fx{graphicsoptions} in the command \fx{\newwatermark} or \fx{\newwallpaper}.
+\item Values submitted via \fx{graphicsoptions} have only local effect, in the sense that they become null and void outside of \fx{\newwatermark} or \fx{\newwallpaper}. If the user wants the key values submitted via \fx{graphicsoptions} to prevail for all subsequent watermarks and wallpapers, then he should use the command \fx{\GraphicsOptions}. Values passed via \fx{\GraphicsOptions} don't only have global effect, but they always override those submitted via \fx{graphicsoptions}.
+\end{enum}
+
+It should be noted that \fx{\GraphicsOptions} isn't a key but a stand-alone command with the following syntax:
+
+\start{newmacro}[\GraphicsOptions]
+\GraphicsOptions{|A(key-val)}
+\finish{newmacro}
+\fxi*{\GraphicsOptions}
+
+where \ang{key-val} are admissible keys for the command \hx{\includegraphics} and their user-supplied values. The values so suggested by \fx{\GraphicsOptions} override those given via the keys of the \pkg{xwatermark}, including \fx{graphicsoptions}. Such values remain in force until they are changed later by another call to \fx{\GraphicsOptions}.
+
+An example follows:
+
+\start{example}[graphicsoptions]
+\newwallpaper[%
+ page=10,picangle=45,tilexoffset=0pt,tileyoffset=0pt,picontoptext=false,
+ boxalign=top-left,picbb=116 428 477 718,picscale=2,picfile=tabu-test1,
+ tileno=4,picfileext=pdf,|R(graphicsoptions)={clip,keepaspectratio,hiresbb}
+]{mypicture}
+
+|com(or globally as)
+\GraphicsOptions{clip=true,keepaspectratio,hiresbb}
+\finish{example}
+\fxi*{\GraphicsOptions}
+
+The commands \hhx'{\DeclareGraphicsExtensions, \DeclareGraphicsRule} of the \pkg'{graphics} can still be invoked before setting graphics watermarks.
+
+
+\docsubsection{The graphics input paths}
+
+Users can suggest the possible locations of the graphics watermarks to the package by using the command \fx{\watermarkpaths}, whose syntaxes are
+
+\start{newmacro}[\watermarkpaths]
+\watermarkpaths[|A(pre)]|(|A(post)|){{path-1}{path-2}...{path-n}}
+\watermarkpaths|*[|A(pre)]|(|A(post)|){path-1,path-2,...,path-n}
+\finish{newmacro}
+\fxi*{\watermarkpaths}
+
+Here, \ang{pre} and \ang{post} are optional arguments that apply to all the given paths. Caution should be exercised when using these optional arguments, since when used incorrectly they can yield the wrong path (see the example below). In the \unstform all the paths must be provided in surrounding curly braces and must have no commas, otherwise the package will raise an error. The \stform expects paths to be separated by commas. The package works hard to find your watermark on the suggested path.
+
+\start+{example}[\watermarkpaths]
+\watermarkpaths{{./}{./graphics/}{./graphics/recentfiles/}}
+\watermarkpaths|*{./,./graphics/,./graphics/recentfiles/}
+\watermarkpaths|(/|){{.}{./graphics}{./graphics/recentfiles}}
+\watermarkpaths|*|(/|){.,./graphics,./graphics/recentfiles}
+|com(Note the empty balanced braces below. Without them, the first entry)
+|com(|(which is supposed to be {./}|) will be wrong:)
+\watermarkpaths[.]|(/|){{}{/graphics}{/graphics/recentfiles}}
+\watermarkpaths|*[.]|(/|){{},/graphics,/graphics/recentfiles}
+\finish{example}
-\section{Other aspects of package architecture and use}
+By default, the packages works hard to preserve outer curly braces, unless and until they are required to be removed.
-\subsection{\DCL options}
-The package is set to inherit the \dclass options, if the options apply to the package. Therefore, some of the package options can be passed to the package via the \dclass options list. This is perhaps most appropriate in the case of the options \stya{printwatermark}. However, package options supersede those passed via the \dclass. For example, the option \stya{printwatermark=true} in the \dclass options list can normally be superseded by the option \stya{printwatermark=false} in loading the \stya{xwatermark} package, \eg, as in
-\begin{xwverbatim}
+The command \fx{\watermarkpaths} inherits the current contents of \latex's \hx{\input@path} command and \pkg'{graphics}'s \hx{\Ginput@path} (the latter takes argument from \hx{\graphicspath}).
+
+
+\docsection{Other aspects of package architecture and use}
+
+\docsubsection{\headhx{\documentclass} options}
+
+The package is set to inherit the \hx{\documentclass} options, if the options apply to the package. Therefore, some of the package options can be passed to the package via the \hx{\documentclass} options list. This is perhaps most appropriate in the case of the option \fx{printwatermark}. However, package options supersede those passed via the \hx{\documentclass}. For example, the option \fx{printwatermark}=\hx{true} in the \hx{\documentclass} options list can normally be superseded by the option \fx{printwatermark}=\hx{false} in loading the \pkg'{xwatermark}, \eg, as in
+
+\start{example}[package loading]
\usepackage[printwatermark=false]{xwatermark},
-\end{xwverbatim}
-and vice versa.
+\finish{example}
+
+and vice versa. It should, however, be noted that some package options and keys are restricted either to the \hhx'{\documentclass,\usepackage} (this applies to the so-called \quoted{option keys}) or to the various user macros (in the case of \quoted{non-option keys}). Normally, the package will alert the user to the wrong call of any of the options and keys.
+
+If you don't need the watermark on any page of your document, simply replace the option \fx{printwatermark} (=\hx{true}) with \fx{printwatermark}=\hx{false} in \hx{\usepackage} or \hx{\documentclass}. If you have specified \fx{printwatermark} (=\hx{true}) in the \hx{\documentclass} options list but you still don't need the watermark on any page of your document, then you would have to use the tools of \amref{sec:dummywatermarks}.
+
+
+\docsubsection<Size of the watermark>{The size of the watermark}
+
+In the case of text watermarks, the size of the watermark is controlled by three parameters, namely, \fx{fontsize}, \fx{fontseries} and \fx{scale}. All can be set dynamically. Their default values are \fx{5cm}, \fx{b} and \fx{1}, respectively. For picture watermarks, the size is determined by \fx{picscale}.
+
+
+\docsubsection{The coordinates of the watermark}
+
+The watermark coordinates (specified by \fx{xpos} and \fx{ypos}) have their origin at the center of the page and are with respect to the geometric center of the watermark. The default unit is \hx{millimeter}, but this can be changed on any page by changing the value of \fx{coordunit}. For example,
-If you don't need the watermark on any page of your document, simply replace the \stya{printwatermark(=true)} option in \cmdb{usepackage} or \dclass with the choice \stya{printwatermark=false}. If you have specified \stya{printwatermark(=true)} in the \dclass options list but you still don't need the watermark on any page of your document, then you would have to enter \stya{printwatermark=false} when loading the package.
+\start+{example}[\newwatermark,coordunit]
+\newwatermark[other attributes,coordunit=|R(unit of length)]{}.
+\finish{example}
-\subsection{The size of the watermark}
-In the case of text watermarks, the size of the watermark is controlled by three parameters, namely, \stya{fontsize}, \stya{fontseries} and \stya{scale}. All can be set dynamically. Their default values are \stya{5cm}, \stya{b} and \stya{1}, respectively. For picture watermarks, the size is determined by \stya{picscale}.
+Acceptable units of length include \hx{mm} (millimeter), \hx{cm} (centimeter), \hx{in} (inch), \hx{pt}~(point), \hx{bp} (big point), \hx{dd} (didot), \hx{ex} (height of small \hx{x}), \hx{pc} (pica), \hx{cc}~(cicero), and \hx{em}~(width of capital \hx{M}).
-\subsection{The coordinates of the watermark}
-The watermark coordinates (specified by \stya{xcoord} and \stya{ycoord}) have their origin at the center of the page and are with respect to the geometric center of the watermark. The default unit is \stya{millimeter}, but this can be changed on any page by issuing
-\begin{xwverbatim}
-\watermarksetup{coordunit=|color(red)unit of length|color(blue)}.
-\end{xwverbatim}
-Acceptable units of length include \styb{mm} (millimeter), \styb{cm} (centimeter), \styb{in} (inch), \styb{pt}~(point), \styb{bp} (big point), \styb{dd} (didot), \styb{ex} (height of small \styb{x}), \styb{pc} (pica), \styb{cc}~(cicero), \styb{em}~(width of capital \styb{M}). The unit of coordinates can also be changed by simply submitting the unit to the package with other options at each call, as in
-\begin{xwverbatim}
-\watermarksetup{|color(red)coordunit=pc,|color(blue)fontfamily=cmss,angle=90,
- scale=1.0,textmark=-Official-,color=red!75!green!50,
- xcoord=-10,ycoord=10
-}.
-\end{xwverbatim}
-\subsubsection{Wrong location of the watermark}
-If you discover that the watermark is wrongly positioned on the page(s) of your document, the chances are that you have submitted wrong coordinates (values of \stya{xcoord} and \stya{ycoord}) to the package or the markwidth (\stya{width}) is not optimal or both reasons. The package does not take responsibility for this and will normally not warn you in this respect. Since the output file provides a direct and simple indication of the occurrence of this error, no attempt has been made in the package to warn users in this regard. If you do not specify the keys \stya{xcoord} and/or \stya{ycoord} at all in the call to the package, their immediate past values will be used by the package. On the other hand, if you list these keys without their values in the call to the package, their default values (\stya{xcoord=0} and \stya{ycoord=0}, which yield the center of paper) will be assumed by the package. The default value of the markwidth is \cmda{paperheight}.
+\docsubsection{Wrong location of the watermark}
-When the \styb{geometry} package is loaded together with \styb{xwatermark}, page layout scale changes by the \styb{geometry} package may result in the watermarks being positioned wrongly. See section~\ref{sec:Xwatermark:Geometry} for further details.
+If you discover that the watermark is wrongly positioned on the page(s) of your document, as some users have had course to complain, the chances are that you have submitted wrong coordinates (values of \fx{xpos} and \fx{ypos}) to the package or the watermark's width (\fx{textwidth} or \fx{picwidth}) is not optimal or both reasons. The package does not take responsibility for this and will normally not warn you in this respect. Since the output file provides a direct and simple indication of the occurrence of the anomaly, no attempt has been made in the package to warn users in this regard. If you do not specify the keys \fx{xpos} and/or \fx{ypos} at all in the call to \fx{\newwatermark}, their default values will be used by the package. Also, if you list these keys without their values in the call to \fx{\newwatermark}, their default values (\fx{xpos=0} and \fx{ypos=0}, which yield the center of paper) will be assumed by the package. The default value of the watermark's width is \hx{\paperheight}, and not \hx{\paperwidth} as might be expected.
-\subsection{Choice of \stya{\bf grayness}}
-The grayness applies to only text watermarks and is chosen according to the scheme of the \styb{xcolor} package. The color gray is represented as \stya{gray!x}, where \stya{x} is the grayness in percentage---normally from 1 to 100. In the previous versions of the package, the \stya{grayness} was a package option associated with the color \stya{gray}; this is no longer the case.
+When the \pkg'{geometry} is loaded together with the \pkg'{xwatermark}, page layout scale changes by the \pkg'{geometry} may result in the watermarks being positioned slightly away from the intended position. See \amref{sec:geometry} for further details.
+
+
+\docsubsection{Wrong size of the watermark}
+
+When you discover that your text or graphics watermark is not of the size you expect, then you should check the global and local scale and width of the watermark. It is most likely that the chosen combination is wrong or inconsistent. Global and local package options are described in \amref{sec:packageoptions}. For example, choosing \fx{scale=0.7} and \fx{width=\paperwidth} may yield something unexpected. So will mixing inconsistent global and local scales or width, or both.
+
+
+\docsubsection{Breaking the watermark into lines}
-\subsection{Breaking the watermark into lines}
It is possible to break text watermarks into lines, as in the following examples:
-\begin{xwverbatim}
-\watermarksetup{fontfamily=ptm,angle=45,scale=.7,
- textmark=|color(red){Directorate\\[.25ex]Only},align=center|color(blue),
- color=green,xcoord=0,ycoord=0
-}
-\watermarksetup{fontfamily=ptm,angle=45,scale=.8,
- textmark=|color(red){Control\\[.25ex]Version},align=left|color(blue),
- color=green,xcoord=0,ycoord=0
-}.
-\end{xwverbatim}
-More complex examples are given in the file \stya{xwatermark-examples.tex}.
-
-\subsubsection{The alignment of the watermark}
-The alignment of the watermark is controlled by the key \stya{align}, which may be set to \stya{center}, \stya{left}, \stya{right} or \stya{justified}. The default is \stya{center}. This is particularly useful for putting arbitrary texts (that are not necessarily watermarks) on pages of documents. Examples include the watermarks on the pages of this document. The code for the watermarks on page~\pageref{page:one} is given in section~\ref{sec:colorbox}.
-
-\subsection{Locating the page center}
-In case you need to locate the paper/page center for placing the watermark or some other material at any position on the page, a two-line grid can be placed on the page background with the key \stya{showcenter}, which may be issued (dynamically for each page) with the \wmsetup macro as follows:
-\begin{xwverbatim}
-\watermarksetup{|color(red)showcenter|color(blue)} |color(black)or
-
-\watermarksetup{|color(red)showcenter=true|color(blue)} |color(black)or
-
-\watermarksetup{|color(red)showcenter|color(blue),fontfamily=ptm,angle=60,
- scale=.7,textmark=Confidential!,color=brown!25!yellow!75,
- coordunit=cc,xcoord=0,ycoord=0
-}.
-\end{xwverbatim}
-
-An example is given in the example file (\stya{xwatermark-examples.tex}). If after issuing this command to get a centered grid on a page, you no longer require the grid on the following pages, you simply issue another
-\begin{xwverbatim}
-\watermarksetup{|color(red)showcenter=false|color(blue)} |color(black)or
-
-\watermarksetup{|color(red)showcenter=false|color(blue),fontfamily=panr,angle=60,
- scale=.7,textmark=Confidential!,color=brown!25!yellow!75,
- coordunit=cc,xcoord=0,ycoord=0
-}.
-\end{xwverbatim}
-
-\subsection{Active characters}\label{sec:Active-charact}
-Active characters (\ie, those of category 13) can normally be used as values of the \stya{textmark} key in the \wmsetup macro. However, such values cannot be passed via the \dclass or the \usepackxwm statement. The \styb{xkvltxp} package (or \styb{kvoptions-patch} package) can be used to obviate this problem. That is, the following should work:
-
-\begin{xwverbatim}
-\RequirePackage{xkvltxp}
-\documentclass[textmark={My watermark,\\designed~
- by \textsc{Johnson}}]{class-type}
-\begin{document}
-...
-\end{document}
-\end{xwverbatim}
+\start{example}
+\newwatermark[evenpages,fontfamily=ptm,angle=45,scale=.7,
+ align=center,color=green,xpos=0,ypos=0]{Directorate\\[.25ex]Only}
-To pass active characters and expandable commands as values of \stya{textmark} to the \stya{xwatermark} package via \usepackxwm, it is necessary to first load the \styb{xkvltxp} package as above, or as follows:
+\newwatermark[allpages,fontfamily=ptm,angle=45,scale=.8,align=left,
+ color=green,xpos=0,ypos=0]{Control\\[.25ex]Version}.
+\finish{example}
-\begin{xwverbatim}
-\documentclass{class-type}
-\usepackage{xkvltxp}
-\usepackage[printwatermark,%
- textmark=\textsc{Johnson's~Text}]{xwatermark}
-\begin{document}
-...
-\end{document}
-\end{xwverbatim}
+More complex examples are available in the example source and \pdf files that shipped with this package.
-The use of the \styb{xkvltxp} package can be sidestepped completely by passing active characters not through \dclass and \usepackxwm but instead via the \wmsetup macro, as in
-\begin{xwverbatim}
-\documentclass{class-type}
-\usepackage[printwatermark]{xwatermark}
-\watermarksetup{allpages,textmark={M\"uller's~Text}}
-\begin{document}
-...
-\end{document}
-\end{xwverbatim}
+\docsubsection{The alignment of the watermark}
-In fact, in this way even expandable commands can be passed to the package, as follows:
+The alignment of the watermark is controlled by the keys \ffx'{align, textalign, boxalign}. The first two are equivalent and may be set to \fx{center}, \fx{left}, \fx{right} or \fx{justified}. The default is \fx{center}. This is particularly useful for putting arbitrary texts (that are not necessarily watermarks) on pages of documents. The admissible values for the key \fx{boxalign} are given in \amref{tab:localoptions}.
+
+
+\docsubsection{Locating the page center}
+
+In case you need to locate the paper/page center for placing the watermark or some other material at any position on the page, a two-line grid can be placed on the page background with the key \fx{showpagecenter}, which may be issued (dynamically for each page) with the \fx{\newwatermark} macro as follows:
+
+\start{example}[showpagecenter]
+\newwatermark[allpages,showpagecenter]{}
+\newwatermark[page=1,showpagecenter=true]{}
+
+\newwatermark[allpages,showpagecenter,fontfamily=ptm,angle=60,scale=.7,
+ color=brown!25!yellow!75,coordunit=cc,xpos=0,ypos=0]{Confidential!}.
+\finish{example}
+
+If after issuing this command to get a centered grid on a page, you no longer require the grid on the following pages, you simply issue another
+
+\start{example}
+\newwatermark[pages=1-2,showpagecenter=false]{}
+
+\newwatermark[page=10-\lastdocpage,showpagecenter=false,fontfamily=panr,
+ angle=60,scale=.7,color=brown!25!yellow!75,coordunit=cc,xpos=0,ypos=0]
+ {Confidential!}
+\finish{example}
+
+
+\docsubsection{The last page of the document}
+
+You can easily obtain the last page of the document with the label \fx{xwmlastpage}, which is automatically provided by the package: the user doesn't have to insert it himself. In general, you can use the command \fx{\xwmgetpagenumber} to extract page numbers from \latex labels (even in expansion contexts). More than one run may be necessary in extracting page numbers from this command. The following example inserts the watermark from second to the last page to the last page. Note that in this example the starting page is necessarily enclosed in curly braces so as to distinguish the two hyphens that serve different purposes.
+
+\start{example}[\xwmgetpagenumber,\lastdocpage]
+\newwatermark[pages={\lastdocpage-2}-\lastdocpage,angle=90,
+ scale=1,xpos=0,ypos=-1]{This is page \thepage~of~\pageref*{xwmlastpage}}
+\finish{example}
+\fxi*{\xwmgetpagenumber,\lastdocpage}
+
+The command \fx{\lastdocpage} is equivalent to \fx{\xwmgetpagenumber{xwmlastpage}}.
+
+
+\docsubsection(sec:activechar){Active characters}
+
+Active characters (\ie, those of category 13) and expandable commands can normally be used as values of the \fx{textmark} key in the \fx{\newwatermark} macro. However, such values cannot be passed via the \hx{\documentclass} or the \hx{\usepackage{xwatermark}} command without first loading one of the packages: \pkg'{xkvltxp,kvoptions-patch,catoptions}. That is, the following should work:
+
+\start{example}
+\RequirePackage{catoptions}
+\documentclass[myoption={My watermark,\\[2ex]
+ designed~by \textsc{Mr.~J\"ohnson}}]{class-file}
-\begin{xwverbatim}
-\documentclass{class-type}
-\usepackage[printwatermark]{xwatermark}
-\newcommand*\temparg{Fran\c coise M\"uller's\endgraf Text}
-\watermarksetup{allpages,textmark=\temparg}
\begin{document}
-...
+Blackberry lily ...
\end{document}
-\end{xwverbatim}
-
-The accompanying file \stya{xwatermark-examples.tex} contains some complex examples.
-
-In plain \nTeX the only active character is the tie character \raisebox{-1ex}{\ \textcolor{teal}{$\widetilde{}$}\ } (that is, \cmdb{nobreakspace}). However, some packages do make some other characters active. For example, after issuing the command \cmdb{MakeShortVerb\{\textbackslash x\}}, the packages \styb{doc} and \styb{shortvrb} make the character \styb{x} active\footnote{The \styb{fancyvrb} package has, \eg, \cmdb{DefineShortVerb[key=value pairs]\{\textbackslash x\}}.}. The user can use such active characters in values of the \stya{textmark} key without locally changing their catcode to 11 (\ie, letters). In the case of \cmdb{MakeShortVerb\{\textbackslash x\}}, you can issue \cmdb{DeleteShortVerb\{\textbackslash x\}} to revert to normal use of character \styb{x}. As another example, the option \styb{turkish} of the \styb{babel} package uses the equal sign (\styb{=}) as active shorthand character.
-
-\section{The \XWCB and \XWMP macros}\label{sec:colorbox}
-\lletter{T}{o make} it easier for users to create paragraph boxes and color boxes of texts and watermarks, the \stya{xwatermark} package provides the macros \cmda{xwcolorbox} and \cmda{xwminipage}. The macro \cmda{xwcolorbox} calls the macro \cmda{xwminipage}. The \cmda{xwminipage} macro is a \styb{minipage} environment that may be used for framing watermarks. Like the \wmsetup macro, these two macros are set with key-value lists as follows:
-\begin{xwverbatim}
-\xwminipage{key=value list}
-\xwcolorbox{key=value list}.
-\end{xwverbatim}
-
-The \stya{textcolor} in \cmda{xwminipage} is the color of the text. In the case of \cmda{xwcolorbox}, two color values are expected: \stya{textcolor} and \stya{fillcolor}. Texts with commas need to be enclosed in braces when submitted to these macros. The default values of the options of these macros are described in section~\ref{sec:LocalOptions}.
-
-These macros can call one/each other iteratively, \eg,
-\begin{xwverbatim}
-\watermarksetup{fontfamily=txtt,fontseries=m,color=red,
- align=center,scale=0.7,angle=0,xcoord=0,ycoord=0,
- textmark={%
- \xwminipage{width=\paperwidth,
- text={%
- \xwminipage{width=\paperwidth,align=left,
- textcolor=magenta,text={\TeX\\[.1ex] \LaTeX}
- }%
- \\[1ex]
- \xwminipage{width=\paperwidth,align=center,
- textcolor=green,text={\TeX\\[.1ex] \LaTeX}
- }%
- \\[1ex]
- \xwminipage{width=\paperwidth,align=right,
- textcolor=orange,text={\TeX\\[.1ex] \LaTeX}%
-}}}}}
-\end{xwverbatim}
-which is one of the examples in the file \stya{xwatermark-examples.tex}.
-
-The left and right watermarks on page~\pageref{page:one} were produced with the following settings:
-\begin{xwverbatim}
-\watermarksetup{fontfamily=phv,fontsize=11pt,
- fontseries=m,align=center,height=\paperheight,
- width=\paperheight,angle=90,scale=1,xcoord=0,ycoord=-1,
- textmark={%
- \xwcolorbox{fillcolor=gray!55,width=\paperheight,
- align=center,framesep=5pt,framerule=2pt,
- framecolor=white,
- text={\color{white}\framebox[2cm][c]{%
- \phantom{Hello}}\hspace{1cm}\color{black}%
- \textcolor{red}{\textbullet}\hspace{1cm}The marks %
- on these pages were placed effortlessly %
- by using the \textcolor{blue}{xwatermark} package
- \hspace{1cm}\textcolor{red}{\textbullet}%
- \hspace{1cm}\color{white}\framebox[2cm][c]%
- {\phantom{Hello}}\rotatebox[origin=c]{90}{%
- \makebox[1.4cm][c]{\phantom{Hello}}}%
- }%
- }%
- \\[17.2cm]
- \xwcolorbox{framesep=5pt,framerule=2pt,
- fillcolor=gray!55,framecolor=white,
- align=center,width=\paperheight,
- text={%
- \color{white}\framebox[2cm][c]{\phantom{Hello}}%
- \hspace{1cm}\color{black}\textcolor{red}%
- {\textbullet}\hspace{4.3cm}User manual for the %
- \textcolor{blue}{xwatermark} package\hspace{4.3cm}%
- \textcolor{red}{\textbullet}\hspace{1cm}
- \color{white}\framebox[2cm][c]{\phantom{Hello}}%
- \rotatebox[origin=c]{90}{%
- \makebox[1.4cm][c]{\phantom{Hello}}}%
- }%
+\finish{example}
+
+In plain \tex the only active character is the tie character (\ie, \hx{\nobreakspace}). However, some packages do make some other characters active. For example, after issuing the command \hx{\MakeShortVerb{\x}}, the packages \pkg{doc} and \pkg{shortvrb} make the character \fx{x} active\footnote{The \pkg'{fancyvrb} has, \eg, \ftfx{\DefineShortVerb[key=value pairs]{\x}}.}. The user can use such active characters in values of the \fx{textmark} key without locally changing their catcode to~11 or~12. In the case of \hx{\MakeShortVerb{\x}}, you can issue \hx{\DeleteShortVerb{\x}} to revert to normal use of character \fx{x}. As another example, the option \hx{turkish} of the \pkg'{babel} uses the equal sign (\hx{=}) as active shorthand character.
+
+
+\docsection(sec:making-boxes){Macros for creating boxes}
+
+To make it easier for users to create paragraph boxes and color boxes of texts and watermarks, the \pkg'{xwatermark} provides the macros \fx{\xwmcolorbox} and \fx{\xwmminipage}. The macro \fx{\xwmcolorbox} calls the macro \fx{\xwmminipage}.
+
+
+\docsubsection(sec:minipage){The \headfx{\xwmminipage} macro}
+
+The \fx{\xwmminipage} macro is a \hx{minipage} environment that may be used for framing watermarks. It accepts verbatim material. Like the \fx{\newwatermark} macro, this macro is called with key-value pairs as follows (see \amref{tab:localoptions} for a full listing of the available keys):
+
+\start{newmacro}[\xwmminipage]
+\xwmminipage[key=value list]{balanced text}
+\xwmcolorbox[key=value list]{balanced text}.
+\finish{newmacro}
+\fxi*{\xwmminipage}
+
+The \fx{textcolor} key in \fx{\xwmminipage} is the color of the text. In the case of \fx{\xwmcolorbox}, four color values are expected: \ffx'{textcolor, fillcolor, outerframecolor, innerframecolor}. Texts with commas need to be enclosed in braces when submitted to these macros. The default values of the keys of these macros are described in \amref{sec:localoptions}.
+
+The macros \ffx'{\xwmminipage,\xwmcolorbox} can be nested within and among themselves, \eg,
+
+\start{example}[\xwmminipage]
+\newwatermark[pagex={1,3,10},fontfamily=txtt,fontseries=m,color=red,
+ align=center,scale=0.7,angle=0,xpos=0,ypos=0]{%
+ \xwmminipage[width=\paperwidth]{%
+ \xwmminipage[width=\paperwidth,align=left,textcolor=magenta]
+ {\TeX\\[.1ex] \LaTeX}\\[1ex]
+ \xwmminipage[width=\paperwidth,align=center,textcolor=green]
+ {\TeX\\[.1ex] \LaTeX}\\[1ex]
+ \xwmminipage[width=\paperwidth,align=right,textcolor=orange]
+ {\TeX\\[.1ex] \LaTeX}%
}%
- }%
}
-\end{xwverbatim}
-
-\subsection{The \YWCB macro}\label{sec:ywcolormacro}
-This macro has the same syntax and options as the \cmda{xwcolorbox} macro except that the resulting \styb{colorbox} is centered by using the \styb{center} environment and the markup box \cmdb{makebox[0pt][c]\{\}}. It is intended for producing \styb{colorbox}{}es such as the one for the abstract on \pageref{page:one}. The abstract was produced with the following settings:
-\begin{xwverbatim}
-\ywcolorbox{framesep=5pt,framerule=2pt,framecolor=red!55,
- align=justified,fillcolor=gray!25,width=\hsize,
- text={%
- \centering\xwcolorbox{align=center,fillcolor=white,
- width=.5\hsize,text={\bfseries Abstract}}\\[1ex]
- The \stya{xwatermark} package enables the user ...
- }%
+\finish{example}
+
+More complicated examples can be found in the example files. But some of the complications found in the example files are unnecessary since several simple watermarks can be placed on the same document page by specifying the same page number for those simple watermarks.
+
+
+\docsubsection(sec:colorbox){The \headfx{\xwmcolorbox} macro}
+
+The macro \fx{\xwmcolorbox} provides a key-value interface to \pkg'{xcolor}'s \hx{\fcolorbox}\footnote{The \pkg'{xwatermark} also comes with the macro \fx{\xwmshade} which is similar to \fx{\xwmcolorbox}, but which, unlike \fx{\xwmcolorbox}, can break neatly across pages (in the manner of the \pkg'{framed}). But since no watermark is expected to break across pages, the macro \fx{\xwmshade} isn't described in this guide. Power users should still be able to use it.}.
+
+\start{newmacro}[\xwmcolorbox]
+\xwmcolorbox[key=value list]{balanced text}.
+\finish{newmacro}
+\fxi*{\xwmcolorbox}
+
+
+\docsubsection(sec:makecolorbox){The \headfx{\makecolorbox} macro}
+
+This macro has the same syntax and options as the \fx{\xwmcolorbox} macro except that the resulting \hx{colorbox} is centered by using the \hx{center} environment and the markup box \hx{\makebox[0pt][c]{}}. It is intended for producing \hx{colorbox}\unskip es such as the one for article abstracts. The user may experiment with the following settings, from which the abstract of this guide was produced:
+
+\start{newmacro}[\makecolorbox]
+\makecolorbox[framesep=4pt,framerule=1pt,innerframecolor=red!55,
+ outerframecolor=ForestGreen,align=justified,
+ fillcolor=gray!25,width=.95\hsize,boxalign=center,
+ height=2.5mm,depth=0mm,framebox]{%
+ \centering\xwmcolorbox[align=center,fillcolor=white,
+ innerframecolor=blue,outerframecolor=orange,width=.5\hsize,
+ height=2mm]{\textbf{Abstract}}\\[\baselineskip]
+ The \pkg'{xwatermark} provides facilities for \ldots
}
-\end{xwverbatim}
-Notice here that the macro \cmda{ywcolorbox} calls the macro \cmda{xwcolorbox} with its (\cmda{ywcolorbox}{}'s) \stya{framesep} and \stya{framerule}.
+\finish{newmacro}
+\fxi*{\makecolorbox}
+
+Notice here that the macro \fx{\makecolorbox} calls the macro \fx{\xwmcolorbox}.
+
+
+\docsection(sec:fancypagenos){The \headfx{\fancypagenos} macro}
+
+The macro \fx{\fancypagenos}, which has the following syntax, can be used to position and format page numbers in the desired fashion. Its keys and their default values are described in \amref{tab:localoptions}. Page numbers produced by \fx{\fancypagenos} will, by default, appear in the foreground, so that they can be seen on top of watermarks. If you want the page numbers to appear in the background, then set \fx{sendtoback}=\hx{true} as one of the key-value pairs in the call to \fx{\fancypagenos}.
+
+\start{newmacro}[\fancypagenos]
+\fancypagenos[key=value pairs]
+\finish{newmacro}
+\fxi*{\fancypagenos}
+
+Even after issuing the command \fx{\fancypagenos}, you can still decide not to print the fancy page numbers by calling the command \fxi{\NoFancyPageNumbers}. The complement of the command \fxi{\NoFancyPageNumbers} is \fxi{\FancyPageNumbers}.
+
+
+\docsection(sec:geometry)[\headpkg{xwatermark} and \headpkg{geometry} package]
+ {Using \headpkg{xwatermark} with \headpkg{geometry} package}
+
+Because the \pkg'{geometry} changes the scale, ratio, magnification, and other native dimensions of the paper to get the needed layout right all the time, the \pkg'{geometry} may interfere with the \pkg'{xwatermark}. The only layout parameter that the \pkg'{geometry} may retain is the paper center, which, unfortunately, does not always coincide with the text center. In fact, even the \hx{\paperwidth} and \hx{\paperheight} can be changed by the user of the \pkg'{geometry}.
+
+Feasible solutions to this problem include setting the watermarks before loading the \pkg'{geometry}; using the \pkg'{geometry} with the option \fx{pass} in the preliminary runs, when setting the watermarks (see further details below); using \hx{true} dimensions (\eg, \fx{coordunit}=\hx{truept}); and using relative, rather than absolute, dimension units (\ie, \hhx'{em,ex}). The power-user can also experiment with the primitives \hhx'{\magnification, \mag, \magstep}.
-Users may also like to consider the possible use of the \cmdb{fcolorbox} macro of the \styb{xcolor} package in setting the textmarks.
+The \hx{pass} option of the \pkg'{geometry} has been available from version~4.2 of the \pkg'{geometry} onwards. It disables auto-layout and all of the \pkg'{geometry} settings except \hx{verbose} and \hx{showframe}. It can be used to determine the page layout of the \hx{\documentclass} and layouts created by other packages and manual settings. The user can also employ the option \hx{showframe} of the \pkg'{geometry} to view how the scaling factors used by the \pkg'{geometry} might change native layout dimensions. The option \hx{reset} of the \pkg'{geometry} is also useful in this regard.
-\section{Using \stya{\bf xwatermark} with the \styb{\bf geometry} package}
-\label{sec:Xwatermark:Geometry}
-\lletter{S}{ome users} have reported an apparent ``conflict'' between the \styb{geometry} package and \stya{xwatermark}, which according to them makes it rather unpleasant to properly position the watermarks. There is actually what, for want of a better term, I may refer to as a ``mismatch'' between \styb{geometry} and \stya{xwatermark} but certainly not a conflict. The problem emanates from the \styb{geometry} package because it changes the scale, ratio, magnification, and other native dimensions of the paper to get the needed layout right all the time. The only layout parameter that the \styb{geometry} package may retain is the paper center, which, unfortunately, does not always coincide with the text center. In fact, even the paperwidth and paperheight can be changed by the user of the \styb{geometry} package.
+The \pkg'{geometry} saves native \texorlatex dimensions and switches in the macro \hx{\Gm@dorg} before processing \pkg'{geometry} options. This macro is called by \pkg{geometry} when the options \hx{pass} and \hx{reset} are passed to it. Reconciling the two packages (\pkg{xwatermark,geometry}) at a \quoted{high level} will involve simply calling this macro within the \pkg'{xwatermark} whenever \pkg{xwatermark} detects that the \pkg'{geometry} has been loaded by the user. This is what has been done in the \pkg'{xwatermark}: the package has a boolean option called \fx{disablegeometry}, which, if true, invokes the command \hx{\Gm@dorg} of the \pkg'{geometry} to disable \pkg'{geometry} settings and enforce native paper layout dimensions. First the \pkg'{xwatermark} detects at the very last moment of the document preamble (just before \hx{\begin{document}}) if the \pkg'{geometry} has been loaded by the user. If yes, and if the user has suggested \fx{disablegeometry}=\hx{true} in the call to \pkg{xwatermark}, then \pkg{xwatermark} issues the command \hx{\geometry{pass}}, which, as mentioned earlier, calls \hx{\Gm@dorg}.
-Reconciling the \stya{xwatermark} package with the \styb{geometry} package at the very low level requires more effort than I can afford now. The interim solution is that the user should set his/her watermarks before loading the \styb{geometry} package, or use the \styb{geometry} package with the option \styb{pass} in the preliminary runs (when setting the watermarks). The \styb{pass} option is available from version~4.2 of the \styb{geometry} package. It disables auto-layout and all of the \styb{geometry} settings except \styb{verbose} and \styb{showframe}. It can be used to determine the page layout of the \dclass and layouts created by other packages and manual settings. The user can also employ the option \styb{showframe} of the \styb{geometry} package to view how the scaling factors used by the \styb{geometry} package might change native layout dimensions. The option \styb{reset} of the \styb{geometry} package is also useful in this regard.
+After the effects of the \pkg'{geometry} are re-introduced (\ie, after setting the \pkg'{xwatermark} option \fx{disablegeometry}=\hx{false}), it might still be necessary, depending on the user need, to fine-tune the positions of the watermarks.
-The \styb{geometry} package saves native \TeXL dimensions and switches in the macro \cmdb{Gm@dorg} before processing \styb{geometry} package options. This macro is called by \styb{geometry} when the options \styb{pass} and \styb{reset} are passed to it. Reconciling the two packages (\stya{xwatermark} and \styb{geometry}) at a high level will involve simply calling this macro within \stya{xwatermark} whenever \stya{xwatermark} detects that the \styb{geometry} package has been loaded by the user. This is what has been done in the \stya{xwatermark} package: the package has a boolean option called \stya{dgeometry} (meaning ``disable geometry''), which, if true, invokes the command \cmdb{Gm@dorg} of the \styb{geometry} package to disable \styb{geometry} package settings and enforce native paper layout dimensions. First the \stya{xwatermark} package detects at the very last moment of the document preamble (just before \cmdb{begin\{document\}}) if the \styb{geometry} package has been loaded by the user. If yes, and if the user has set \stya{dgeometry=true} in the call to \stya{xwatermark}, then \stya{xwatermark} issues the command \cmdb{geometry\{pass\}}, which, as mentioned earlier, calls \cmdb{Gm@dorg}.
+Because the \pkg'{geometry} stipulates that the command \hx{\Gm@dorg} can be issued only in the document preamble, the switch \fx{disablegeometry} can appear as option only in \hx{\documentclass} or \hx{\usepackage{xwatermark}}. But it matters not which of the two packages (\pkg{geometry, xwatermark}) is loaded first. To call \hx{\Gm@dorg}, the \pkg'{xwatermark} uses the hook \hx{\BeforeStartOfDocument} from the \pkg'{catoptions}. \hx{\AtBeginDocument}, a native \latex hook, is inapplicable in this case.
-After the effects of the \styb{geometry} package are re-introduced (\ie, after setting \styb{pass=false}), it might still be necessary to fine-tune the positions of the watermarks.
-Because the \styb{geometry} package stipulates that the command \cmdb{Gm@dorg} can be issued only in the document preamble, the switch \stya{dgeometry} can appear only in \usepackxwm, as in, \eg,
-\begin{xwverbatim}
-\usepackage[printwatermark,allpages,dgeometry]{xwatermark},
-\end{xwverbatim}
-but it matters not which of the two packages (\styb{geometry} and \stya{xwatermark}) is loaded first. To call \cmdb{Gm@dorg}, the \stya{xwatermark} package uses the hook \cmdb{AtEndPreamble} from the \styb{etoolbox} package. \cmdb{AtBeginDocument}, a native \nLaTeX hook, is inapplicable in this case.
+\docsection{Support for \deadunexpandable{\acro{UNICODE}} and
+ \deadunexpandable{\acro{UTF}} encodings}
-The user should also remember that he/she can set his/her own margins without using the \styb{geometry} package, although many users find the \styb{geometry} package more convenient.
+The \pkg'{xwatermark} can be used with any font encoding, provided the \fx{fontfamily} is properly declared before use. For example, with the following declarations on \XeTeX, Rembrandt Wolpert (\url{wolpert@uark.edu}) obtained some \fx{.pdf} outputs that he is willing to share with other users:
-\section{Support for Unicode and UTF encodings}
-\lletter{T}{he} \stya{xwatermark} package can be used with any font encoding, provided the \stya{fontfamily} is properly declared before use. For example, with the following declarations on \XeTeX, Rembrandt Wolpert (\url{wolpert@uark.edu}) obtained some {}+.pdf+ outputs that he is willing to share with other users:
-\begin{xwverbatim}
+\start{example}[\newfontfamily]
\newfontfamily{\chinese}{STFangsong} % SinoType FangSong
-\newcommand{\chtext}[1]{{\chinese \XeTeXlinebreaklocale%
- "jp" \XeTeXlinebreakskip=0pt plus 1pt #1}%
+\newcommand{\chtext}[1]{{\chinese \XeTeXlinebreaklocale "jp"
+ \XeTeXlinebreakskip=0pt plus 1pt #1}%
}
-\watermarksetup{fontsize=5cm,align=center,
- color=red!75!blue!25,angle=90,xcoord=-65,ycoord=-38,
- scale=.49,textmark={=\fbox{\color{red!65}\chtext{%
- |color(red)watermark in Chinese or Japanese script|color(blue)}}=}%
-}
+\newwatermark[allpages,fontsize=5cm,align=center,
+ color=red!75!blue!25,angle=90,xpos=-65,ypos=-38,scale=.49]
+ {=\fbox{\color{red!65}\chtext{|color(red)watermark in Chinese or Japanese script|color(blue)}}=}
\newfontfamily{\Gara}{Garamond Premier Pro}
-\watermarksetup{fontsize=5cm,scale=.46,align=center,
- angle=90,color=red!75!blue!25,xcoord=-72,ycoord=-38,
- textmark={=\fbox{\color{red!65}\Gara The different %
- ligature}=\\[.35ex]}%
-}.
-\end{xwverbatim}
-
-It doesn't matter what the user declares as a \stya{fontfamily} provided he/she declares it before using it and provided the declaration is valid. It is thus possible to mix scripts in one watermark (\eg, Latin, Chinese, Korean, Japanese, Arabic, Russian scripts, you name it).
-
-\section{Further examples of use of \stya{\bf xwatermark} package}
-\lletter{T}{he file} \stya{xwatermark-examples.tex}, a source file of examples of use of the \stya{xwatermark} package, together with its \stya{pdf} version, are provided with this guide in the \stya{xwatermark} bundle.
-
-\section{Future extension}
-\lletter{C}{urrently the package} cannot put more than one watermark on the same page in a simple manner. To be able to do so, some tricks are necessary, as was done with the watermarks on the pages of this document. To position more than one mark on the same page, complicated tricks may be necessary, but are often possible. Markup boxes (especially zero-width boxes) can be handy in this respect, but the user should note the displeasure that unintended spaces can cause in boxes. It will be useful to relieve the user of such complications. This is an obvious track for extension of the package. One possible way to tackling this challenge is to accumulate the watermarks for each page before calling the shipout hooks, or loop over the watermarks (meant for the same page) within the shipout hooks, or write the watermarks to the auxiliary file and make more than one run to get them to the right pages.
-
-The user should note the real meanings of saved-box commands (such as \cmdb{newsavebox}, \cmdb{savebox}, and \cmdb{usebox}) before using them. They are actually bins and not all declarations made outside the bins may be visible inside them.
-
-There is also the issue with the \styb{geometry} package mentioned in section~\ref{sec:Xwatermark:Geometry}.
-
-\section{Epilogue}
-\lletter{B}{ug reports} and suggestions for further improvement and extension of the package are very much welcome.
-
-\section{Acknowledgement}
-I thank Joseph Wright (\url{joseph.wright@morningstar2.co.uk}) for his time in helping me resolve some of the challenges I encountered in coding this package---and for his continued support.
-
-\appendix
-\section{Package options}\label{sec:PackageOptions}
-\lletter{W}{e categorize} the package options into global and local. Global options are those set either in \dclass or in \usepackxwm or with the macro \wmsetup, while local options are those set with the macros \cmda{xwminipage}, \cmda{xwcolorbox} and \cmda{ywcolorbox}.
-
-\subsection{Global options}
-The global package options are listed and described in table~\vref{tab:GlobalOptions}.
-
-\extrarowheight=2pt
-\arrayrulecolor{yellow}
-\begin{tabularx}{\linewidth}{|m{3cm}|m{2.5cm}|X|}
-\caption{Global options of the package\label{tab:GlobalOptions}}\\\hline
-\rowcolor{pink}
-\bfseries Option&\bfseries Default&\bfseries Meaning\\\hline
-\endfirsthead
-\hline
-\multicolumn{3}{|l|}{\emph{Continued from last page}}\\\hline
-\bfseries Option&\bfseries Default&\bfseries Meaning\\\hline
-\endhead
-\multicolumn{3}{|r|}{\emph{Continued on next page}}\\\hline
-\endfoot
-\hline
-\endlastfoot
-+printwatermark+ & +true+ & Global boolean switch that determines whether watermark should be printed or not. This option can be passed to package as either \stya{true} or \stya{false} and can appear in the \dclass options list or \cmdb{usepackage}. If for any reason you don't want the watermark printed in any run, you can enter \stya{printwatermark=false}. If the option \styb{draft} or \styb{final} appears in the \dclass or \cmdb{usepackage}, it won't affect the printing or otherwise of the watermark. The printing of the watermark is determined by the option \stya{printwatermark}.\\\hline
-+allpages+, +evenpages+, +oddpages+, +pages+,~+page+ & & These determine the pages on which the watermarks are to be printed. The options \stya{allpages}, \stya{evenpages}, \stya{oddpages} are boolean keys, while \stya{pages} and \stya{page} require values, \eg, \stya{pages=x-x} and \stya{page=x}. If the package is loaded and none of these options is passed to it, the default watermark (DRAFT) will be printed on the first page of the document and a warning message logged in the transcript file.\\\hline
-+textmark+ & DRAFT & The text watermark.\\\hline
-+angle+ & $45^\circ$ & The orientation of the watermark (text and/or picture). \\\hline
-+scale+ & 1 & The scale of the text watermark.\\\hline
-+grayness+ & 0.8 & The grayness of the text watermark. This is no longer available as an option since the grayness of the gray color can be set as a percentage (\eg, +color=gray!25+).\\\hline
-+color+ & +gray+ & The color of the text watermark.\\\hline
-+fontfamily+ & +cmss+ & The fontfamily of the text watermark.\\\hline
-+fontsize+ & 5cm& The fontsize of the text watermark. If for some reason you need other fontsizes (\eg, 10pt, 11pt or 12pt for printing text watermarks in +\normalfont+), you will need to submit them as values of \stya{fontsize}.\\\hline
-+fontseries+ & +b+ & The font series of the text watermark. If you need normal document text, put \stya{fontseries=m}, which implies medium weight and width.\\\hline
-+xcoord+ & 0 & x-coordinate of watermark (with reference to the center of paper and not the text center).\\\hline
-+ycoord+ & 0 & y-coordinate of watermark (coinciding with center of paper). Both \stya{xcoord} and \stya{ycoord} should be submitted without units, since the unit is set separately by \stya{coordunit}.\\\hline
-+coordunit+ & +mm+ & The unit for x- and y-coordinates. \\\hline
-+align+ & +center+ & Alignment of the watermark (the key can assume the value \stya{center}, \stya{left}, \stya{right} or \stya{justified}). Any other alignment value is inadmissible and thus rejected by the package with a fatal error.\\\hline
-+width+ &+\paperheight+ & Width of \textbf{text} watermarks only; doesn't apply to graphic watermarks. For some design reasons we set +\paperheight+ as the default value of markwidth instead of markheight.\\\hline
-+height+ & +\paperwidth+ & Height of text watermark.\\\hline
-+picscale+ & 1 & Scale of picture watermark.\\\hline
-+picbb+ & 0 0 100 100& The bounding box (dvi mode) or viewport (pdf mode) of the picture watermark.\\\hline
-+picfile+ & & The filename of picture watermark. This, with its full path, must be submitted when including picture watermark.\\\hline
-+picfilex+ & eps/pdf & The filename extension of the picture watermark. Admissible extensions are \stya{eps}, \stya{pdf}, \stya{png} and \stya{jpeg}; the latter three may be used in the case of \pdfTeX. The file extension should be passed without the dot. If the option is not passed to package, \stya{xwatermark} selects \stya{eps} (in dvi mode) or \stya{pdf} (in \pdfTeX mode). \\\hline
-+showcenter+ & & Boolean that indicates if the center of the paper should be shown with a cross (and circle).\\\hline
-+dgeometry+ & +false+ & The package option that determines whether the page layout settings by the \styb{geometry} package should be disabled so that the watermarks can be set more readily by \stya{xwatermark}.\\
-\end{tabularx}
-
-\subsection{Local options}\label{sec:LocalOptions}
-Local package options are those associated with the macros \cmda{xwminipage}, \cmda{xwcolorbox} and \cmda{ywcolorbox}. They are described in table~\ref{tab:LocalOptions}.
-
-\begin{tabularx}{\linewidth}{|m{3cm}|m{2.5cm}|X|}
-\caption{Local options of the package\label{tab:LocalOptions}}\\\hline
-\rowcolor{pink}
-\bfseries Option&\bfseries Default&\bfseries Meaning\\\hline
-\endfirsthead
-\hline
-\multicolumn{3}{|l|}{\emph{Continued from last page}}\\\hline
-\bfseries Option&\bfseries Default&\bfseries Meaning\\\hline
-\endhead
-\multicolumn{3}{|r|}{\emph{Continued on next page}}\\\hline
-\endfoot
-\hline
-\endlastfoot
-\multicolumn{3}{|>{\columncolor{gray!25}}c|}{\bf\cmda{xwminipage} macro}\\\hline
-+width+ & +\paperwidth+ & Width of the boxedminipage.\\\hline
-+textcolor+ & +black+ & Color of text inside boxedminipage.\\\hline
-+framecolor+ & +white+ & Color of frame of boxedminipage.\\\hline
-+text+ & No text passed & Text that goes inside the boxedminipage.\\\hline
-+align+ & +center+ & Alignment of the text inside the boxedminipage of \cmda{xwminipage} (expected values are \stya{center}, \stya{left}, \stya{right} and \stya{justified}).\\\hline
-+framesep+ & +3pt+ & +\fboxsep+ of the boxedminipage.\\\hline
-+framerule+ & +0.4pt+ & +\fboxrule+ of the boxedminipage.\\\hline
-\multicolumn{3}{|>{\columncolor{gray!25}}c|}{\bf\cmda{xwcolorbox} macro}\\\hline
-+width+ & +\paperwidth+ & Width of the colorbox.\\\hline
-+textcolor+ & +black+ & Color of text inside colorbox.\\\hline
-+framecolor+ & +white+ & Color of frame of colorbox.\\\hline
-+text+ & No text passed & Text that goes inside the colorbox.\\\hline
-+align+ & +center+ & Alignment of the text inside the colorbox of \cmda{xwcolorbox} (expected values are \stya{center}, \stya{left}, \stya{right} and \stya{justified}).\\\hline
-+framesep+ & +3pt+ & +\fboxsep+ of the colorbox.\\\hline
-+framerule+ & +0.4pt+ & +\fboxrule+ of the colorbox.\\\hline
-\multicolumn{3}{|>{\columncolor{gray!25}}c|}{\bf\cmda{ywcolorbox} macro}\\\hline
-\multicolumn{3}{|m{\hsize-1.5cm}|}{%
-The options of the macro \cmda{ywcolorbox} are the same as those of the related macro \cmda{xwcolorbox}. Refer to section~\ref{sec:ywcolormacro} for the syntax of this macro.
-}\\
-\end{tabularx}
+\newwatermark[allpages,fontsize=5cm,scale=.46,align=center,
+ angle=90,color=red!75!blue!25,xpos=-72,ypos=-38]
+ {=\fbox{\color{red!65}\Gara The different ligature}=\\[.35ex]}.
+\finish{example}
+\hxi*{\newfontfamily}
+
+It doesn't matter what the user declares as a \fx{fontfamily} provided he/she declares it before using it and provided the declaration is valid. It is thus possible to mix scripts in one watermark (\eg, Latin, Chinese, Korean, Japanese, Arabic, Russian scripts, you name it).
+
+\docsection{Repeated graphics in a document}
+
+For graphics watermarks, the watermark image, or any other image that is repeated in the document, has the potential to make the processed version of the document surprisingly large. The problem is that the default mechanisms of graphics usage add the image at every point it is to be used, and when processed, the image appears in the output file at each such point.
+
+See the \acro{UKTUG FAG}, version~3.20 (2010), entry number~146, page~95, for the available solutions to this problem. As described by this reference, if the \texttt{PostScript} version of the file is destined for conversion to \pdf, either by a ghostscript-based mechanism such as \hx{ps2pdf} or by, for example, Acrobat Distiller, the issue is not as important, since the distillation mechanism will amalgamate graphics objects whether or not the \texttt{PostScript} has them amalgamated. \pdftex does the same job with graphics, automatically converting multiple insertions into pointers to graphics objects.
+
+
+\docsection{Further examples of use of \headpkg{xwatermark} package}
+
+The files \files'{xwatermark-examples1,xwatermark-examples2}, source files of examples of use of the \pkg'{xwatermark} together with their \pdf versions, are provided with this guide in the \pkg{xwatermark} bundle.
+
+
+\docsection(sec:packageoptions){Package options and macro keys}
+
+We categorize the package options and keys into global and local. Global options are those set either in \hx{\documentclass} or in \hx{\usepackage}, while local options are those set with the macros \ffx'{\newwatermark,\newwallpaper,\xwmminipage,\xwmcolorbox,\makecolorbox}.
+
+
+\docsubsection(sec:globaloptions){Global options}
+
+The global package options are listed and described in the following \amref{tab:globaloptions}.
+
+\ifboolTF{amd@inputfile}{%
+ \InputDocument{tab-globaloptions}
+}{}
+
+
+\docsubsection(sec:localoptions){Local options}
+
+Local package options are those associated with the commands \ffx'{\newwatermark, \newwallpaper, \xwmminipage, \xwmcolorbox, \makecolorbox, \fancypagenos}. They are described in the following \amref{tab:localoptions}.
+
+\ifboolTF{amd@inputfile}{%
+ \InputDocument{tab-localoptions}
+}{}
+
+
+\docsection(sec:version-hist){Version history}
+
+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.1}{2011/07/20}
+ \item Following user request, two new keys were introduced for the macro \fx{\fancypagenos}. \vsecref{sec:fancypagenos}
+ \end{version}
+ \begin{version}{1.5.0}{2011/07/10}
+ \item Introduced the \pkg'{ltxkeys}, a highly robust and optimized module for general creation and management of keys. \vsecref*
+ \item Provisions for placing more than one watermark on the same page. \vsecref{sec:newwatermarks}
+ \item Introduced wallpaper functionalities. \vsecref{sec:wallpapers}
+ \item Adaptable and flexible fancy page numbers. \vsecref{sec:fancypagenos}
+ \end{version}
+\end{versionhist}
+
+\newpage
+\indexpreamble{Index numbers refer to page numbers.}
+\indexpreambleformat{\centering}
+\indexcolumns\tw@
+\printindex
\end{document}
+
diff --git a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-manifest.tex b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-manifest.tex
deleted file mode 100644
index 514d40e1d97..00000000000
--- a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-manifest.tex
+++ /dev/null
@@ -1,17 +0,0 @@
-
-2010/01/10
-
-The xwatermark bundle (version 1.4) consists of the following files:
-
-xwatermark.sty - The style file
-xwatermark-guide.tex - The user manual
-xwatermark-examples.tex - The examples file
-xwatermark-guide.cfg - The configuration file for the user
- manual and example files
-xwatermark-bugreport.tex - The bug report file
-
-Readme - The README file
-xwatermarkpic.tex - Sample .tex graphics file
-xwatermarkpic.eps - Sample .eps graphics file
-xwatermarkpic.pdf - Sample .pdf graphics file
-
diff --git a/Master/texmf-dist/tex/latex/xwatermark/xwatermark.sty b/Master/texmf-dist/tex/latex/xwatermark/xwatermark.sty
index 61b875faeb7..81ceb5b120f 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.4. %
+% This is file 'xwatermark.sty', version 1.5.1, July 2011. %
% %
% This package puts user-specified watermarks (graphics and arbitrary %
% texts) on select pages of documents. See package documentation %
@@ -19,425 +19,2165 @@
% implied warranties of merchantability and fitness for a particular %
% purpose. %
% %
-% Copyright (c) 2010 Ahmed Musa (a.musa@rocketmail.com). %
+% Copyright (c) 2009-2011 Ahmed Musa (amusa22@gmail.com). %
%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%
-\begingroup
-\catcode064 11% @
-\catcode123 01% {
-\catcode125 02% }
-\def\x{\endgroup
- \edef\xwm@RestoreCodeAtEnd{%
- \catcode035 \the\catcode035% #
- \catcode064 \the\catcode064% @
- \catcode123 \the\catcode123% {
- \catcode125 \the\catcode125% }
- \catcode061 \the\catcode061% =
- }%
-}
-\x
-\@makeother{\=}%
-\catcode035=06% #
-\catcode064=11% @
-\catcode123=01% {
-\catcode125=02% }
-\def\xwm@EnsureCode#1#2{%
- \edef\xwm@RestoreCodeAtEnd{%
- \xwm@RestoreCodeAtEnd
- \catcode#1=\the\catcode#1\relax
- }%
- \catcode#1=#2\relax
-}
-\AtEndOfPackage{\xwm@RestoreCodeAtEnd}
-\xwm@EnsureCode{010}{12}% ^^J
-\xwm@EnsureCode{033}{12}% !
-\xwm@EnsureCode{039}{12}% '
-\xwm@EnsureCode{040}{12}% (
-\xwm@EnsureCode{041}{12}% )
-\xwm@EnsureCode{042}{12}% *
-\xwm@EnsureCode{044}{12}% ,
-\xwm@EnsureCode{045}{12}% -
-\xwm@EnsureCode{046}{12}% .
-\xwm@EnsureCode{047}{12}% /
-\xwm@EnsureCode{058}{12}% :
-\xwm@EnsureCode{060}{12}% <
-\xwm@EnsureCode{062}{12}% >
-\xwm@EnsureCode{094}{07}% ^ (superscript)
-\xwm@EnsureCode{096}{12}% `
-\xwm@EnsureCode{254}{12}% ^^fe
-\xwm@EnsureCode{255}{12}% ^^ff
-\xwm@EnsureCode{126}{13}% ~ (active)
-\def\readRCS$#1 #2 #3 #4 #5 #6 #7 #8 ${%
- \def\filedate{#4}%
- \def\fileversion{v#3}%
- \def\filetime{#5}%
- \def\fileauthor{#6\space#7}%
-}
-\def\filedesc{%
- Puts user-specified watermarks on select document pages (\fileauthor)}
-\readRCS
-$Id: xwatermark.sty,v 1.4 2010/01/10 09:00:00 Ahmed Musa Exp $
-\ProvidesPackage{xwatermark}[\filedate\space\fileversion\space\filedesc]
+
+\@ifpackageloaded{catoptions}{}{\RequirePackage{catoptions}[2011/07/30]}
+\UseNormalCatcodes
+\StyleFilePurpose{Puts select watermarks on select pages}
+\StyleFileRCSInfo
+$Id: xwatermark.sty,v 1.5.1 2011/07/30 09:00:00 Ahmed Musa Exp $
+\ProvidesPackage{xwatermark}[\StyleFileInfo]
\NeedsTeXFormat{LaTeX2e}[1996/12/01]
-\@ifpackageloaded{etoolbox}{}{\RequirePackage{etoolbox}[2009/08/06]}
-\@ifpackageloaded{ltxnew}{}{\RequirePackage{ltxnew}[2009/07/22]}
-\newrobustcmd\xwm@info[1]{\PackageInfo{xwatermark}{#1\@gobble}}
-\newrobustcmd\xwm@warn[1]{\PackageWarningNoLine{xwatermark}{#1}}
-\newrobustcmd\xwm@err[1]{\PackageError{xwatermark}{#1}{\@ehc}}
-\new\def\xwm@car#1#2\@nil{#1}
-\new\def\xwm@testarg#1{%
- \begingroup
- \escapechar=92\relax
- \edef\tmp@a{\expandafter\xwm@car\string#1\@nil}%
- \if\tmp@a\@backslashchar
- \aftergroup\@firstoftwo
- \else
- \aftergroup\@secondoftwo
+\SetStyleFileMessages[xwm@]{info}{warn}{err}
+\robust@def*\xwm@@err#1#2#3{\xwm@err{#1}{#2}\@gobble}
+\cptloadpackages{%
+ fix-cm||2006/03/24;
+ picture||2008/11/26;
+ graphicx||1999/02/16;
+ atbegshi||2008/07/31;
+ fancyhdr;
+ atveryend||2010/03/24;
+ ltxkeys||2011/01/01;
+ framed||2007/10/04
+}
+\AtEndOfPackage{\AtBeginDocument{%
+ \ifcsndefTF{ver@hyperref.sty}{}{\usepackage{hyperref}}%
+}}
+\newletcs\xwm@nil\relax
+\AtBeginShipoutInit
+\newvariables{box}[xwm@box]{a,b}\relax
+\newvariables{count}[xwm@]{cnta}\relax
+\newvariables{if}[xwm@]{pdf,swa,swb,foregrd,wall}[false]
+\newvariables{write}[xwm@]{wrt}\relax
+\robust@def*\AtShipoutAlwaysUpperLeft#1{%
+ \AtBeginShipout{\AtBeginShipoutUpperLeft{#1}}%
+}
+\newletcs\stripallbr\stripallouterbraces
+\newletcs\stripallbrincs\stripallouterbracesincs
+\new@def*\xwmremoveleadparsers#1#2{%
+ \s@expandarg\ifbracedTF{#2}{%
+ \unexpanded\expandafter{#2}%
+ }{%
+ \unexpanded\expandafter{\romannumeral
+ \expandafter\xwm@removeleadparsers#2\batchmode{#1}}%
+ }%
+}
+\new@def*\xwm@removeleadparsers#1#2\batchmode#3{%
+ \ifcondTF\if\string#3\string#1\fi{%
+ \xwm@removeleadparsers#2\batchmode{#3}%
+ }{%
+ 0 #1#2%
+ }%
+}
+\robust@def*\xwm@ifxcolorloaded{%
+ \ifcsndefTF{ver@xcolor.sty}\@iden{%
+ \xwm@err{'xcolor' package not loaded}\@ehc
+ }%
+}
+\robust@def*\xwmdefinecolor{%
+ \xwm@ifxcolorloaded{%
+ \let\reserved@e\definecolor
+ \cpt@testopt\xwm@definecolor{}%
+ }%
+}
+\robust@def*\xwmcolorlet{%
+ \xwm@ifxcolorloaded{%
+ \let\reserved@e\colorlet
+ \cpt@testopt\xwm@definecolor{}%
+ }%
+}
+\robust@def*\xwm@definecolor[#1]#2{%
+ \@ifundefinedcolor{#2}{%
+ \reserved@e[#1]{#2}%
+ }{%
+ \xwm@err{Color name '#2' already defined}\@ehc
+ }%
+}
+\robust@def*\xwmdefinecolorset{\cpt@testopt\xwm@definecolorset{x}}
+\robust@def*\xwm@definecolorset[#1]{%
+ \cpt@testpnopt{\xwm@d@finecolorset{#1}}{1}%
+}
+\robust@def*\xwm@d@finecolorset#1(#2)#3{%
+ \xwm@ifxcolorloaded{%
+ \begingroup
+ \emptifycsset{\xwm@tempb,\xwm@tempc,\xwm@tempd,\xwm@tempe}%
+ \def\xwm@tempa##1,##2,##3,##4,##5\@nil{%
+ \ifx\noboundary##4\noboundary
+ \xwm@err{Incomplete color format in
+ \string\xwmdefinecolorset}\@ehc
+ \else
+ \def\reserved@a{##1}%
+ \fi
+ }%
+ \cpt@stfalse\cpt@csvnormalize[;]{#3}%
+ \def\do##1;{%
+ \ifnot@nil{##1}{%
+ \xwm@tempa##1,,,,\@nil
+ \xifinsetTF{,\reserved@a,}{,\xwm@tempd,}{%
+ \edef\xwm@tempe{\cptliststack,\xwm@tempe\reserved@a}%
+ }{%
+ \edef\xwm@tempd{\cptliststack,\xwm@tempd\reserved@a}%
+ \@ifundefinedcolor{#1\reserved@a#2}{%
+ \edef\xwm@tempb{\cptliststack;\xwm@tempb##1}%
+ }{%
+ \edef\xwm@tempc{\cptliststack;\xwm@tempc#1\reserved@a#2}%
+ }%
+ }%
+ \do
+ }%
+ }%
+ \expandafter\do\normalized@list;\@nil;%
+ \ifcsemptyTF\xwm@tempe{}{%
+ \xwm@err{Color names '\expandcsonce\xwm@tempe' multiply
+ \MsgBrk submitted to \string\xwmdefinecolorset}\@ehc
+ }%
+ \ifcsemptyTF\xwm@tempc{}{%
+ \xwm@err{Color names '\expandcsonce\xwm@tempc' already in use}\@ehc
+ }%
+ \ifcsemptyTF\xwm@tempb{}{%
+ \cptexpandarg{\xglobal\definecolorset{rgb}{#1}{#2}}
+ {\expandcsonce\xwm@tempb}%
+ }%
+ \endgroup
+ }%
+}
+\DefSuffixChecker\xwm@suffixcheck{*}{'}
+\robust@def*\xwmifitemsinTF{%
+ \cpt@swatrue\cpt@testopt\xwm@itemsin\@ne
+}
+\robust@def*\xwmifitemsinFT{%
+ \cpt@swafalse\cpt@testopt\xwm@itemsin\@ne
+}
+\robust@def\xwm@itemsin[#1]#2#3{%
+ \ifnum\numexpr#1<\@ne
+ \xwm@err{Invalid number '\the#1'\relax\MsgBrk
+ for command \string\xwmifitemsinTF}\@ehc
\fi
+ \lowercase{%
+ \edef\xwm@tempa{\unexpanded{#2}}%
+ \edef\xwm@tempb{\unexpanded{#3}}%
+ }%
+ \cpt@sttrue\cpt@csvnormalize[,]\xwm@tempb
+ \chardef\xwm@nritems\z@pt
+ \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
+ }%
+ }%
+ \csv@@parse*[,]\xwm@tempa
+ \csname
+ @\ifnum\xwm@nritems>\numexpr#1-1\relax
+ \ifcpt@swa first\else second\fi
+ \else
+ \ifcpt@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
+ }{%
+ \xifinsetTF{\detokenize{\lastdocpage}}{\cptoxdetok{#1}}{%
+ \xwm@swbtrue
+ }{%
+ \xwm@swbfalse
+ }%
+ }%
+ \protected@edef#2{#1}\def#3{}%
+ \begingroup
+ \catcode`\-=12\relax
+ \cptscantokens#2%
+ \postgroupdef#2\endgroup
+ \oifinsetTF{-}{#2}{%
+ \expandafter\xwm@splitpagerange#2\xwm@nil{#2}{#3}%
+ }{%
+ \ifblankTF{#1}{%
+ \xwm@err{Empty page range for watermark:
+ ^^J'\expandcsonce\currentmark'.^^J}\@ehc
+ }{%
+ \protected@edef#3{#1}%
+ }%
+ }%
+}
+\robust@def*\xwm@splitpagerange#1-#2\xwm@nil#3#4{%
+ \def#3{#1}\def#4{#2}%
+ \ifinsetTF{-}{#2}{%
+ \xwm@err{Too many hyphens in page range '#1-#2'
+ \MsgBrk of watermark:^^J'\expandcsonce\currentmark'}\@ehc
+ }{%
+ \ifblankTF{#1}{%
+ \xwm@warn{No start-page in page-range of watermark:
+ ^^J'\expandcsonce\currentmark'.^^JI have used the
+ default start-page '\xwm@defaultfirstpage'
+ instead}%
+ \def#3{\xwm@defaultfirstpage}%
+ \xwm@swafalse
+ }{%
+ \xwm@swatrue
+ }%
+ \ifblankTF{#2}{%
+ \xwm@warn{No end-page for page-range
+ of watermark:^^J'\expandcsonce\currentmark'
+ ^^JI have used the default end-page
+ '\xwm@defaultlastpage' instead}%
+ \def#4{\xwm@defaultlastpage}%
+ \xwm@swafalse
+ }{%
+ \xwm@swatrue
+ }%
+ \ifxwm@swa
+ \ifnum\numexpr#1=\numexpr#2\relax\else
+ \ifnum\numexpr#1<\numexpr#2\relax\else
+ \ifxwm@swb\else
+ \xwm@err{Watermark start-page '#1' is greater
+ than end-page '#2'}\@ehc
+ \fi
+ \fi
+ \fi
+ \fi
+ }%
+}
+\let\xwm@papercenter\relax
+\ifdefTF\pdfoutput{%
+ \ifnum\pdfoutput<\@ne\xwm@pdffalse\else\xwm@pdftrue\fi
+}{%
+ \xwm@pdffalse
+}
+\new@def*\xwm@allowedcoordunits{%
+ em,ex,in,pt,pc,cm,mm,dd,cc,nd,nc,bp,sp,\paperwidth,%
+ \paperheight,\textwidth,\textheight,\hsize,\vsize,%
+ \columnwidth,\linewidth
+}
+\robust@def*\xwm@checkcoordunit#1{%
+ \oifinset@sp@TF,{#1}{\xwm@allowedcoordunits}{}{%
+ \xwm@err{Invalid coordinate unit '#1'}{%
+ Allowed coordinate units are:
+ ^^J||\xwm@allowedcoordunits||^^J}%
+ }%
+}
+\robust@def*\xwm@defaultunits#1#2{%
+ \begingroup
+ \@defaultunits\@tempdima\dimexpr#1\p@\relax\@nnil
+ \edefpass#2{\endgroup\def\noexpand#2{\the\@tempdima}}%
+}
+\robust@def*\xwm@getposition#1#2#3{%
+ \begingroup
+ \@defaultunits\@tempdima\dimexpr#1#3\p@\relax\@nnil
+ \csn@xdef{\cptremovescape#1@a}{%
+ \the\dimexpr0.5\paperwidth+\@tempdima\relax
+ }%
+ \@defaultunits\@tempdima\dimexpr#2#3\p@\relax\@nnil
+ \csn@xdef{\cptremovescape#2@a}{%
+ \the\dimexpr-0.5\paperheight+\@tempdima\relax
+ }%
\endgroup
}
-\newrobustcmd*\xwm@numdef[2]{%
- \xwm@testarg{#1}{}{\xwm@err{Unacceptable argument '#1' for number}}
- \ifstrempty{#2}{\xwm@err{Empty argument for counter}}{}
- \ifundef{#1}{\new\count#1\relax #1=\numexpr#2\relax}{#1=\numexpr#2\relax}
-}
-\newrobustcmd*\xwm@dimdef[2]{%
- \xwm@testarg{#1}{}{\xwm@err{Unacceptable argument '#1' for dimension}}
- \ifstrempty{#2}{\xwm@err{Empty argument for dimension}}{}
- \ifundef{#1}{\new\dimen#1\relax #1=\dimexpr#2\relax}{#1=\dimexpr#2\relax}
-}
-\new\long\def\xwm@afterfi#1\fi{\fi#1}
-\new\long\def\xwm@afterelsefi#1\else#2\fi{\fi#1}
-\new\let\xwm@pagestart\@empty
-\new\let\xwm@pageend\@empty
-\new\def\xwm@pagerange#1{%
- \renew\def\xwm@pagestart{#1}%
- \renew\def\xwm@pageend{}%
- \xwm@pagerange@ifhyphen#1-\@nil{%
- \ifx\xwm@pagestart\@empty
- \xwm@afterelsefi\xwm@err{Empty page range passed to package}%
+\cptrobustify{%
+ \fbox,\framebox,\makebox,\rotatebox,\scalebox,\raisebox
+}
+\new@def*\xwm@relax{\relax}
+\robust@def*\xwm@settextalign#1{%
+ \ifmacroTF{#1}{}{\cpt@notcserr{#1}}%
+ \begingroup
+ \cptexpandmacro{#1}\xwm@tempa
+ \cptexpandargonce{\endgroup\stripallbr}\xwm@tempa#1%
+ \ltxkeys@trimspacesincs{#1}%
+ \cptexpandsecond{\def\reserved@a##1}{#1}##2##3\xwm@nil{%
+ \ifx\noboundary##3\noboundary
+ \cpt@err{Invalid value '#1' for textalign}\@ehc
\else
- \xwm@afterfi
- \xwm@err{Only page \xwm@pagestart\space was passed as page range}%
+ \def#1{##2}%
\fi
+ }%
+ \cptexpandsecond{\reserved@a
+ center{center},\centering{center},right{flushright},
+ \flushright{flushright},\raggedleft{flushright},
+ left{flushleft},\flushleft{flushleft},\raggedright{flushleft},
+ justified{xwm@relax},\relax{xwm@relax},xwm@relax{xwm@relax}%
+ }{#1}{\xwm@nil}\xwm@nil
+}
+\robust@def*\xwm@getalign#1{%
+ \ifmacroTF{#1}{%
+ \csn@edef{xwm@\expandafter\@gobblethree\string#1}{%
+ \xifstrcmpTF{#1}{\relax}{relax}{#1}%
+ }%
}{%
- \xwm@pagerange@split#1\@nil
+ \cpt@notcserr{#1}%
}%
}
-\new\def\xwm@pagerange@split#1-#2\@nil{%
- \renew\def\xwm@pagestart{#1}%
- \renew\def\xwm@pageend{#2}%
- \xwm@pagerange@ifhyphen#2-\@nil{%
- \ifx\xwm@pagestart\@empty
- \expandafter\xwm@err{No starting page for page range}%
- \else
- \ifx\xwm@pageend\@empty
- \xwm@afterelsefi
- \xwm@err{No ending page for page range}%
- \else
- \xwm@afterfi
- \xwm@info{Page range:\space\xwm@pagestart\space to \xwm@pageend}%
+\robust@def*\xwm@setboxalign#1{%
+ \ifmacroTF{#1}{}{\cpt@notcserr{#1}}%
+ \begingroup
+ \toks@{}%
+ \cptexpandarg\lowercase{\def\noexpand\reserved@a{#1}}%
+ \def\xwm@tempa{}\def\xwm@tempb{}%
+ \def\xwm@resa##1-{%
+ \ifstrcmpTF{##1}{\xwm@nil}{}{%
+ \ifinsetTF{,##1,}{,top,left,right,bottom,center,%
+ justified,}{%
+ \edef\xwm@tempa{\cptliststack,\xwm@tempa##1}%
+ }{%
+ \ifinsetTF{,##1,}{,l,r,b,t,c,s,}{%
+ \edef\xwm@tempb{\xwm@tempb##1}%
+ }{%
+ \toks@\expandafter{\the\toks@##1}%
+ }%
+ }%
+ \xwm@resa
+ }%
+ }%
+ \expandafter\xwm@resa\reserved@a-\xwm@nil-%
+ \s@expandarg\ifnullTF{\the\toks@}{}{%
+ \xwm@err{'boxalign' has invalid or inconsistent
+ \MsgBrk values '#1'}\@ehc
+ }%
+ \ifcsnullTF\xwm@tempa{}{%
+ \ifcsnullTF\xwm@tempb{}{%
+ \xwm@err{Invalid values '#1' for 'boxalign':
+ \MsgBrk possibly a mixture of styles}\@ehc
+ }%
+ }%
+ \def\xwm@tempc{}%
+ \ifcsnullTF\xwm@tempa{}{%
+ \def\xwm@resa##1##2##3\xwm@nil##4{%
+ \ifblankTF{##3}{}{%
+ \ifinsetFT{,##1,}{,##4,}{}{%
+ \xifinsetTF{##2}{\xwm@tempc}{}{%
+ \edef\xwm@tempc{\xwm@tempc##2}%
+ }%
+ }%
+ \xwm@resa##3\xwm@nil{##4}%
+ }%
+ }%
+ \cptexpandarg
+ {\xwm@resa{center}{c}{justified}{s}{left}{l}{right}{r}%
+ {top}{t}{bottom}{b}\xwm@mil\xwm@mil\xwm@nil}\xwm@tempa
+ }%
+ \ifcsnullTF\xwm@tempb{}{%
+ \def\siso@do##1{%
+ \ifinsetFT{,##1,}{,l,r,b,t,c,s,}{}{%
+ \xifinsetTF{##1}{\xwm@tempc}{}{%
+ \edef\xwm@tempc{\xwm@tempc##1}%
+ }%
+ }%
+ }%
+ \simpleexpandarg\siso@@loop\xwm@tempb
+ }%
+ \ifcsnullTF\xwm@tempc{%
+ \xifblankTF{#1}{%
+ \def\xwm@tempc{s}%
+ }{%
+ \xwm@err{Invalid entries '#1' for 'boxalign'}\@ehc
+ }%
+ }{%
+ \begingroup
+ \cpt@cnta\z@pt
+ \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
+ \fi
+ \endgroup
+ }%
+ \let#1=\xwm@tempc
+ \postgroupdef#1\endgroup
+}
+\robust@def*\xwm@notenddocerr{%
+ \xwm@err{Wrong location of \noexpand\enddocument command}\@ehc
+}
+\robust@def*\AfterEndOfDocument{\grightaddtocs\xwm@afterenddoc}
+\new@def*\xwm@afterenddoc{}
+\robust@def*\AfterLastPageOfDocument{%
+ \grightaddtocs\xwm@afterlastpage
+}
+\new@def*\xwm@afterlastpage{}
+\AtEndDocument{%
+ \let\xwm@aft@renddoc\AtVeryEnd@AtVeryEndDocumentHook
+ \def\AtVeryEnd@AtVeryEndDocumentHook{%
+ \let\AfterEndOfDocument\@firstofone
+ \xwm@afterenddoc\xwm@aft@renddoc
+ \let\AfterEndOfDocument\xwm@notenddocerr
+ \undefcs\xwm@afterenddoc
+ \undefcs\xwm@aft@renddoc
+ }%
+ \let\xwm@afterl@stpage\AtVeryEnd@AfterLastShipoutHook
+ \def\AtVeryEnd@AfterLastShipoutHook{%
+ \let\AfterLastPageOfDocument\@firstofone
+ \xwm@afterlastpage\xwm@afterl@stpage
+ \let\AfterLastPageOfDocument\xwm@notenddocerr
+ \undefcs\xwm@afterlastpage
+ \undefcs\xwm@afterl@stpage
+ }%
+ \let\xwm@n@wlabel\xwm@testdef
+}
+\robust@def*\xwm@newlabel{\xwm@n@wlabel{xwmr}}
+\robust@def*\xwm@n@wlabel#1#2#3{%
+ \begingroup
+ \ifcsndefFT{#1@#2}{}{%
+ \gdef\xwm@multiplelabels{%
+ \@ltx@warn{There were multiply-defined labels}%
+ }%
+ \@ltx@warn{Label '#2' multiply defined}%
+ }%
+ \csn@gdef{#1@#2}{#3}%
+ \endgroup
+}
+\let\xwm@multiplelabels\relax
+\BeforeStartOfDocument{%
+ \global\let\xwm@multiplelabels\relax
+}
+\robust@def*\xwm@testdef#1#2#3{%
+ \begingroup
+ \def\xwm@tempa{#3}%
+ \aftercsname\ifxTF{#1@#2}\xwm@tempa
+ {\global\xwm@swafalse}{\global\xwm@swatrue}%
+ \endgroup
+}
+\AfterLastPageOfDocument{%
+ \if@filesw
+ \begingroup
+ \advance\c@page\m@one
+ \xwmlabel{xwmlastpage}%
+ \endgroup
+ \fi
+ \immediate\closeout\xwm@wrt
+ \InputIfFileExists{\jobname.xwm}{}{}%
+ \if@filesw
+ \ifx\xwm@multiplelabels\relax
+ \ifxwm@swa
+ \@ltx@warn{Label(s) may have changed.
+ Rerun to get cross-references right}%
\fi
+ \else
+ \xwm@multiplelabels
\fi
+ \fi
+}
+\new@def*\xwm@labelcarr#1#2#3\xwm@nil{\ifblankTF{#3}{}{#2}}
+\new@def*\xwmgetpagenumber#1{%
+ \ifcsndefTF{xwmr@#1}{%
+ \cptsevenxp\xwm@labelcarr
+ \usename{xwmr@#1}\xwm@defaultfirstpage\xwm@nil
}{%
- \xwm@err{Too many hyphens in page range}%
+ \xwm@defaultfirstpage
}%
}
-\new\def\xwm@pagerange@ifhyphen#1-#2\@nil{%
- \ifstrempty{#2}{\@firstoftwo}{\@secondoftwo}%
+\new@def*\lastdocpage{\xwmgetpagenumber{xwmlastpage}}
+\robust@def*\xwmlabel#1{%
+ \@bsphack
+ \begingroup
+ \@onelevel@sanitize\@currentlabelname
+ \edef\@currentlabelname{%
+ \expandafter\strip@period\@currentlabelname\relax.\relax\@@@
+ }%
+ \immediate\write\@auxout{%
+ \string\newlabel{#1}{{\@currentlabel}{\thepage}%
+ {\@currentlabelname}{\@currentHref}{}}%
+ }%
+ \immediate\write\xwm@wrt{%
+ \string\xwm@newlabel{#1}{{\@currentlabel}{\thepage}%
+ {\@currentlabelname}{\@currentHref}{}}%
+ }%
+ \endgroup
+ \@esphack
}
-\@ifpackageloaded{fix-cm}{}{\RequirePackage{fix-cm}[2006/03/24]}
-\@ifpackageloaded{graphicx}{}{\RequirePackage{graphicx}[1999/02/16]}
-\@ifpackageloaded{xkeyval}{}{\RequirePackage{xkeyval}[2008/08/13]}
-\@ifpackageloaded{atbegshi}{}{\RequirePackage{atbegshi}[2008/07/31]}
-\@ifpackageloaded{picture}{}{\RequirePackage{picture}[2008/11/26]}
-\@ifpackageloaded{xcolor}{%
- \xwm@info{You have loaded 'xcolor' package\MessageBreak
- with options that possibly differ\MessageBreak
- from those used in 'xwatermark' package}
-}{%
- \RequirePackage[table,hyperref]{xcolor}[2007/01/21]
- \xwm@info{'xcolor' package loaded with\MessageBreak
- options 'table', 'hyperref'}
-}
-\@ifpackageloaded{xifthen}{}{\RequirePackage{xifthen}[2009/04/17]}
-\@ifpackageloaded{boxedminipage}{}{\RequirePackage{boxedminipage}}
-\@ifpackageloaded{keyreader}{}{\RequirePackage{keyreader}[2010/01/01]}
-\krsetup{parser=;,macroprefix=xwm@,keyprefix=XWM,keyfamily=xwatermark}
-\xwm@dimdef{\xwm@xcoord@a}{\z@}
-\xwm@dimdef{\xwm@ycoord@a}{\z@}
-\xwm@numdef{\xwm@minmark}{\z@}
-\xwm@numdef{\xwm@c@printmark}{\z@}
-\new\let\xwm@papercenter\relax
-\providetoggle{pdf}
-\ifundef\pdfoutput{}{\unless\ifnum\pdfoutput<1\toggletrue{pdf}\fi}
-\define@boolkey[XWM]{xwatermark}[xwm@]{printwatermark}[true]{%
- \ifxwm@printwatermark\xwm@minmark=\@ne\fi}
-\define@boolkeys[XWM]{xwatermark}[xwm@bool@]{onepageonly,%
- prange,tmark,pmark,showcenter}[true]
-\define@boolkey[XWM]{xwatermark}[xwm@]{firstpage}[true]{%
- \ifxwm@firstpage\xwm@minmark=1\fi}
-\define@boolkey[XWM]{xwatermark}[xwm@]{allpages}[true]{%
- \ifxwm@allpages\xwm@minmark=1\fi}
-\define@boolkey[XWM]{xwatermark}[xwm@]{oddpages}[true]{%
- \ifxwm@oddpages\xwm@minmark=1\fi}
-\define@boolkey[XWM]{xwatermark}[xwm@]{evenpages}[true]{%
- \ifxwm@evenpages\xwm@minmark=1\fi}
-\define@boolkey[XWM]{xwatermark}[xwm@]{dgeometry}[true]{%
- \AtEndPreamble{%
- \ifxwm@dgeometry
- \ifcsdef{geometry}{%
- \geometry{pass}%
- \xwm@info{I've detected that you've loaded the\MessageBreak
- 'geometry' package. To avoid scale changes by\MessageBreak
- 'geometry', I have disabled its features.\MessageBreak
- You should set your watermarks before using\MessageBreak
- 'geometry'}}{}%
+\InputIfFileExists{\jobname.xwm}{}{}
+\if@filesw
+ \immediate\openout\xwm@wrt=\jobname.xwm
+ \immediate\write\xwm@wrt{\relax}
+\fi
+\robust@def*\DeclareWatermarkParser#1{%
+ \begingroup
+ \stripallbr{#1}\xwm@tempa
+ \xdef\xwm@watermarkparser{\cptoxdetok\xwm@tempa}%
+ \endgroup
+}
+\DeclareWatermarkParser{;}
+\robust@def*\xwm@put{\leavevmode\put}
+\new@edef*\xwm@defaultfileext{\ifxwm@pdf pdf\else eps\fi}
+\new@def*\xwm@picfilesread{}
+\robust@def*\xwm@fileextfn#1#2{%
+ \ifcsndefFT{#2picfile}{}{%
+ \def\xwm@tempb##1##2{%
+ \xwm@warn{Default file extension '##1'\MsgBrk
+ substituted for invalid '#1' in\MsgBrk
+ ##2 mode. I'll later confirm the\MsgBrk
+ existence of \usename{#2picfile}.##1%
+ }%
+ }%
+ \ifcsnnullTF{#2picfile}{%
+ \csn@edef{#2picfileext}{}%
+ }{%
+ \xifinsetTF{,\usename{#2picfile},}{,\xwm@picfilesread,}{%
+ \xwm@swbfalse
+ }{%
+ \xwm@swbtrue
+ \cptgxaddtolist*\xwm@picfilesread{\usename{#2picfile}}%
+ }%
+ \aftercsname\stripallbrincs{#2picfileext}%
+ \if@boolTF{xwm@pdf}{%
+ \xifinsetTF{,\usename{#2picfileext},}{,pdf,png,jpeg,jpg,mps,}{}{%
+ \csn@def{#2picfileext}{pdf}%
+ \ifxwm@swb\xwm@tempb{pdf}{pdf}\fi
+ }%
+ }{%
+ \xifinsetTF{,\usename{#2picfileext},}{,eps,ps,}{}{%
+ \csn@def{#2picfileext}{eps}%
+ \ifxwm@swb\xwm@tempb{eps}{dvi}\fi
+ }%
+ }%
+ }%
+ }%
+}
+\ltxkeys@boolkey[XWM]{main}[xwm@]{disablegeometry}[true]{%
+ \BeforeStartOfDocument{%
+ \ifxwm@disablegeometry
+ \ifdefFT\geometry{}{%
+ \geometry{pass}%
+ \xwm@info{On your request (ie, 'disablegeometry=true')
+ \MsgBrk I have disabled the features of the
+ \MsgBrk 'geometry' package}%
+ }%
\fi
}%
}
-\define@choicekey*+[XWM]{xwatermark}{align}[\val\nr]%
-{center,right,left,justified}[center]{%
- \ifcase\nr\relax
- \def\xwm@align{\centering}%
- \or
- \def\xwm@align{\flushright}%
- \or
- \def\xwm@align{\flushleft}%
- \or
- \let\xwm@align\relax
+\new@def*\xwm@gr@phicsoptions{}
+\robust@def*\GraphicsOptions#1{\gdef\xwm@gr@phicsoptions{#1}}
+\ltxkeys@definekeys*[XWM]<main>[xwm@]{%
+ disable-geometry=true/\setmnkey{disablegeometry};
+ printwatermark=true;
+ print-watermark=true/\setmnkey{printwatermark};
+ allownesting=true;
+ showpagecenter=true/\if@boolTF{xwm@showpagecenter}
+ {\wmk@showpagecentertrue\wlp@showpagecentertrue}{};
+ show-page-center=true/\setmnkey{showpagecenter};
+ showpapercenter=true/\setmnkey{showpagecenter};
+ usedummymarks=true;
+ use-dummy-marks=true/\setmnkey{usedummymarks};
+ defaultfirstpage=1;
+ default-first-page=1/\setmnkey{defaultfirstpage};
+ defaultlastpage=\xwmgetpagenumber{xwmlastpage};
+ default-last-page=\xwmgetpagenumber{xwmlastpage}/
+ \setmnkey{defaultlastpage};
+ frontpagestyle=empty;
+ front-page-style=empty/\setmnkey{frontpagestyle};
+ watermarkparser={;}/\DeclareWatermarkParser{#1};
+ watermark-parser={;}/\setmnkey{watermarkparser};
+ resetpaperorigin=true/\ifxwm@resetpaperorigin\pdfhorigin\z@pt
+ \pdfvorigin\z@pt\hoffset\z@pt\voffset\z@pt\fi;
+ reset-paper-origin=true/\setmnkey{resetpaperorigin};
+}
+\ltxkeys@biboolkeys+[XWM]{main}[xwm@]{draft,final}[true]
+ {}{}{\ltxkeys@keyvalerr}
+\makeoption@keys[XWM]{main}
+\BeforeStartOfDocument{%
+ \ifxwm@printwatermark
+ \cptreplaceoneelement\XWM@main@initial@keyvals
+ {printwatermark=false}{printwatermark=true}%
\fi
-}{%
- \xwm@err{Inadmissible value '\string#1' for align}%
-}
-\define@cmdkey[XWM]{xwatermark}[xwm@]{page}[1]{%
- \xwm@bool@onepageonlytrue\xwm@minmark=\@ne
-}
-\define@key[XWM]{xwatermark}{pages}[1-1]{%
- \xwm@bool@prangetrue
- \xwm@pagerange{#1}\xwm@minmark=\@ne
-}
-\iftoggle{pdf}{\new\def\xwm@picfilex{pdf}}{\new\def\xwm@picfilex{eps}}
-\define@cmdkey[XWM]{xwatermark}[xwm@]{picfile}[]{%
- \ifstrempty{#1}{\xwm@bool@pmarkfalse}{%
- \xwm@bool@pmarktrue\xwm@minmark=\@ne
- }%
-}
-\define@cmdkey[XWM]{xwatermark}[xwm@]{textmark}[DRAFT]{%
- \ifstrempty{#1}{\xwm@bool@tmarkfalse}{\xwm@bool@tmarktrue}%
-}
-\define@cmdkey[XWM]{xwatermark}[xwm@]{picfilex}[eps]{%
- \ifthenelse{\equal{\xwm@picfilex}{pdf}\OR\equal{\xwm@picfilex}{png}
- \OR\equal{\xwm@picfilex}{jpeg}\OR\equal{\xwm@picfilex}{eps}}{}{%
- \xwm@err{File extension \xwm@picfilex\space inadmissible}}
- \iftoggle{pdf}{%
- \ifthenelse{\isempty{\xwm@picfilex}\OR\equal{\xwm@picfilex}{eps}}%
- {\def\xwm@picfilex{pdf}}{}%
- }{%
- \ifthenelse{\isempty{\xwm@picfilex}\OR\equal{\xwm@picfilex}{pdf}%
- \OR\equal{\xwm@picfilex}{png}\OR\equal{\xwm@picfilex}{jpeg}}%
- {\def\xwm@picfilex{eps}}{}%
- }%
-}
-\define@keylist{2,color,gray!25,;2,fontfamily,bch,;2,angle,45,;
- 2,scale,1,;2,coordunit,mm,;2,fontsize,5cm,;2,fontseries,b,;
- 2,height,\paperwidth,;2,width,\paperheight,;2,xcoord,\z@,;
- 2,ycoord,\z@,;2,picscale,1,;2,picbb,0 0 100 100,}
-\presetkeys[XWM]{xwatermark}{tmark,angle,scale,color,
- textmark,fontfamily,fontsize,fontseries,coordunit,
- align,height,width,xcoord,ycoord,picscale,picbb}{}
-\DeclareOptionX*{\xwm@warn{Unknown option '\CurrentOption' ignored}}
-\ExecuteOptionsX[XWM]<xwatermark>{printwatermark}
-\ProcessOptionsX*[XWM]<xwatermark>\relax
-\newrobustcmd\watermarksetup[1]{\setkeys[XWM]{xwatermark}{#1}}
-\AtBeginDocument{%
- \xwm@disable@keys[XWM]{xwatermark}{printwatermark,dgeometry}%
-}
-\new\def\xwm@coords{\begingroup%
- \protected@edef\@tempa{\endgroup%
- \xwm@dimdef{\xwm@xcoord@a}{0.5\paperwidth+
- \number\xwm@xcoord\xwm@coordunit}%
- \xwm@dimdef{\xwm@ycoord@a}{-0.5\paperheight+
- \number\xwm@ycoord\xwm@coordunit}%
- }\@tempa
-}
-\unless\ifxwm@printwatermark
- \xwm@info{printwatermark=false: no watermark printed}
-\fi
-\newcommand\xwm@papercenter{%
- \color{red}%
- \put(0,-0.5\paperheight){\line(1,0){\paperwidth}}%
- \put(0.5\paperwidth,0){\line(0,-1){\paperheight}}%
- \put(0.5\paperwidth,-0.5\paperheight){\circle{10}}%
- \normalcolor
}
-\newcommand\xwm@insert@textmark@a{%
- \leavevmode\removelastskip\noindent%
- \makebox(0,0){\rotatebox[origin=c]{\xwm@angle}{\scalebox{\xwm@scale}{%
- \parbox[c][\xwm@height][c]{\xwm@width}{%
- \color{\xwm@color}%
- \fontfamily{\xwm@fontfamily}\fontseries{\xwm@fontseries}%
- \fontsize{\xwm@fontsize}{1.2\xwm@fontsize}\selectfont
- \xwm@align\xwm@textmark
- }}}}%
- \removelastskip\normalcolor
-}
-\newcommand\xwm@insert@picmark@a{%
- \xwm@align
- \makebox(0,0){\rotatebox{\xwm@angle}{\xwm@insertpic}}%
-}
-\newcommand\xwm@insert@textmark@b{%
- \put(\xwm@xcoord@a,\xwm@ycoord@a){\xwm@insert@textmark@a}%
-}
-\newcommand\xwm@insert@picmark@b{%
- \put(\xwm@xcoord@a,\xwm@ycoord@a){\xwm@insert@picmark@a}%
-}
-\newcommand\xwm@insert@mark@a{%
- \xwm@coords
- \ifxwm@bool@tmark\xwm@insert@textmark@b\fi
- \ifxwm@bool@pmark\xwm@insert@picmark@b\fi
- \ifxwm@bool@showcenter\xwm@papercenter\fi
-}%
-\newcommand\xwm@insertmark{%
- \ifnum\xwm@minmark=\@ne
- \ifxwm@allpages
- \xwm@insert@mark@a
- \else\ifxwm@firstpage
- \ifnum\c@page=\@ne\xwm@insert@mark@a\fi
- \else\ifxwm@oddpages
- \ifodd\c@page\xwm@insert@mark@a\fi
- \else\ifxwm@evenpages
- \unless\ifodd\c@page\xwm@insert@mark@a\fi
- \else\ifxwm@bool@onepageonly
- \ifnum\c@page=\number\xwm@page\xwm@insert@mark@a\fi
- \else\ifxwm@bool@prange
- \ifthenelse{\(\c@page=\xwm@pagestart\OR\c@page=\xwm@pageend\)
- \OR\(\c@page>\xwm@pagestart\AND\c@page<\xwm@pageend\)}{%
- \xwm@insert@mark@a}{}%
- \else\ifxwm@printwatermark
- \ifnum\c@page=\@ne
- \xwm@bool@tmarktrue\xwm@bool@pmarkfalse
- \xwm@dimdef{\xwm@xcoord@a}{0.5\paperwidth}%
- \xwm@dimdef{\xwm@ycoord@a}{-0.5\paperheight}%
- \xwm@insert@mark@a
- \xwm@info{Draftmark printed on page 1 only:\MessageBreak
- You've specified no pages for watermark}%
- \fi
- \fi\fi\fi\fi\fi\fi\fi
+\robust@def*\xwm@defcommonkeys#1{%
+ \begingroup
+ \endlinechar\m@one
+ \expandafter\endgroup\xwm@defc@mmonkeys{#1}%
+}
+\robust@def*\xwm@defc@mmonkeys#1#2{%
+ \csn@def{#1@commonkeys}##1{#2}%
+ \AtEndOfPackage{\letcsntocs{#1@commonkeys}\relax}%
+}
+\xwm@defcommonkeys{xwm-1}{%
+ minmark=true;
+ onepageonly=true;
+ prange=true;
+ tmark=true;
+ pmark=true;
+ graphicsoptions={}/
+ \ifbracedTF{##1}{%
+ \aftercsname{\stripallbr{##1}}{#1graphicsoptions}
+ }{
+ \cpt@err{Values of key 'graphicsoptions' not braced}\@ehc
+ };
+ GraphicsOptions=/
+ \ifdocstartedTF{%
+ \xwm@err{\noexpand\GraphicsOptions
+ is a command, not a key.\MsgBrk
+ Maybe you meant 'graphicsoptions'}\@ehc
+ }{};
+ picontoptext=true;
+ picture-on-top-text=true/\setmnkey{picontoptext};
+ pic-on-top-text=true/\setmnkey{picontoptext};
+ textontoppic=true/\setmnkey{picontoptext}[false];
+ text-on-top-picture=true/\setmnkey{picontoptext}[false];
+ text-on-top-pic=true/\setmnkey{picontoptext}[false];
+ draftboxcolor=blue;
+ draft-box-color=blue/\setmnkey{draftboxcolor};
+ textcolor=gray!25;
+ text-color=gray!25/\setmnkey{textcolor};
+ color=gray!25/\setmnkey{textcolor};
+ textangle=0;
+ text-angle=0/\setmnkey{textangle};
+ angle=0/\setmnkey{textangle};
+ textscale=1;
+ text-scale=1/\setmnkey{textscale};
+ scale=1/\setmnkey{textscale};
+ textalign=center/\aftercsname\xwm@settextalign{#1textalign};
+ text-align=center/\setmnkey{textalign};
+ align=center/\setmnkey{textalign};
+ showpagecenter=true/\ifboolTF{#1showpagecenter}{%
+ \usename{#1showpagecentertrue}}{\usename{#1showpagecenterfalse}};
+ show-page-center=true/\setmnkey{showpagecenter};
+ showpapercenter=true/\setmnkey{showpagecenter};
+ fontsize=1cm/\aftercsname{\xwm@defaultunits{##1}}{#1fontsize};
+ font-size=1cm/\setmnkey{fontsize};
+ fontseries=b;
+ font-series=b/\setmnkey{fontseries};
+ fontfamily=bch;
+ font-family=bch/\setmnkey{fontfamily};
+ \needvalue{picfile}=/\aftercsname\stripallbrincs{#1picfile}
+ \ifcsnnullTF{#1picfile}{\usename{#1pmarkfalse}}{\usename{#1pmarktrue}
+ \usename{#1minmarktrue}};
+ \needvalue{picture-file}=/\setmnkey{picfile};
+ picfileext=\xwm@defaultfileext/\xwm@fileextfn{##1}{#1};
+ pic-file-ext=\xwm@defaultfileext/\setmnkey{picfileext};
+ picangle=0;
+ picture-angle=0/\setmnkey{picangle};
+ picscale=1;
+ picture-scale=1/\setmnkey{picscale};
+ picbb=0 0 100 100;
+ picture-bb=0 0 100 100/\setmnkey{picbb};
+ pic-bounding-box=0 0 100 100/\setmnkey{picbb};
+ picxpos=\z@pt;
+ picture-xpos=0/\setmnkey{picxpos};
+ picture-x-position=0/\setmnkey{picxpos};
+ picypos=\z@pt;
+ picture-ypos=0/\setmnkey{picypos};
+ picture-y-position=0/\setmnkey{picypos};
+ mark=DRAFT/\setmnkey{textmark};
+ textmark=DRAFT/
+ \aftercsname\stripallbrincs{#1textmark}
+ \ifcsnnullTF{#1textmark}{%
+ \usename{#1tmarkfalse}
+ }{
+ \usename{#1tmarktrue}
+ }
+ \letcstocsn\currentmark{#1textmark};
+ text-mark=DRAFT/\setmnkey{textmark};
+ firstpage=true/\if@boolFT{#1firstpage}{}{\usename{#1minmarktrue}};
+ first-page=true/\setmnkey{firstpage};
+ allpages=true/\if@boolFT{#1allpages}{}{\usename{#1minmarktrue}};
+ oddpages=true/\if@boolFT{#1oddpages}{}{\usename{#1minmarktrue}};
+ evenpages=true/\if@boolFT{#1evenpages}{}{\usename{#1minmarktrue}};
+ page=1/
+ \ifinsetTF{-}{##1}{%
+ \xwm@err{I found '-' in '##1' for key 'page',
+ \MsgBrk but 'page' doesn't take page-range}\@ehc
+ }{
+ \ifnum\numexpr##1=\z@pt\else\usename{#1onepageonlytrue}
+ \usename{#1minmarktrue}\fi
+ };
+ pages=1-1/
+ \aftercsname\stripallbrincs{#1pages}
+ \aftercsname\cptstrcmp{#1pages}{0-0}{}{%
+ \usename{#1prangetrue}\usename{#1minmarktrue}
+ }
+ \cptexpandsecond\xwm@hyphenpagerange{\cptmakecs{#1pages}
+ \cptmakecs{#1pagestart}\cptmakecs{#1pageend}};
+ pagex={1}/
+ \ifbracedTF{##1}{}{%
+ \xwm@err{Value of key 'pagex' must be braced}\@ehc
+ };
+ boxalign=/\ifblankTF{##1}{}
+ {\aftercsname\xwm@setboxalign{#1boxalign}};
+ box-align=/\setmnkey{boxalign};
+}
+\robust@def*\xwm@adddefkeys{%
+ \begingroup
+ \endlinechar\m@one
+ \cpt@testopt\xwm@addd@fkeys{}%
+}
+\robust@def\xwm@addd@fkeys[#1]#2#3#4#5{%
+ \def\xwm@tempa{\endgroup#4}%
+ \expandafter\expandafter\expandafter\xwm@tempa
+ \expandafter\expandafter\expandafter
+ {\csname#2@commonkeys\endcsname{#3}#1#5}%
+}
+\xwm@adddefkeys[;]{xwm-1}{wmk@}
+ {\ltxkeys@definekeys*[XWM]<watermark>[wmk@]}{%
+ textwidth=\paperheight;
+ text-width=\paperheight/\setmnkey{textwidth};
+ width=\paperheight/\setmnkey{textwidth};
+ textheight=\paperwidth;
+ text-height=\paperwidth/\setmnkey{textheight};
+ height=\paperwidth/\setmnkey{textheight};
+ \needvalue{picheight}=;
+ pic-height=/\setmnkey{picheight};
+ picture-height=/\setmnkey{picheight};
+ \needvalue{picwidth}=;
+ picture-width=/\setmnkey{picwidth};
+ textxpos=0;
+ text-xpos=0/\setmnkey{textxpos};
+ text-x-position=0/\setmnkey{textxpos};
+ xpos=0/\setmnkey{textxpos};
+ textypos=0;
+ text-ypos=0/\setmnkey{textypos};
+ text-y-position=0/\setmnkey{textypos};
+ ypos=0/\setmnkey{textypos};
+ coordunit=mm/\xwm@checkcoordunit{#1};
+ coord-unit=mm/\setmnkey{coordunit};
+ position-unit=mm/\setmnkey{coordunit};
+}
+\makeoption@keys*[XWM]{watermark}
+\xwm@adddefkeys[;]{xwm-1}{wlp@}
+ {\ltxkeys@definekeys*[XWM]<wallpaper>[wlp@]}{%
+ textheight=\wlp@tileysize;
+ text-height=\wlp@tileysize/\setmnkey{textheight};
+ textwidth=\wlp@tilexsize;
+ text-width=\wlp@tilexsize/\setmnkey{textwidth};
+ picheight=\wlp@tileysize;
+ picture-height=\wlp@tileysize/\setmnkey{picheight};
+ picwidth=\wlp@tilexsize;
+ picture-width=\wlp@tilexsize/\setmnkey{picwidth};
+ tilexsize=.25\paperwidth;
+ tile-xsize=.25/\setmnkey{tilexsize};
+ tileysize=.25\paperheight;
+ tile-ysize=.25/\setmnkey{tileysize};
+ wpxoffset=\z@pt;
+ wallpaper-xoffset=\z@pt/\setmnkey{wpxoffset};
+ wpyoffset=\z@pt;
+ wallpaper-yoffset=\z@pt/\setmnkey{wpyoffset};
+ tilexoffset=\z@pt;
+ tile-xoffset=\z@pt/\setmnkey{tilexoffset};
+ tileyoffset=\z@pt;
+ tile-yoffset=\z@pt/\setmnkey{tileyoffset};
+ tileno=4;
+ tilenumber=4/\setmnkey{tileno};
+ tile-number=4/\setmnkey{tileno};
+ number-of-tiles=4/\setmnkey{tileno};
+ squaretiles=true;
+ square-tiles=true/\setmnkey{squaretiles};
+}
+\makeoption@keys*[XWM]{wallpaper}
+\ltxkeys@definekeys*[XWM]<fancypagenos>[pgn@]{%
+ textalign=center/\xwm@settextalign\pgn@textalign;
+ text-align=center/\setmnkey{textalign};
+ align=center/\setmnkey{textalign};
+ boxalign=/\ifblankTF{#1}{}{\xwm@setboxalign\pgn@boxalign};
+ box-align=center/\setmnkey{boxalign};
+ textangle=0;
+ text-angle=0/\setmnkey{textangle};
+ angle=0/\setmnkey{textangle};
+ picangle=0;
+ picture-angle=0/\setmnkey{picangle};
+ textwidth=.25\textwidth;
+ text-width=.25/\setmnkey{textwidth};
+ width=.25\hsize/\setmnkey{textwidth};
+ textheight=.25\textheight;
+ text-height=.25/\setmnkey{textheight};
+ height=.25\vsize/\setmnkey{textheight};
+ textxpos=\z@pt;
+ x-position=0/\setmnkey{textxpos};
+ xpos=\z@pt/\setmnkey{textxpos};
+ textypos=\z@pt;
+ y-position=0/\setmnkey{textypos};
+ ypos=\z@pt/\setmnkey{textypos};
+ textcolor=blue;
+ text-color=blue/\setmnkey{textcolor};
+ color=blue/\setmnkey{textcolor};
+ textscale=2.5;
+ text-scale=2.5/\setmnkey{textscale};
+ scale=2.5/\setmnkey{textscale};
+ coordunit=mm/\xwm@checkcoordunit{#1};
+ coord-unit=mm/\setmnkey{coordunit};
+ position-unit=mm/\setmnkey{coordunit};
+ fontfamily=bch;
+ font-family=bch/\setmnkey{fontfamily};
+ fontseries=m;
+ font-series=m/\setmnkey{fontseries};
+ format=\fbox;
+ fontsize=12\p@/\xwm@defaultunits{#1}\pgn@fontsize;
+ font-size=12/\setmnkey{fontsize};
+ cfoot;
+ center-footer=/\setmnkey{cfoot};
+ footer-center=/\setmnkey{cfoot};
+ rfoot;
+ right-footer=/\setmnkey{rfoot};
+ footer-right=/\setmnkey{rfoot};
+ lfoot;
+ left-footer=/\setmnkey{lfoot};
+ footer-left=/\setmnkey{lfoot};
+ chead;
+ center-header=/\setmnkey{chead};
+ header-center=/\setmnkey{chead};
+ rhead;
+ right-header=/\setmnkey{rhead};
+ header-right=/\setmnkey{rhead};
+ lhead;
+ left-header=/\setmnkey{lhead};
+ header-left=/\setmnkey{lhead};
+ headruleH=.4\p@;
+ headrule-height=.4\p@/\setmnkey{headruleH};
+ headruleD=.4\p@;
+ head-rule-depth=.4\p@/\setmnkey{headruleD};
+ headruleW=\headwidth;
+ headrule-width=\headwidth/\setmnkey{headruleW};
+ headruleS=2\p@;
+ head-rule-sep=2\p@/\setmnkey{headruleS};
+ head-rule-separation=2\p@/\setmnkey{headruleS};
+ headruleC=blue;
+ headrule-color=blue/\setmnkey{headruleC};
+ footruleH=.4\p@;
+ foot-rule-height=.4\p@/\setmnkey{footruleH};
+ footruleD=.4\p@;
+ footrule-depth=.4\p@/\setmnkey{footruleD};
+ footruleW=\headwidth;
+ footrule-width=\headwidth/\setmnkey{footruleW};
+ footruleS=2\p@;
+ footrule-sep=2\p@/\setmnkey{footruleS};
+ footrule-separation=2\p@/\setmnkey{footruleS};
+ footruleC=cyan;
+ footrule-color=blue/\setmnkey{footruleC};
+ hfoffsetL=.5;
+ hfoffset-left=.5/\setmnkey{hfoffsetL};
+ hfoffsetR=.5;
+ hfoffset-right=.5/\setmnkey{hfoffsetR};
+ style=\thepage;
+ printstyle=\thepage/\setmnkey{style};
+ print-style=\thepage/\setmnkey{style};
+ sendtoback=true;
+ send-to-back=true/\setmnkey{sendtoback};
+}
+\makeoption@keys*[XWM]{fancypagenos}
+\ltxkeys@definekeys*[XWM]<fancypagenos>[pgn@]{%
+ showpagenos=true/\ifpgn@showpagenos\global\pgn@showpagenostrue\fi;
+ show-page-numbers=true/\setmnkey{showpagenos};
+ show-pagenos=true/\setmnkey{showpagenos};
+ show-pageno=true/\setmnkey{showpagenos};
+ showonpageone=true;
+ show-on-page-1=true/\setmnkey{showonpageone};
+ show-on-page-one=true/\setmnkey{showonpageone};
+ showheadrule=true;
+ show-headrule=true/\setmnkey{showheadrule};
+ showfootrule=true;
+ show-footrule=true/\setmnkey{showfootrule};
+}
+\BeforeStartOfDocument{%
+ \ifpgn@showpagenos
+ \cptreplaceoneelement\XWM@fancypagenos@initial@keyvals
+ {showpagenos=false}{showpagenos=true}%
\fi
}
-\ifxwm@printwatermark
- \AtBeginShipout{\AtBeginShipoutUpperLeft{\xwm@insertmark}}%
- \xwm@info{Option 'printwatermark=true': watermark printed}%
-\fi
-\krsetup{keyfamily=minipage,macroprefix=mp@}%
-\define@keylist{2,width,\paperwidth,;2,textcolor,black,;
- 2,framecolor,white,;2,framesep,3pt,;2,framerule,0.4pt,;
- 2,text,No text passed.,}%
-\define@key[XWM]{minipage}{align}[center]{%
+\robust@def*\PrintWatermark{\global\xwm@printwatermarktrue}
+\ltxkeys@declareoption*{%
+ \ltxkeys@getpvalnopad
+ \xwm@warn{Unknown option '\CurrentKey' with
+ value '\InnocentVal' ignored}%
+}
+\ltxkeys@executeoptions[XWM]<main>{%
+ printwatermark=true,disablegeometry=false
+}\relax
+\ltxkeys@processoptions*[XWM]<main,watermark,wallpaper,%
+ fancypagenos>\relax
+\new@def*\xwm@samplemarkkeys{%
+ firstpage,lastpage,allpages,oddpages,evenpages,
+ picscale,picture-scale,
+ picfile,picture-file,
+ picfileext,pic-file-ext,
+ picangle,picture-angle,
+ picbb,picture-bb,pic-bounding-box,
+ picxpos,picture-xpos,picture-x-position,
+ picypos,picture-ypos,picture-y-position,
+ showpagecenter,show-page-center,
+ picontoptext,picture-on-top-text,pic-on-top-text,
+ textontoppic,text-on-top-picture,text-on-top-pic=true,
+ pic-height,picture-height,
+ picwidth,picture-width,
+ squaretiles,square-tiles,
+ tilexsize,tile-xsize,
+ tileysize,tile-ysize,
+ wpxoffset,wallpaper-xoffset,
+ wpyoffset,wallpaper-yoffset,
+ tilexoffset,tile-xoffset,
+ tileyoffset,tile-yoffset,
+ tileno,tilenumber,tile-number,number-of-tiles
+}
+\new@def*\xwm@pagespecifiers{%
+ page=,pages=,pagex=,firstpage,lastpage,allpages,%
+ oddpages,evenpages%
+}
+\robust@def*\xwm@decidedetok#1{%
+ \ifsingletokenTF{#1}{%
+ \ifmacroTF{#1}{%
+ \let\xwm@detok\cptoxdetok
+ }{%
+ \let\xwm@detok\detokenize
+ }%
+ }{%
+ \let\xwm@detok\detokenize
+ }%
+}
+\robust@def*\xwm@decidexp#1{%
+ \ifsingletokenTF{#1}{%
+ \ifmacroTF{#1}{%
+ \let\xwm@xp\expandcsonce
+ }{%
+ \let\xwm@xp\unexpanded
+ }%
+ }{%
+ \let\xwm@xp\unexpanded
+ }%
+}
+\robust@def*\newwatermark#1{%
+ \xwm@wallfalse
+ \ifstrcmpTF{#1}\dummywatermark{%
+ \xwm@err{'\string\dummywatermark' in front of
+ \string\newwatermark}{First comment out or
+ remove '\string\dummywatermark'.}%
+ }{%
+ \def\xwm@forelist{\xwm@forewmklist}%
+ \def\xwm@backlist{\xwm@backwmklist}%
+ \xwm@suffixcheck\xwm@newwatermark{#1}%
+ }%
+}
+\robust@def*\xnewwatermark{%
+ \cpt@teststpm{\cpt@testopt\cpt@xnewwatermark{}}%
+}
+\robust@def*\xwm@ltxcmds{%
+ \centering,\flushright,\flushleft,\raggedright,%
+ \raggedleft,\fbox,\framebox,\makebox,\rotatebox,%
+ \scalebox,\raisebox,\color,\textcolor,\usecsn,%
+ \newcommand,\lastdocpage
+}
+\robust@def*\xwm@relaxltxcmds{%
+ \def\ltxkeys@do##1{\let##1=\relax}%
+ \ltxkeys@csvparse*\xwm@ltxcmds
+}
+\robust@def*\cpt@xnewwatermark[#1]#2{%
+ \begingroup
+ \xwm@relaxltxcmds
+ \cptexpanded{%
+ \endgroup
+ \newwatermark\ifcpt@st*\fi\ifcpt@pm'\fi
+ [\expandcstwice{#1}]{\expandcstwice{#2}}%
+ }%
+}
+\robust@def*\newwallpaper#1{%
+ \xwm@walltrue
+ \ifstrcmpTF{#1}\dummywallpaper{%
+ \xwm@err
+ {'\string\dummywallpaper' in front of \string\newwallpaper}%
+ {First comment out or remove '\string\dummywallpaper'.}%
+ }{%
+ \def\xwm@forelist{\xwm@forewalllist}%
+ \def\xwm@backlist{\xwm@backwalllist}%
+ \xwm@suffixcheck\xwm@newwatermark{#1}%
+ }%
+}
+\robust@def*\xnewwallpaper{%
+ \cpt@teststpm{\cpt@testopt\cpt@xnewwallpaper{}}%
+}
+\robust@def*\cpt@xnewwallpaper[#1]#2{%
\begingroup
- \edef\x{\endgroup\noexpand\XKV@cc*+[\noexpand\val\noexpand\nr]{#1}%
- {center,right,left,justified}{}{}}%
- \x
- \ifcase\nr\relax
- \def\mp@align{\centering}%
- \or
- \def\mp@align{\flushright}%
- \or
- \def\mp@align{\flushleft}%
- \or
- \let\mp@align\relax
+ \xwm@relaxltxcmds
+ \cptexpanded{%
+ \endgroup
+ \newwallpaper\ifcpt@st*\fi\ifcpt@pm'\fi
+ [\expandcstwice{#1}]{\expandcstwice{#2}}%
+ }%
+}
+\robust@def*\xwm@newwatermark{%
+ \def\siso@do##1{\catcode`##1\string=12}%
+ \cpt@teststpm{%
+ \let\ifxwm@foregrd\ifcpt@st
+ \cpt@testopt{%
+ \begingroup
+ \expandafter\siso@@loop\expandafter
+ {\xwm@watermarkparser,;|-=!'"*}%
+ \expandafter\endgroup\xwm@n@wwatermark
+ }{}%
+ }%
+}
+\robust@def\xwm@n@wwatermark[#1]#2{%
+ \if@boolTF{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}}%
+ \cpt@sttrue\cpt@kvnormalize[,]\xwm@currattrib
+ \xwm@decidexp{#2}%
+ \edef\xwm@currmark{\xwm@xp{#2}}%
+ \xwm@decidedetok{#2}%
+ \xwm@swafalse
+ \xifinsetTF{\detokenize{\newwatermark}}{\xwm@detok{#2}}{%
+ \xwm@swatrue
+ }{%
+ \xifinsetTF{\detokenize{\newwallpaper}}{\xwm@detok{#2}}{%
+ \xwm@swatrue
+ }{}%
+ }%
+ \ifxwm@swa
+ \ifxwm@allownesting\else
+ \xwm@err{Nested '\string\newwatermark' or
+ '\string\newwallpaper'\MsgBrk
+ while option 'allownesting' is false}\@ehc
+ \fi
+ \fi
+ \if@boolTF{xwm@wall}{}{%
+ \xwmifitemsinFT[1]{%
+ squaretiles,square-tiles,tilexsize,tile-xsize,%
+ tileysize,tile-ysize,wpxoffset,wallpaper-xoffset,%
+ wpyoffset,wallpaper-yoffset,tilexoffset,tile-xoffset,%
+ tileyoffset,tile-yoffset,tileno,tilenumber,%
+ tile-number,number-of-tiles%
+ }{#1}{}{%
+ \xwm@@err{'\xwm@items' not admissible for
+ \MsgBrk non-wallpaper watermarks}\@ehc
+ }%
+ }%
+ \if@boolTF{xwm@allownesting}{}{%
+ \cpt@choicefdfalse
+ \def\csv@do##1{%
+ \xifinsetFT{,\detokenize{##1}}{,\xwm@detok{#2}}{}{%
+ \def\xwm@tempa{##1}%
+ \cpt@choicefdtrue\loopbreak
+ }%
+ }%
+ \csv@@parse*[,]\xwm@samplemarkkeys
+ \ifcpt@choicefd
+ \xwm@err{Illegal location of '\xwm@tempa'.
+ \MsgBrk The following keys are not allowed in
+ \MsgBrk mandatory/second argument of
+ \MsgBrk '\string\newwatermark' or '\string\newwallpaper':
+ ^^J||\xwm@samplemarkkeys||}\@ehc
+ \fi
+ }%
+ \xifinsetFT\xwm@watermarkparser{\xwm@detok{#2}}{}{%
+ \xwm@err{Watermark parser '\xwm@watermarkparser' appears in
+ the following watermark.\MsgBrk Enclose your token
+ '\xwm@watermarkparser' in braces:^^J||\unexpanded{#2}||}\@ehc
+ }%
+ \x@xwmifitemsinTF[1]\xwm@pagespecifiers{\expandcsonce\xwm@currattrib}{%
+ \x@xwmifitemsinTF[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
+ }%
+ \ifcsnullTF\xwm@currattrib{%
+ \ifcsnullTF\xwm@currmark{}{%
+ \xwm@@err{No attributes for watermark:
+ ^^J||\expandcsonce\xwm@currmark||}\@ehc
+ }%
+ }{%
+ \xwm@makecurrmark
+ }%
+ \edef\reserved@a{%
+ \ifxwm@foregrd\expandcsonce\xwm@forelist\else
+ \expandcsonce\xwm@backlist\fi
+ }%
+ \expandafter\edef\reserved@a{%
+ \expandafter\ifdefTF\reserved@a{\expandcstwice\reserved@a}{}%
+ \expandcsonce\currentmark
+ }%
+ \undefcs\xwm@xp\undefcs\xwm@detok
+}
+\robust@def*\xwm@twopagespecerr{%
+ \ifxwm@swa
+ \xwm@err{Two page specifiers in watermark attributes:
+ ^^J||\cptoxdetok{\xwm@currattrib}||}\@ehc
\else
- \xwm@err{Inadmissible value '\string#1' for minipage's align}%
+ \xwm@swatrue
\fi
-}%
-\presetkeys[XWM]{minipage}{align,width,textcolor,text,framesep,
- framerule,framecolor}{}%
-\long\def\xwminipage#1{%
- \setkeys[XWM]{minipage}{#1}%
- \begingroup%
- \fboxsep=\mp@framesep\fboxrule=\mp@framerule%
- \removelastskip
- \color{\mp@framecolor}%
- \noindent
- \begin{boxedminipage}{\mp@width}%
- \mp@align\textcolor{\mp@textcolor}{\mp@text}%
- \end{boxedminipage}%
- \removelastskip
- \endgroup
-}%
-\krsetup{keyfamily=colorbox,macroprefix=cb@}
-\CKVS{align}{center,right,left,justified}
-\define@keylist{2,width,\textwidth,;2,textcolor,black,;
- 2,fillcolor,yellow!55,;2,framecolor,white,;
- 2,text,No text passed.,;2,framesep,3\p@,;2,framerule,0.4\p@,;
- 4,align,center,\protected@edef\cb@align{\val}}
-\presetkeys[XWM]{colorbox}{align=center,width,fillcolor,textcolor,text,
- framesep,framerule,framecolor}{}
-\newcommand\xwcolorbox[1]{%
- \setkeys[XWM]{colorbox}{#1}%
- \color{\cb@framecolor}%
- \removelastskip\noindent%
- \colorbox{\cb@fillcolor}{%
- \xwminipage{framesep=\cb@framesep,framerule=\cb@framerule,
- framecolor=\cb@framecolor,align=\cb@align,width=\cb@width,
- text=\cb@text,textcolor=\cb@textcolor
- }%
- }%
- \removelastskip\normalcolor%
-}%
-\newcommand\ywcolorbox[1]{%
- \setkeys[XWM]{colorbox}{#1}%
- \color{\cb@framecolor}%
- \begin{center}%
- \makebox[\z@][c]{%
- \colorbox{\cb@fillcolor}{%
- \xwminipage{framesep=\cb@framesep,framerule=\cb@framerule,
- framecolor=\cb@framecolor,align=\cb@align,width=\cb@width,
- text=\cb@text,textcolor=\cb@textcolor
+}
+\robust@def*\xwm@addcurrmark#1{%
+ \begingroup
+ \xifinsetTF{,\detokenize{textmark}}{,\cptoxdetok\xwm@currattrib}{%
+ \@tempswafalse
+ \ifxTF\xwm@currmark\@empty{}{%
+ \xwm@err{Duplicate nonempty 'textmark'}\@ehc
+ }%
+ }{%
+ \@tempswatrue
+ }%
+ \edef\xwm@tempb{%
+ page=\number#1,\expandcsonce\xwm@currattrib,%
+ \if@tempswa textmark={\expandcsonce\xwm@currmark}\fi
+ }%
+ \ifcsemptyTF\xwm@tempb{}{\xwm@normdoublecomma\xwm@tempb}%
+ \edef\currentmark{%
+ \expandcsonce\currentmark{\number#1}{\expandcsonce\xwm@tempb}%
+ }%
+ \postgroupdef\currentmark\endgroup
+}
+\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
+ }{}%
+ }{%
+ \ifstrcmpTF{#1}{pagex}{%
+ \ifinsetTF{-}{##2}{%
+ \xwm@err{Key 'pagex' doesn't accept hyphen-separated
+ \MsgBrk page numbers: use commas}\@ehc
+ }{}%
+ }{}%
+ }%
+ \def\xwm@currpage{##2}%
+ }%
+ \edef\xwm@currattrib{\unexpanded{##1,##3}}%
+ }%
+ \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}%
+ \if@boolTF{cpt@in}\@iden\@gobble
+}
+\robust@def*\xwm@normdoublecomma#1{%
+ \def\xwm@tempa##1,,##2\xwm@@nil{%
+ \ifblankTF{##2}
+ {\edef#1{\unexpanded{##1}}}
+ {\xwm@tempa##1,##2\xwm@@nil}%
+ }%
+ \expandafter\xwm@tempa#1,,\xwm@@nil
+}
+\robust@def*\xwm@makecurrmark{%
+ \edef\xwm@rsvda{\lastdocpage}%
+ \def\currentmark{}%
+ \xwm@swafalse
+ \xwm@ifpagespec{page=}{%
+ \xwm@twopagespecerr
+ \xwm@getpagespec{page}%
+ \xwm@addcurrmark\xwm@currpage
+ }%
+ \xwm@ifpagespec{pages=}{%
+ \xwm@twopagespecerr
+ \xwm@getpagespec{pages}%
+ \xwm@hyphenpagerange\xwm@currpage\xwm@pagestart\xwm@pageend
+ \xwm@cnta\numexpr\xwm@pagestart\relax
+ \cptloop
+ \xwm@addcurrmark\xwm@cnta
+ \advance\xwm@cnta by1
+ \ifnum\xwm@cnta<\numexpr\xwm@pageend+1\relax
+ \repeat
+ }%
+ \xwm@ifpagespec{pagex=}{%
+ \xwm@twopagespecerr
+ \xwm@getpagespec{pagex}%
+ \def\ltxkeys@do##1{\xwm@addcurrmark{##1}}%
+ \ltxkeys@csvparse*\xwm@currpage
+ }%
+ \xwm@ifpagespec{firstpage}{%
+ \xwm@twopagespecerr
+ \xwm@getpagespec{firstpage}%
+ \xwm@addcurrmark{1}%
+ }%
+ \xwm@ifpagespec{lastpage}{%
+ \xwm@twopagespecerr
+ \xwm@getpagespec{lastpage}%
+ \xwm@addcurrmark\xwm@rsvda
+ }%
+ \xwm@ifpagespec{evenpages}{%
+ \xwm@twopagespecerr
+ \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
+ \repeat
+ }%
+ \xwm@ifpagespec{oddpages}{%
+ \xwm@twopagespecerr
+ \xwm@getpagespec{oddpages}%
+ \xwm@cnta\z@
+ \cptloop
+ \ifodd\xwm@cnta
+ \xwm@addcurrmark\xwm@cnta
+ \fi
+ \advance\xwm@cnta by1
+ \ifnum\xwm@cnta<\numexpr\xwm@rsvda+1\relax
+ \repeat
+ }%
+ \ifxwm@swa\else
+ \xwm@err{No page specifier in watermark attributes:
+ ^^J||\cptoxdetok\xwm@currattrib||}\@ehc
+ \fi
+}
+\robust@def*\dummywatermark#1{%
+ \ifstrcmpTF{#1}\newwatermark{%
+ \xwm@err
+ {'\string\newwatermark' in front of \string\dummywatermark}%
+ {First comment out or remove '\string\newwatermark'.}%
+ }{%
+ \if@boolTF{xwm@usedummymarks}\newwatermark\xwm@dummywatermark
+ #1%
+ }%
+}
+\robust@def*\dummywallpaper#1{%
+ \ifstrcmpTF{#1}\newwallpaper{%
+ \xwm@err
+ {'\string\newwallpaper' in front of \string\dummywallpaper}%
+ {First comment out or remove '\string\newwallpaper'.}%
+ }{%
+ \if@boolTF{xwm@usedummymarks}\newwallpaper\xwm@dummywatermark
+ #1%
+ }%
+}
+\robust@def*\xwm@dummywatermark{%
+ \cpt@teststpm{\cpt@testopt\xwm@d@mmywatermark{}}%
+}
+\robust@def*\xwm@d@mmywatermark[#1]#2{}
+\robust@def*\UseDummyWatermarks{\global\xwm@usedummymarkstrue}
+\robust@def*\DiscardDummyWatermarks{\global\xwm@usedummymarksfalse}
+\DiscardDummyWatermarks
+\robust@def*\DiscardAllWatermarks{%
+ \global\let\newwatermark\dummywatermark
+ \global\xwm@usedummymarksfalse
+}
+\robust@def*\xwm@putbothmarks{%
+ \ifdefFT\xwm@watermarklist{}\xwm@textpicmark@a
+ \ifdefFT\xwm@wallpaperlist{}\xwm@wallpaper@a
+}
+\chardef\xwm@nowatermark\z@pt
+\AtBeginShipout{%
+ \endlinechar13\catcode13=5
+ \catcode`\ =10
+ \catcode`\\\z@pt
+ \catcode`\{\@ne
+ \catcode`\}\tw@
+ \if@boolTF{xwm@printwatermark}{%
+ \let\xwm@watermarklist\xwm@backwmklist
+ \let\xwm@wallpaperlist\xwm@backwalllist
+ \AtBeginShipoutUpperLeft{%
+ \xwm@foregrdfalse
+ \xwm@putbothmarks
+ }%
+ \let\xwm@watermarklist\xwm@forewmklist
+ \let\xwm@wallpaperlist\xwm@forewalllist
+ \AtBeginShipoutUpperLeftForeground{%
+ \xwm@foregrdtrue
+ \xwm@putbothmarks
+ }%
+ }{%
+ \ifnum\xwm@nowatermark<\@ne
+ \pushnumber\xwm@nowatermark
+ \xwm@info{'printwatermark=false': no watermark printed}%
+ \fi
+ }%
+}
+\robust@def*\xwm@perpagestate{%
+ page=0,
+ pagex={0},
+ pages=0-0,
+ minmark=false,
+ onepageonly=false,
+ prange=false,
+ tmark=false,
+ pmark=false,
+ firstpage=false,
+ allpages=false,
+ oddpages=false,
+ evenpages=false,
+ showpagecenter=false,
+ textmark=DRAFT,
+ textalign=center,
+ boxalign=,
+ textcolor=gray!55,
+ fontfamily=bch,
+ textangle=0,
+ picangle=0,
+ fontsize=1cm,
+ fontseries=b,
+ textscale=1,
+ picscale=1,
+ picheight=,
+ picwidth=,
+ picbb=0 0 100 100,
+ picfileext,
+ picontoptext=false,
+ graphicsoptions={},
+}
+\robust@edef*\xwm@perpagewmkstate{%
+ \expandcsonce\xwm@perpagestate,
+ \unexpanded{%
+ height=\paperwidth,
+ width=\paperheight,
+ textxpos=0,
+ textypos=0,
+ picxpos=\z@pt,
+ picypos=\z@pt,
+ coordunit=mm
+ }%
+}
+\robust@edef*\xwm@perpagewallstate{%
+ \expandcsonce\xwm@perpagestate,
+ \unexpanded{%
+ tilexsize=.5\paperwidth,
+ tileysize=.5\paperheight,
+ wpxoffset=\z@pt,
+ wpyoffset=\z@pt,
+ textmark=,
+ picfile=,
+ tilexoffset=\z@pt,
+ tileyoffset=\z@pt,
+ tileno=4,
+ squaretiles=false
+ }%
+}
+\robust@def*\xwm@textpicmark@a{%
+ \ifcsnullTF\xwm@watermarklist{%
+ \if@boolTF{xwm@foregrd}{}{%
+ \if@boolFT{xwm@printwatermark}{}{%
+ \if@boolTF{xwm@draft}{%
+ \if@boolTF{wmk@showpagecenter}{}{%
+ \ifnumcmpFT\c@page=\@ne{}{%
+ \cptexpandargonce{\ltxkeys@setkeys[XWM]{watermark}}%
+ \xwm@perpagewmkstate
+ \wmk@tmarktrue\wmk@pmarkfalse
+ \cptdimdef\wmk@textxpos@a{0.5\paperwidth}%
+ \cptdimdef\wmk@textypos@a{-0.5\paperheight}%
+ \xwm@textpicmark@c
+ \xwm@info{'printwatermark' and 'draft' are 'true'
+ \MsgBrk but no watermark(s): watermark
+ \MsgBrk printed on page 1 only}%
+ }%
+ }%
+ }{%
+ \ifnum\c@page=\@ne
+ \xwm@info{'printwatermark=true' and 'draft=false'
+ \MsgBrk but no watermark(s)}%
+ \fi
+ }%
+ }%
+ }%
+ }{%
+ \xwm@processmarks\xwm@watermarklist{%
+ \xwm@setwatermarkkeys{watermark}{wmk}{##2}%
+ \if@boolFT{wmk@minmark}{}\xwm@textpicmark@c
+ }%
+ }%
+}
+\robust@def*\xwm@wallpaper@a{%
+ \ifcsnullTF\xwm@wallpaperlist{}{%
+ \xwm@processmarks\xwm@wallpaperlist{%
+ \xwm@setwatermarkkeys{wallpaper}{wall}{##2}%
+ \if@boolFT{wlp@minmark}{}\xwm@wallpaper@c
+ }%
+ }%
+}
+\robust@def*\xwm@setwatermarkkeys#1#2#3{%
+ \ltxkeys@getkeynames{#3}%
+ \cptexpandsecond{%
+ \ltxkeys@setkeys[XWM]{#1}%
+ }{%
+ [\ltxkeys@keynames]{\expandcsnonce{xwm@perpage#2state}}%
+ }%
+ \edef\currentmark{\unexpanded{#3}}%
+ \ifblankTF{#3}{}{\ltxkeys@setkeys[XWM]{#1}{#3}}%
+}
+\robust@def*\xwm@processmarks#1#2{%
+ \def\xwm@pr@cessmarks##1##2{%
+ \ifstrcmpTF{##1}{.}{}{%
+ \ifnumcmpTF##1=\c@page{#2}{%
+ \edef#1{\expandcsonce#1\unexpanded{{##1}{##2}}}%
}%
+ \xwm@pr@cessmarks
}%
}%
- \end{center}%
- \removelastskip\normalcolor
-}%
-\new\def\xwm@insertpic{\begingroup
- \protected@edef\@tempa{\endgroup%
- \iftoggle{pdf}{%
- \noexpand\IfFileExists{\xwm@picfile.\xwm@picfilex}{%
- \noexpand\includegraphics[viewport=\xwm@picbb,scale=\xwm@picscale]%
- {\xwm@picfile.\xwm@picfilex}%
- }{\xwm@err{No file \xwm@picfile.\xwm@picfilex\space or wrong path}}%
+ \cptexpandsecondonce{\def#1{}\xwm@pr@cessmarks}{#1}{.}{}%
+}
+\ltxkeys@disablekeys*[XWM]{main}{printwatermark,disablegeometry}
+\BeforeStartOfDocument{%
+ \unless\ifxwm@printwatermark
+ \xwm@info{*** printwatermark=false: no watermark printed}%
+ \fi
+}
+\newcommand\xwm@papercenter{%
+ \color{red}\noindent
+ \xwm@put(0,-0.5\paperheight){\line(1,0){\paperwidth}}%
+ \xwm@put(0.5\paperwidth,0){\line(0,-1){\paperheight}}%
+ \xwm@put(0.5\paperwidth,-0.5\paperheight){\circle{10}}%
+ \normalcolor
+}
+\robust@def*\xwm@textbox#1{%
+ \begingroup
+ \let\nxp\noexpand
+ \let\mcs\cptmakecs
+ \edef\xwm@curralign{\expandcsnonce{#1@textalign}}%
+ \cptexpanded{\endgroup
+ \xwm@put(\mcs{#1@textxpos@a},\mcs{#1@textypos@a}){%
+ \quitvmode\nxp\@killglue\noindent
+ \cptexpandsecond{\nxp\makebox(0,0)}{[\mcs{#1@boxalign}]}{%
+ \nxp\rotatebox[origin=c]{\mcs{#1@textangle}}{%
+ \nxp\scalebox{\mcs{#1@textscale}}{%
+ \nxp\parbox[c][\mcs{#1@textheight}]%
+ [c]\mcs{#1@textwidth}{%
+ \nxp\color{\mcs{#1@textcolor}}%
+ % First convert \fontsize to scaled points:
+ \cptdimdef\mcs{#1@fontsize@a}{\mcs{#1@fontsize}}%
+ \cptdimdef\mcs{#1@fontsize@a}%
+ {1.5\p@*\mcs{#1@fontsize@a}}%
+ \nxp\fontfamily\mcs{#1@fontfamily}%
+ \nxp\fontseries\mcs{#1@fontseries}%
+ \nxp\fontsize\mcs{#1@fontsize}\mcs{#1@fontsize@a}%
+ \nxp\selectfont
+ \noexpand\begin{\xwm@curralign}%
+ \mcs{#1@textmark}%
+ \noexpand\end{\xwm@curralign}%
+ }%
+ }%
+ }%
+ }%
+ }%
+ }%
+ \@killglue\normalcolor
+}
+\robust@def*\xwm@getpicsize#1{%
+ \ifcsnnullTF{#1@picwidth}{%
+ \ifcsnnullTF{#1@picheight}{%
+ \edef\pic@size{scale=\cptmakecs{#1@picscale}}%
}{%
- \noexpand\IfFileExists{\xwm@picfile.\xwm@picfilex}{%
- \noexpand\includegraphics[bb=\xwm@picbb,scale=\xwm@picscale]%
- {\xwm@picfile.\xwm@picfilex}%
- }{\xwm@err{No file \xwm@picfile.\xwm@picfilex\space or wrong path}}%
- }%
- }\@tempa%
-}%
-\newrobustcmd\xwm@dis@ble@keys[1]{%
- \XKV@checksanitizeb{#1}\xwm@tempa
- \XKV@for@o\xwm@tempa\xwm@tempa{%
- \XKV@ifundefined{\XKV@header\xwm@tempa}{%
- \xwm@warn{Key '\xwm@tempa' undefined: can't be disabled}%
+ \xwm@err{You have supplied picture height
+ but not width}\@ehc
+ }%
+ }{%
+ \ifcsnnullTF{#1@picheight}{%
+ \xwm@err{You have supplied picture width
+ but not height}\@ehc
}{%
- \edef\xwm@tempb{%
- \noexpand\xwm@err{Key '\xwm@tempa' has been disabled.\MessageBreak
- You can't set or reset it at this late stage.\MessageBreak
- You should have set it earlier in the\MessageBreak
- \string\documentclass\space or \string\usepackage}%
+ \edef\pic@size{width=\cptmakecs{#1@picwidth},%
+ height=\cptmakecs{#1@picheight}}%
+ }%
+ }%
+}
+\newcommand*\xwm@picmark{%
+ \xwm@findpicfile\wmk@picfile\wmk@picfileext
+ \xwm@getpicsize{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}}%
+ }%
+ \xwm@makedraftbox
+ \xwm@put(\wmk@picxpos@a,\wmk@picypos@a){%
+ \rotatebox[origin=c]\wmk@picangle{%
+ \cptexpandsecond{\makebox(0,0)}{[\wmk@boxalign]{%
+ \if@boolTF{xwm@draft}
+ {\xwm@draftbox{wmk}}{\copy\xwm@boxa}%
+ }%
+ }%
+ }}%
+}
+\robust@def*\xwm@makedraftbox{%
+ \fboxsep\p@\fboxrule.4\p@
+ \cptdimdef\xwm@tempa{(\ht\xwm@boxa+\dp\xwm@boxa
+ -2\fboxsep-2\fboxrule)/2}%
+ \cptdimdef\xwm@tempb{\wd\xwm@boxa-2\fboxsep-2\fboxrule}%
+ \setbox\@tempboxa\hbox{\color@begingroup
+ \ttfamily\color{red}\Large (draft mode)\color@endgroup}%
+ \setbox\xwm@boxb=\hb@xt@\xwm@tempb{%
+ \xwmstrut\xwm@tempa\z@pt
+ \hb@xt@\xwm@tempb{\hss\unhbox\@tempboxa\hss}%
+ \xwmstrut\z@pt\xwm@tempa
+ }%
+}
+\robust@def*\xwm@draftbox#1{%
+ \begingroup
+ \color{\usename{#1@draftboxcolor}}\fbox{\copy\xwm@boxb}%
+ \endgroup
+}
+\newcommand*\xwm@textpicmark@c{%
+ \xwm@getposition\wmk@textxpos\wmk@textypos\wmk@coordunit
+ \xwm@getposition\wmk@picxpos\wmk@picypos\wmk@coordunit
+ \if@boolTF{wmk@picontoptext}{%
+ \if@boolFT{wmk@tmark}{}{\xwm@textbox{wmk}}%
+ \if@boolFT{wmk@pmark}{}\xwm@picmark
+ }{%
+ \if@boolFT{wmk@pmark}{}\xwm@picmark
+ \if@boolFT{wmk@tmark}{}{\xwm@textbox{wmk}}%
+ }%
+ \if@boolFT{wmk@showpagecenter}{}\xwm@papercenter
+}
+\AtBeginDocument{%
+ \ifdefTF\Ginput@path{%
+ \xdef\xwm@inputpath{\Ginput@path\xwm@inputpath}%
+ \ifxTF\Ginput@path\input@path{}{%
+ \ifdefFT\input@path{}{%
+ \xdef\xwm@inputpath{\input@path\xwm@inputpath}%
}%
- \XKV@ifundefined{\XKV@header\xwm@tempa @default}{%
- \edef\xwm@tempc{\noexpand\XKV@define@key{\xwm@tempa}}%
+ }%
+ }{%
+ \ifdefFT\input@path{}{%
+ \xdef\xwm@inputpath{\input@path\xwm@inputpath}%
+ }%
+ }%
+}
+\new@def*\xwm@inputpath{}
+\robust@def*\watermarkpaths{%
+ \cpt@testst{\cpt@testopt\xwm@w@termarkpaths{}}%
+}
+\robust@def*\xwm@w@termarkpaths[#1]{%
+ \cpt@testpnopt{\xwm@w@term@rkpaths#1}{}
+}
+\robust@def*\xwm@w@term@rkpaths#1(#2)#3{%
+ \cpt@useemptytrue
+ \def\xwm@tempa{#3}%
+ \if@boolTF{cpt@st}{%
+ \ifbracedTF{#3}{\stripallbr{#3}\xwm@tempa}{}%
+ \def\csv@do##1{%
+ \ifbracedTF{##1}{%
+ \stripallbr{##1}\xwm@tempa
+ }{%
+ \def\xwm@tempa{##1}%
+ }%
+ \cptexpandarg{\grightaddtocs\xwm@inputpath}{{#1\xwm@tempa#2}}%
+ }%
+ \csv@@parse*[,]\xwm@tempa
+ }{%
+ \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
+ }%
+ \def\tsv@do##1{%
+ \ifbracedTF{##1}{%
+ \cptexpandarg{\grightaddtocs\xwm@inputpath}{{#1\@iden##1#2}}%
}{%
- \edef\xwm@tempc{\noexpand\XKV@define@key{\xwm@tempa}[]}%
+ \xwm@err{Input path '##1' needs outer braces}\@ehc
}%
- \expandafter\xwm@tempc\expandafter{\xwm@tempb}%
}%
+ \tsv@@parse*\xwm@tempa
}%
-}%
-\newrobustcmd\xwm@disable@keys{\XKV@testoptb\xwm@dis@ble@keys}%
+}
+\newletcs\watermarkpath=\watermarkpaths
+\new@def*\xwmifeofTF#1{\ifcondTF\ifeof#1\fi}
+\robust@def*\pdfiffileexistsTF#1{%
+ \cptifcondFT\if\pdffilesize{#1}\relax\fi
+}
+\robust@def*\xwmiffileexistsTF#1{%
+ \openin\@inputcheck#1\@space
+ \xwmifeofTF\@inputcheck{%
+ \ifcsnullTF\xwm@inputpath{%
+ \@secondoftwo
+ }{%
+ \xwm@iffileonpath{#1}%
+ }%
+ }{%
+ \closein\@inputcheck
+ \edef\xwm@filefound{#1}%
+ \@firstoftwo
+ }%
+}
+\robust@def*\xwmiffileexistsFT#1{%
+ \xwmiffileexistsTF{#1}\@secondoftwo\@firstoftwo
+}
+\robust@def*\xwm@iffileonpath#1{%
+ \let\xwm@pathfound\@empty
+ \cpt@choicefdfalse
+ \def\tsv@do##1{%
+ \stripallbr{##1}\xwm@tempa
+ \openin\@inputcheck\xwm@tempa#1\@space
+ \xwmifeofTF\@inputcheck{}{%
+ \let\xwm@pathfound\xwm@tempa
+ \edef\xwm@filefound{\xwm@tempa#1}%
+ \closein\@inputcheck
+ \cpt@choicefdtrue\loopbreak
+ }%
+ }%
+ \tsv@@loop*\xwm@inputpath
+ \if@boolTF{cpt@choicefd}\@firstoftwo\@secondoftwo
+}
+\robust@def*\xwm@nofileerr#1#2{%
+ \message{%
+ ^^J! Package xwatermark Error: File '#1.#2' not found.
+ ^^J^^JType x to quit, or <RETURN> to proceed,
+ ^^Jor enter new name (default extension: #2):^^J
+ }%
+ \begingroup
+ \endlinechar-1\global\read-1 to\@gtempa
+ \endgroup
+ \ifcsnullTF\@gtempa{}{%
+ \oifstrcmpTF\@gtempa{x}{%
+ \stop
+ }{%
+ \oifstrcmpTF\@gtempa{X}{%
+ \stop
+ }{%
+ \filename@parse\@gtempa
+ \edef#1{\filename@area\filename@base}%
+ \edef#2{\ifxTF\filename@ext\relax{#2}{\filename@ext}}%
+ \xwm@findpicfile{#1}{#2}%
+ }%
+ }%
+ }%
+}
+\robust@def*\xwm@findpicfile#1#2{%
+ \let\xwm@filefound\@empty
+ \edef\xwm@filegiven{#1.#2}%
+ \if@boolTF{xwm@pdf}{%
+ \xwm@f@ndpicfile{#1}{#2}{pdf,png,jpeg,mps}%
+ }{%
+ \xwm@f@ndpicfile{#1}{#2}{eps,ps}%
+ }%
+ \ifcsnullFT\xwm@filefound{}{\xwm@nofileerr{#1}{#2}}%
+}
+\robust@def*\xwm@f@ndpicfile#1#2#3{%
+ \xwm@swafalse
+ \xwmiffileexistsTF{#1.#2}{%
+ \xwm@swbtrue
+ }{%
+ \xwm@swbfalse
+ \def\csv@do##1{%
+ \xwmiffileexistsFT{#1.##1}{}{%
+ \xwm@swatrue\loopbreak
+ }%
+ }%
+ \csv@@loop[,]{#3}%
+ }%
+ \if@boolTF{xwm@swb}{}{%
+ \if@boolTF{xwm@swa}{%
+ \xwm@warn{File '\xwm@filegiven' doesn't exist
+ \MsgBrk on given path(s) '\xwm@inputpath',
+ \MsgBrk but I have found \xwm@filefound'}%
+ }{%
+ \let\xwm@filefound\@empty
+ \let\xwm@pathfound\@empty
+ }%
+ }%
+}
+\robust@def*\xwm@wallpaper@c{%
+ \if@boolTF{wlp@picontoptext}{%
+ \xwm@textwallpaper
+ \xwm@picwallpaper
+ }{%
+ \xwm@picwallpaper
+ \xwm@textwallpaper
+ }%
+ \if@boolFT{wlp@showpagecenter}{}\xwm@papercenter
+}
+\robust@def*\xwm@textwallpaper{%
+ \if@boolFT{wlp@tmark}{}{%
+ \if@boolTF{wlp@squaretiles}\xwm@sqtexttiles\xwm@texttiles
+ }%
+}
+\robust@def*\xwm@picwallpaper{%
+ \if@boolFT{wlp@pmark}{}{%
+ \if@boolTF{wlp@squaretiles}%
+ \xwm@sqpictiles\xwm@pictiles
+ }%
+}
+\robust@def*\xwm@dotiling{\xwm@makedraftbox\xwm@dotiling@a}
+\robust@def*\xwm@dotiling@a{%
+ \let\tiley\wlp@wpyoffset
+ \cptwhiledim\tiley<\paperheight-\wlp@wpyoffset\do{%
+ \cptdimdef\xwm@tempa{-\paperheight+\tiley}%
+ \let\tilex\wlp@wpxoffset
+ \cptwhiledim\tilex<\paperwidth-\wlp@wpxoffset\do{%
+ \leavevmode\@killglue
+ \xwm@put(\tilex,\xwm@tempa){\rotatebox[origin=c]
+ \xwm@currangle{%
+ \cptexpandsecond{\makebox(0,0)}{[\wlp@boxalign]}{%
+ \if@boolTF{xwm@draft}
+ {\xwm@draftbox{wlp}}{\copy\xwm@boxa}%
+ }%
+ }}%
+ \cptdimadd\tilex{\wlp@tilexsize+\wlp@tilexoffset}%
+ }%
+ \cptdimadd\tiley{\wlp@tileysize+\wlp@tileyoffset}%
+ }%
+}
+\robust@def*\xwm@toofewtiles#1{%
+ \ifnum\numexpr#1<4\relax
+ \xwm@err{Too few square wallpapers '#1';
+ \MsgBrk minimum expected: 4}\@ehc
+ \fi
+}
+\robust@def*\xwm@texttiles{%
+ \setbox\xwm@boxa=\hbox{%
+ \resizebox\wlp@tilexsize\wlp@tileysize
+ {\color{\wlp@textcolor}\wlp@textmark}%
+ }%
+ \let\xwm@currangle\wlp@textangle
+ \xwm@dotiling
+}
+\robust@def*\xwm@sqtexttiles{%
+ \xwm@toofewtiles\wlp@tileno
+ \cptdimdef\wlp@tilexsize{\paperwidth/\wlp@tileno}%
+ \let\wlp@tileysize\wlp@tilexsize
+ \setbox\xwm@boxa=\hbox{%
+ \resizebox\wlp@tilexsize\wlp@tileysize
+ {\color{\wlp@textcolor}\wlp@textmark}%
+ }%
+ \let\xwm@currangle\wlp@textangle
+ \xwm@dotiling
+}
+\robust@def*\xwm@tilepicbox{%
+ \xwm@findpicfile\wlp@picfile\wlp@picfileext
+ \setbox\xwm@boxa=\hbox{%
+ \cptexpandsecond\includegraphics{%
+ [\ifxwm@pdf viewport\else bb\fi=\wlp@picbb,
+ width=\the\dimexpr\wlp@tilexsize,height=
+ \the\dimexpr\wlp@tileysize,clip,
+ \wlp@graphicsoptions,\xwm@gr@phicsoptions]%
+ }{\xwm@filefound}%
+ }%
+}
+\robust@def*\xwm@pictiles{%
+ \xwm@tilepicbox
+ \let\xwm@currangle\wlp@picangle
+ \xwm@dotiling
+}
+\robust@def*\xwm@sqpictiles{%
+ \xwm@toofewtiles\wlp@tileno
+ \cptdimdef\wlp@tilexsize{\paperwidth/\wlp@tileno}%
+ \let\wlp@tileysize\wlp@tilexsize
+ \xwm@tilepicbox
+ \let\xwm@currangle\wlp@picangle
+ \xwm@dotiling
+}
+\robust@def*\xwmstrut#1#2{%
+ \relax\unskip
+ \ifhmode\nobreak\fi
+ \begingroup
+ \setbox\@tempboxa=\hbox{\vrule\@height#1\@depth#2\@width\z@pt}%
+ \ifmmode\copy\@tempboxa\else\unhcopy\@tempboxa\fi
+ \endgroup
+}
+\ltxkeys@definekeys*[XWM]<boxedminipage>[xwmbmp@]{%
+ width=\paperwidth;
+ textcolor=black;
+ framecolor=black;
+ framesep=3\p@;
+ framerule=0.4\p@;
+ height=\z@pt;
+ depth=\z@pt;
+ width=\paperwidth;
+ textalign=center/\xwm@settextalign\xwmbmp@textalign;
+ text-align=center/\setmnkey{textalign};
+}
+\robust@def*\xwmboxedminipage{\cpt@testopt\xwm@boxedminipage{}}
+\begingroup
+\catcode`\|=\catcode`\%
+\robust@gdef\xwm@boxedminipage[#1]#2{%
+ \ltxkeys@launchkeys[XWM]{boxedminipage}{#1}%
+ \stripallbrincs\xwmbmp@width
+ \stripallbrincs\xwmbmp@textcolor
+ \leavevmode\@pboxswfalse
+ \begingroup
+ \color{\xwmbmp@framecolor}%
+ \xifstrcmpTF\xwmbmp@innerpos{b}\vbox{%
+ \xifstrcmpTF\xwmbmp@innerpos{t}\vtop{%
+ \if@boolTF{mmode}\vcenter{%
+ \@pboxswtrue $\vcenter |$
+ }%
+ }%
+ }%
+ \bgroup
+ \hsize\xwmbmp@width
+ \hrule\@height\xwmbmp@framerule
+ \hbox\bgroup
+ \vrule\@width\xwmbmp@framerule\hskip\xwmbmp@framesep
+ \vbox\bgroup
+ \vskip\xwmbmp@framesep
+ \cptdimdef\xwm@dima{\hsize-2\xwmbmp@framerule-2\xwmbmp@framesep}%
+ \hsize\xwm@dima
+ \textwidth\xwm@dima\columnwidth\xwm@dima
+ \@parboxrestore
+ \c@mpfootnote\z@pt
+ \let\@footnotetext\@mpfootnotetext
+ \let\@listdepth\@mplistdepth\@mplistdepth\z@pt
+ \@minipagerestore\@minipagetrue
+ \everypar{\global\@minipagefalse\everypar{}}%
+ \leavevmode\@killglue
+ \xwmstrut\xwmbmp@height\z@pt
+ \noindent\xwmbmp@textcolor
+ \begin\xwmbmp@textalign
+}
+\robust@def\endxwmboxedminipage{%
+ \end\xwmbmp@textalign
+ \xwmstrut\z@pt\xwmbmp@depth
+ \ifvoid\@mpfootins\else
+ \vskip\skip\@mpfootins\footnoterule\unvbox\@mpfootins
+ \fi
+ \vskip\xwmbmp@framesep
+ \egroup
+ \hskip\xwmbmp@framesep\vrule\@width\xwmbmp@framerule
+ \egroup
+ \hrule\@height\xwmbmp@framerule
+ \egroup
+ \if@pboxsw\m@th$\fi |$
+ \leavevmode\@killglue\@ignoretrue
+ \endgroup
+}
+\endgroup
+
+\ltxkeys@definekeys*[XWM]<minipage>[xwmmp@]{%
+ width=\paperwidth;
+ textcolor=black;
+ framecolor=black;
+ framesep=3\p@;
+ framerule=0.4\p@;
+ height=\z@pt;
+ depth=\z@pt;
+ width=\hsize;
+ textalign=center/\xwm@settextalign\xwmmp@textalign;
+ text-align=center/\setmnkey{textalign};
+ framebox=true;
+ insertframe=true/\setmnkey{framebox};
+ insert-frame=true/\setmnkey{framebox};
+}
+\robust@def*\xwmminipage{\cpt@testopt\xwm@minipage{}}
+\robust@def\xwm@minipage[#1]#2{%
+ \ltxkeys@launchkeys[XWM]{minipage}{#1}%
+ \stripallbrincs\xwmmp@width
+ \stripallbrincs\xwmmp@textcolor
+ \edef\sav@fboxsep{\the\fboxsep}%
+ \edef\sav@fboxrule{\the\fboxrule}%
+ \fboxsep\xwmmp@framesep\fboxrule\xwmmp@framerule
+ \cptdimdef\xwmmp@boxwidth{\xwmmp@width-2\fboxsep-2\fboxrule}%
+ \def\xwm@printbox{%
+ \color{\xwmmp@framecolor}%
+ \ifxwmmp@framebox\fbox{\fi
+ \usebox\xwm@boxa
+ \ifxwmmp@framebox}\fi
+ }%
+ \@killglue\noindent
+ \begin{lrbox}\xwm@boxa
+ \@killglue\noindent
+ \begin{minipage}[c][\height][s]\xwmmp@boxwidth
+ \@killglue\noindent
+ \xwmstrut\xwmmp@height\z@pt
+ \begin\xwmmp@textalign
+ \textcolor{\xwmmp@textcolor}{#2}\relax
+ \end\xwmmp@textalign
+ \xwmstrut\z@pt\xwmmp@depth
+ \end{minipage}%
+ \@ignoretrue\@killglue
+ \end{lrbox}%
+ \@ignoretrue\@killglue\noindent
+ \xwm@printbox
+ \fboxsep\sav@fboxsep\fboxrule\sav@fboxrule
+ \normalcolor\@ignoretrue
+}
+\ltxkeys@definekeys*[XWM]<colorbox>[xwmcbx@]{%
+ width=\textwidth;
+ height=\z@pt;
+ depth=\z@pt;
+ framebox=true;
+ insertframe=true/\setmnkey{framebox};
+ insert-frame=true/\setmnkey{framebox};
+ textcolor=black;
+ fillcolor=white;
+ outerframecolor=black;
+ outer-frame-color=black/\setmnkey{outerframecolor};
+ innerframecolor=black;
+ inner-frame-color=black/\setmnkey{innerframecolor};
+ framesep=3\p@;
+ framerule=0.4\p@;
+ textalign=center/\xwm@settextalign\xwmcbx@textalign;
+ align=center/\setmnkey{textalign};
+ text-align=center/\setmnkey{textalign};
+}
+\robust@def*\xwmcolorbox{\cpt@testopt\xwm@colorbox{}}
+\robust@def\xwm@colorbox[#1]#2{%
+ \ltxkeys@launchkeys[XWM]{colorbox}{#1}%
+ \fboxsep\xwmcbx@framesep\fboxrule\xwmcbx@framerule
+ \removelastskip\noindent
+ \fcolorbox{\xwmcbx@outerframecolor}{\xwmcbx@fillcolor}{%
+ \cptexpandsecond\xwmminipage{[textalign=\xwmcbx@textalign,
+ framesep=\xwmcbx@framesep,framerule=\xwmcbx@framerule,
+ framecolor=\xwmcbx@innerframecolor,width=\xwmcbx@width,
+ height=\xwmcbx@height,depth=\xwmcbx@depth,
+ textcolor=\xwmcbx@textcolor,framebox=true]}{#2}%
+ }%
+ \removelastskip
+ \normalcolor
+}
+\ltxkeys@definekeys*[XWM]<makecolorbox>[xwmmbx@]{%
+ width=\textwidth;
+ height=\z@pt;
+ depth=\z@pt;
+ framebox=true;
+ textcolor=black;
+ fillcolor=white;
+ outerframecolor=black;
+ outer-frame-color=black/\setmnkey{outerframecolor};
+ innerframecolor=black;
+ inner-frame-color=black/\setmnkey{innerframecolor};
+ framesep=3\p@;
+ framerule=0.4\p@;
+ textalign=center/\xwm@settextalign\xwmmbx@textalign;
+ align=center/\setmnkey{textalign};
+ text-align=center/\setmnkey{textalign};
+ boxalign=center/\xwm@settextalign\xwmmbx@boxalign;
+}
+
+\robust@def*\makecolorbox{\cpt@testopt\xwm@makecolorbox{}}
+\robust@def*\xwm@makecolorbox[#1]#2{%
+ \ltxkeys@launchkeys[XWM]{makecolorbox}{#1}%
+ \begin{\xwmmbx@boxalign}%
+ \makebox[\z@pt][c]{%
+ \xwmstrut\xwmmbx@height\z@pt
+ \fboxsep\xwmmbx@framesep\fboxrule\xwmmbx@framerule
+ \fcolorbox{\xwmmbx@outerframecolor}{\xwmmbx@fillcolor}{%
+ \cptexpandsecond\xwmminipage{[textalign=\xwmmbx@textalign,
+ framesep=\xwmmbx@framesep,framerule=\xwmmbx@framerule,
+ framecolor=\xwmmbx@innerframecolor,width=\xwmmbx@width,
+ height=\xwmmbx@height,depth=\xwmmbx@depth,
+ textcolor=\xwmmbx@textcolor,framebox=
+ \thebool@normal{xwmmbx@framebox}]}{#2}%
+ }%
+ \xwmstrut\z@pt\xwmmbx@depth
+ }%
+ \end{\xwmmbx@boxalign}%
+ \removelastskip
+ \normalcolor
+}
+\ltxkeys@definekeys*[XWM]<shade>[xwmshd@]{%
+ width=\hsize;
+ leftadjust=\z@pt;
+ indent=\z@pt;
+ fillcolor=gray!75;
+ framecolor=black;
+ framesep=3\p@;
+ framerule=0.4\p@;
+ height=\z@pt;
+ depth=\z@pt;
+ textalign=justified/\xwm@settextalign\xwmshd@textalign;
+ textcolor=black
+}
+\robust@def*\xwm@frameshade{%
+ \def\FrameCommand{%
+ \clubpenalty\@m\widowpenalty\@m
+ \noindent\kern\xwmshd@leftadjust
+ \fboxrule\xwmshd@framerule\fboxsep\xwmshd@framesep
+ \fcolorbox{\xwmshd@framecolor}{\xwmshd@fillcolor}%
+ }%
+ \parindent\z@pt\finalhyphendemerits\z@pt
+ \cptdimdef\xwm@tempa{\xwmshd@width-(\xwmshd@framesep
+ +\xwmshd@framerule+\xwmshd@indent)}%
+ \color{\xwmshd@textcolor}%
+ \MakeFramed{%
+ \hsize\xwm@tempa\FrameRestore\@setminipage
+ }%
+ \xwmstrut\xwmshd@height\z@pt
+ \begin\xwmshd@textalign
+}
+\robust@def*\xwmshade{\cpt@testopt\xwm@shade{}}
+\robust@def*\xwm@shade[#1]{%
+ \ltxkeys@launchkeys[XWM]{shade}{#1}%
+ \xwm@frameshade
+}
+\robust@def*\endxwmshade{%
+ \end\xwmshd@textalign
+ \xwmstrut\z@pt\xwmshd@depth
+ \par\unskip\endMakeFramed\@ignoretrue
+}
+\ltxkeys@definekeys*[XWM]<fadingtext>[fad@]{%
+ textcolor=white;
+ boxcolor=black;
+ scale=1;
+ letterwidth=5mm;
+ barcolor=yellow;
+ height=\z@pt;
+ depth=\z@pt
+}
+\newcommand*\xwmfadingtext[2][]{%
+ \ltxkeys@launchkeys[XWM]{fadingtext}{#1}%
+ \begingroup
+ \@tempcnta\z@pt
+ \def\siso@do##1{%
+ \advance\@tempcnta\@ne
+ \csn@xdef{fade@\romannumeral\@tempcnta}{\cpttrimspace{##1}}%
+ }%
+ \siso@@loop{#2}%
+ \def\colbox##1{%
+ \color{.!80}%
+ \colorbox{.}{{%
+ \color{\fad@textcolor!\the\numexpr100-\@tempcnta/\icol*10\relax}%
+ \ifnum\icol=\@ne
+ \kern\dimexpr\fad@letterwidth/50\relax
+ \fi
+ \makebox[\fad@letterwidth]{##1}%
+ \ifnum\icol<\@tempcnta
+ \scalebox\fad@scale{\textcolor{\fad@barcolor}{$|$}}%
+ \else
+ \scalebox\fad@scale{\phantom{$|$}}%
+ \kern\dimexpr-\fad@letterwidth/10\relax
+ \fi
+ }}%
+ }%
+ \color{\fad@boxcolor}%
+ \chardef\icol\z@pt
+ \cptdotimes\@tempcnta{%
+ \pushnumber\icol
+ \colbox{\scalebox\fad@scale
+ {\xwmstrut\fad@height\fad@depth
+ \usename{fade@\romannumeral\icol}}}%
+ }%
+ \endgroup
+}
+\cptonlypreamble{%
+ \dummypagenos,\fancypagenos,
+ \FancyPageNumbers,\NoFancyPageNumbers
+}
+\newcommand*\dummypagenos[1][]{}
+\newcommand*\fancypagenos[1][]{%
+ \ifblankTF{#1}{}{\AtBeginDocument{\xwm@fancypagenos{#1}}}%
+}
+\robust@def*\NoFancyPageNumbers{%
+ \AfterStartOfDocument{\global\pgn@showpagenosfalse}%
+}
+\robust@def*\FancyPageNumbers{%
+ \AfterStartOfDocument{\global\pgn@showpagenostrue}%
+}
+\robust@def*\xwm@fancypagenos#1{%
+ \ltxkeys@launchkeys[XWM]{fancypagenos}{#1}%
+ \xwm@getposition\pgn@textxpos\pgn@textypos\pgn@coordunit
+ \ifnumcmpFT\c@page=\@ne{}{%
+ \AfterStartOfDocument{\thispagestyle{\xwm@frontpagestyle}}%
+ }%
+ \pagestyle{fancyplain}%
+ \fancyhf{}%
+ \cfoot{\pgn@cfoot}\rfoot{\pgn@rfoot}%
+ \lfoot{\pgn@lfoot}\chead{\pgn@chead}%
+ \rhead{\pgn@rhead}\lhead{\pgn@lhead}%
+ \ifpgn@showheadrule
+ \def\headrule{{%
+ \color{\pgn@headruleC}%
+ \hrule\@height\pgn@headruleH\@depth\pgn@headruleD
+ \@width\headwidth\vspace{\pgn@headruleS}%
+ \hrule\@height\pgn@headruleH\@depth\pgn@headruleD
+ \@width\headwidth\vspace{-\pgn@headruleS}%
+ }}%
+ \else
+ \let\headrule\relax
+ \fi
+ \ifpgn@showfootrule
+ \def\footrule{{%
+ \color{\pgn@footruleC}%
+ \hrule\@height\pgn@footruleH\@depth\pgn@footruleD
+ \@width\headwidth\vspace{\pgn@footruleS}%
+ \hrule\@height\pgn@footruleH\@depth\pgn@footruleD
+ \@width\headwidth\vspace{\pgn@footruleS}%
+ }}%
+ \else
+ \let\footrule\relax
+ \fi
+ \xwm@gethfoffset\pgn@hfoffsetL\pgn@hfoffsetR
+ \fancyhfoffset[R,L]\xwm@hfoffset
+ \AtBeginShipout{%
+ \if@boolTF{pgn@sendtoback}{%
+ \AtBeginShipoutUpperLeft{%
+ \xwm@f@ncyp@genos
+ }%
+ }{%
+ \AtBeginShipoutUpperLeftForeground{%
+ \xwm@f@ncyp@genos
+ }%
+ }%
+ }%
+}
+\robust@def*\xwm@f@ncypagenos{%
+ \def\pgn@textmark{\pgn@format{\normalfont\pgn@style}}%
+ \xwm@textbox{pgn}%
+}
+\robust@def*\xwm@f@ncyp@genos{%
+ \if@boolFT{pgn@showpagenos}{}{%
+ \ifnumcmpTF\c@page=\@ne{%
+ \ifpgn@showonpageone\xwm@f@ncypagenos\fi
+ }{%
+ \xwm@f@ncypagenos
+ }%
+ }%
+}
+\robust@def*\xwm@gethfoffset#1#2{%
+ \begingroup
+ \def\temp@err{%
+ \xwm@err{Only digits (without units) are allowed\MsgBrk
+ in the values of 'hfoffsetL' and 'hfoffsetR'}\@ehc
+ }%
+ \xifblankTF{#1}{}{%
+ \x@xwmifitemsinTF\xwm@allowedcoordunits{#1}\temp@err{}%
+ }%
+ \xifblankTF{#2}{}{%
+ \x@xwmifitemsinTF\xwm@allowedcoordunits{#2}\temp@err{}%
+ }%
+ \def\xwm@tempc##1##2{%
+ \xifblankTF{##1}{\def##2{1}}{\def##2{##1}}%
+ \ifdim##2\p@>\p@\def##2{1}\fi
+ }%
+ \xwm@tempc{#1}\xwm@tempa\xwm@tempc{#2}\xwm@tempb
+ \def\xwm@tempc##1{%
+ \xifinsetFT{.}{##1}{}{%
+ \def\xwm@tempd####1.####2\xwm@nil{\def##1{.####2}}%
+ \cptexpandsecond\xwm@tempd{##1}\xwm@nil
+ }%
+ }%
+ \xwm@tempc\xwm@tempa\xwm@tempc\xwm@tempb
+ \cptpassexpanded{%
+ \endgroup\def\noexpand\xwm@hfoffset{%
+ \the\dimexpr\xwm@tempa\marginparsep+%
+ \xwm@tempb\marginparwidth\relax
+ }%
+ }%
+}
+\robust@redef*\Gin@ii[#1]#2{%
+ \ifstrcmpTF{[}{#2}{%
+ \Gin@iii[#1][%
+ }{%
+ \begingroup
+ \@tempswafalse
+ \toks@{\Ginclude@graphics{#2}}%
+ \ltxkeys@setkeys{Gin}{#1}%
+ \Gin@esetsize
+ \the\toks@
+ \endgroup
+ }%
+}
+\robust@redef*\Grot@box@kv[#1]#2#3{%
+ \@begin@tempboxa\hbox{#3}%
+ \Grot@x\dimexpr\width/2\relax
+ \Grot@y\dimexpr(\height-\depth)/2\relax
+ \ltxkeys@setkeys{Grot}{#1}%
+ \setbox\z@pt\box\@tempboxa
+ \Grot@setangle{#2}%
+ \Grot@box
+ \@end@tempboxa
+}
\endinput
-%%% End of file xwatermark.sty %%% \ No newline at end of file
+%%% End of file xwatermark.sty %%%