From 8ef4b34298b082adaed9714c182beb730e8aafeb Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 13 Jan 2010 00:04:39 +0000 Subject: xwatermark update (12jan10) git-svn-id: svn://tug.org/texlive/trunk@16691 c570f23f-e606-0410-a88d-b1316a301751 --- .../latex/xwatermark/Graphics/xwatermarkpic.tex | 107 ++++ Master/texmf-dist/doc/latex/xwatermark/README | 13 +- .../xwatermark/xwatermark-bugreport-1dot4.tex | 30 ++ .../latex/xwatermark/xwatermark-examples-1dot3.pdf | Bin 182246 -> 0 bytes .../latex/xwatermark/xwatermark-examples-1dot3.tex | 180 ------- .../latex/xwatermark/xwatermark-examples-1dot4.pdf | Bin 0 -> 182125 bytes .../latex/xwatermark/xwatermark-examples-1dot4.tex | 181 +++++++ .../latex/xwatermark/xwatermark-guide-1dot3.pdf | Bin 262885 -> 0 bytes .../latex/xwatermark/xwatermark-guide-1dot3.tex | 553 --------------------- .../latex/xwatermark/xwatermark-guide-1dot4.cfg | 214 ++++++++ .../latex/xwatermark/xwatermark-guide-1dot4.pdf | Bin 0 -> 255156 bytes .../latex/xwatermark/xwatermark-guide-1dot4.tex | 547 ++++++++++++++++++++ .../doc/latex/xwatermark/xwatermark-guide.cfg | 211 -------- .../latex/xwatermark/xwatermark-manifest-1dot4.tex | 17 + .../texmf-dist/tex/latex/xwatermark/keyreader.sty | 113 ----- .../texmf-dist/tex/latex/xwatermark/xwatermark.sty | 247 ++++----- 16 files changed, 1227 insertions(+), 1186 deletions(-) create mode 100644 Master/texmf-dist/doc/latex/xwatermark/Graphics/xwatermarkpic.tex create mode 100644 Master/texmf-dist/doc/latex/xwatermark/xwatermark-bugreport-1dot4.tex delete mode 100644 Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples-1dot3.pdf delete mode 100644 Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples-1dot3.tex create mode 100644 Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples-1dot4.pdf create mode 100644 Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples-1dot4.tex delete mode 100644 Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide-1dot3.pdf delete mode 100644 Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide-1dot3.tex create mode 100644 Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide-1dot4.cfg create mode 100644 Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide-1dot4.pdf create mode 100644 Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide-1dot4.tex delete mode 100644 Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide.cfg create mode 100644 Master/texmf-dist/doc/latex/xwatermark/xwatermark-manifest-1dot4.tex delete mode 100644 Master/texmf-dist/tex/latex/xwatermark/keyreader.sty diff --git a/Master/texmf-dist/doc/latex/xwatermark/Graphics/xwatermarkpic.tex b/Master/texmf-dist/doc/latex/xwatermark/Graphics/xwatermarkpic.tex new file mode 100644 index 00000000000..c4b62a2cf8f --- /dev/null +++ b/Master/texmf-dist/doc/latex/xwatermark/Graphics/xwatermarkpic.tex @@ -0,0 +1,107 @@ +\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 f6a33bb5d7b..2c44eda0933 100644 --- a/Master/texmf-dist/doc/latex/xwatermark/README +++ b/Master/texmf-dist/doc/latex/xwatermark/README @@ -1,4 +1,4 @@ -This is the README file for 'xwatermark' package, version 1.3. +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 @@ -17,10 +17,11 @@ 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 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 in http://www.latex-project.org/lppl.txt and version 1.3 or later +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. The LPPL maintenance status of this software is 'author-maintained'. @@ -30,6 +31,6 @@ kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. -Copyright (c) 2009 Ahmed Musa (a.musa@rocketmail.com). +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/xwatermark-bugreport-1dot4.tex b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-bugreport-1dot4.tex new file mode 100644 index 00000000000..1689ccb25ef --- /dev/null +++ b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-bugreport-1dot4.tex @@ -0,0 +1,30 @@ +%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% +% 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-1dot3.pdf b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples-1dot3.pdf deleted file mode 100644 index 91fc2ef72ee..00000000000 Binary files a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples-1dot3.pdf and /dev/null differ diff --git a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples-1dot3.tex b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples-1dot3.tex deleted file mode 100644 index da27ab7eacf..00000000000 --- a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples-1dot3.tex +++ /dev/null @@ -1,180 +0,0 @@ -%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% -% This is file xwatermark-examples.tex, which demonstrates the use % -% of the xwatermark package, version 1.3. % -% % -% (c) Ahmed Musa 2009 % -%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% -\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{\TC{blue}{xwatermark}} - \xcopyright{Package}{red}\\[1ex] - \large Version 1.3\\[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]{\TC{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{\TC{orange!85}{@}} - \\[.25ex]\fboxsep=15pt\fboxrule=16pt\color{cyan} - \fbox{\TC{red!85}{Intel}\TC{orange!85}{BiZ}\TC{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. - One of the wonders of \TC{red}{\TeX}\bfseries{!} - }}}} -} - -\end{document} diff --git a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples-1dot4.pdf b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples-1dot4.pdf new file mode 100644 index 00000000000..92033fb5808 Binary files /dev/null and b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples-1dot4.pdf differ diff --git a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples-1dot4.tex b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples-1dot4.tex new file mode 100644 index 00000000000..669457b6437 --- /dev/null +++ b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-examples-1dot4.tex @@ -0,0 +1,181 @@ +%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% +% 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-guide-1dot3.pdf b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide-1dot3.pdf deleted file mode 100644 index 7ec85f8665c..00000000000 Binary files a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide-1dot3.pdf and /dev/null differ diff --git a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide-1dot3.tex b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide-1dot3.tex deleted file mode 100644 index 280fe75c114..00000000000 --- a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide-1dot3.tex +++ /dev/null @@ -1,553 +0,0 @@ -%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% -% This is file xwatermark-guide.tex, the documentation for the % -% xwatermark package, version 1.3. % -% % -% (c) Ahmed Musa 2009 (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 -} -\label{page:one} - -\title{\bfseries The \texttt{\TC{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.3 -} -\author{Ahmed Musa\\[1ex]University of Central Lancashire\\ - Preston PR1 2HE, United Kingdom\\[1ex] - \email{a.musa@rocketmail.com} -} -\xmaketitle[empty] - -\ywcolorbox{framesep=5pt,framerule=2pt,framecolor=red!55, - align=justified,fillcolor=gray!25,width=\hsize, - text=\xtempb -} - -\bgroup\small\tableofcontents\egroup - -\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 -} - -\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}~\cite{JVollmer2002}, \styb{draftwatermark}~\cite{SCallegari2006}, \styb{watermark}~\cite{ARozhenko2004}, and \styb{draftmark}~\cite{AMusa2009}. 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~\cite{HOberdiek2008}. - -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\}}. - -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(=true)} 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 \texorlatex 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 the parameters \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} -\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 (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} -\documentclass[a4paper,12pt,printwatermark]{article} - -\usepackage[evenpages]{xwatermark}. -\end{xwverbatim} - -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 \wmsetup macro 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} - -The option \stya{printwatermark} should not appear in \wmsetup but in the statement \usepackxwm or in the \dclass options list. - -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. - -\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 \texorlatex 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} - -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. - -\section{Other aspects of package architecture and use} - -\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} -\usepackage[printwatermark=false]{xwatermark}, -\end{xwverbatim} -and vice versa. - -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. - -\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}. - -\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}. - -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. - -\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. - -\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 \usepackxwm statement and in the \wmsetup macro. However, such values cannot be passed via the \dclass. The \styb{xkvltxp} patch package can be used to obviate this problem---as suggested in the \styb{xkeyval} package documentation. 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} - -To pass active characters and expandable commands as values of \stya{textmark} to the \stya{xwatermark} package, it is necessary to first load the \styb{xkvltxp} package as above, or as follows: - -\begin{xwverbatim} -\documentclass{class-type} -\usepackage{xkvltxp} -\usepackage[printwatermark,% - textmark=\textsc{Johnson's~Text}]{xwatermark} -\begin{document} -... -\end{document} -\end{xwverbatim} - -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} - -In fact, in this way even expandable commands can be passed to the package, as follows: - -\begin{xwverbatim} -\documentclass{class-type} -\usepackage[printwatermark]{xwatermark} -\newcommand*\temparg{Fran\c coise M\"uller's\endgraf Text} -\watermarksetup{allpages,textmark=\temparg} -\begin{document} -... -\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\{\string\x\}}, the packages \styb{doc} and \styb{shortvrb} make the character \styb{x} active. 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\{\string\x\}}, you can issue \cmdb{\DeleteShortVerb\{\string\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 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} - \TC{red}{\textbullet}\hspace{1cm}The marks % - on these pages were placed effortlessly % - by using the \TC{blue}{xwatermark} package - \hspace{1cm}\TC{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}\TC{red}{\textbullet} - \hspace{4.3cm}User manual for the % - \TC{blue}{xwatermark} package\hspace{4.3cm} - \TC{red}{\textbullet}\hspace{1cm} - \color{white}\framebox[2cm][c]{\phantom{Hello}} - \rotatebox[origin=c]{90}{% - \makebox[1.4cm][c]{\phantom{Hello}}} - } - } - } -} -\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 ... - } -} -\end{xwverbatim} -Notice here that the macro \cmda{\ywcolorbox} calls the macro \cmda{\xwcolorbox} with its (\cmda{\ywcolorbox}'s) \stya{framesep} and \stya{framerule}. - -Users may also like to consider the possible use of the \cmdb{\fcolorbox} macro of the \styb{xcolor} package in setting the textmarks. - -\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. - -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. - -The \styb{geometry} package saves native \texorlatex 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}. - -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~\cite{PLehman2008}. The native \nLaTeX hook \cmdb{\AtBeginDocument} is inapplicable in this case. - -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. - -\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} -\newfontfamily{\chinese}{STFangsong} % SinoType FangSong - -\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)}}=} -} - -\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). Unicode and UTF encodings and their recent \nTeX implementations are described in, \eg,~\cite{VEijkhout2008}. - -\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. - -The user should note the real meanings of saved-box commands (such as \cmdb{\newsavebox}, \cmdb{\savebox}, and \cmdb{\usebox}) before using them. The 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. - -\begingroup -\normalcolor -\bibfont -\bibliographystyle{abbrv} -\bibliography{xwatermark-guide} -\endgroup - -\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 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. Package users who have asked about other font series should please refer to~\cite[\S 7.9]{MittelbachGoossens2004}.\\\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} - -\end{document} diff --git a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide-1dot4.cfg b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide-1dot4.cfg new file mode 100644 index 00000000000..c1bab2cf13f --- /dev/null +++ b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide-1dot4.cfg @@ -0,0 +1,214 @@ +%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% +% 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)] +\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% +} +\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. +} +\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}}}% + }}% +} +\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}}% +} +\makeatother +\endinput + +%%% End of file xwatermark.cfg %%% \ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide-1dot4.pdf b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide-1dot4.pdf new file mode 100644 index 00000000000..38a07294461 Binary files /dev/null and b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide-1dot4.pdf differ diff --git a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide-1dot4.tex b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide-1dot4.tex new file mode 100644 index 00000000000..e665403dd1c --- /dev/null +++ b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide-1dot4.tex @@ -0,0 +1,547 @@ +%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% +% 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-1dot4.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 +} +\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 +} +\author{Ahmed Musa\\[1ex]University of Central Lancashire\\ + Preston PR1 2HE, United Kingdom\\[1ex] + \email{a.musa@rocketmail.com} +} +\xmaketitle[empty] + +\ywcolorbox{framesep=5pt,framerule=2pt,framecolor=red!55!brown, + align=justified,fillcolor=gray!25,width=\hsize, + text=\xtempb +} + +\bgroup\small\tableofcontents\egroup + +\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 +} + +\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} +\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 (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} +\documentclass[a4paper,12pt,printwatermark]{article} + +\usepackage[evenpages]{xwatermark}. +\end{xwverbatim} + +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} + +The option \stya{printwatermark} should not appear in \wmsetup but in the statement \usepackxwm or in the \dclass options list. + +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. + +\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} + +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. + +\section{Other aspects of package architecture and use} + +\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} +\usepackage[printwatermark=false]{xwatermark}, +\end{xwverbatim} +and vice versa. + +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. + +\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}. + +\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}. + +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. + +\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. + +\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} + +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: + +\begin{xwverbatim} +\documentclass{class-type} +\usepackage{xkvltxp} +\usepackage[printwatermark,% + textmark=\textsc{Johnson's~Text}]{xwatermark} +\begin{document} +... +\end{document} +\end{xwverbatim} + +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} + +In fact, in this way even expandable commands can be passed to the package, as follows: + +\begin{xwverbatim} +\documentclass{class-type} +\usepackage[printwatermark]{xwatermark} +\newcommand*\temparg{Fran\c coise M\"uller's\endgraf Text} +\watermarksetup{allpages,textmark=\temparg} +\begin{document} +... +\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}}}% + }% + }% + }% +} +\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 ... + }% +} +\end{xwverbatim} +Notice here that the macro \cmda{ywcolorbox} calls the macro \cmda{xwcolorbox} with its (\cmda{ywcolorbox}{}'s) \stya{framesep} and \stya{framerule}. + +Users may also like to consider the possible use of the \cmdb{fcolorbox} macro of the \styb{xcolor} package in setting the textmarks. + +\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. + +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. + +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}. + +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. + +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. + +\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} +\newfontfamily{\chinese}{STFangsong} % SinoType FangSong + +\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)}}=}% +} + +\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} + +\end{document} diff --git a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide.cfg b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide.cfg deleted file mode 100644 index 163a2627129..00000000000 --- a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-guide.cfg +++ /dev/null @@ -1,211 +0,0 @@ -%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% -% This is file xwatermark-guide.cfg, the configuration file for % -% the files xwatermark-guide.tex and xwatermark-examples.tex, % -% version 1.3. % -% % -% (c) Ahmed Musa 2009 (a.musa@rocketmail.com) % -%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% -\ProvidesFile{xwatermark-guide.cfg}% - [2009/10/20 v1.3 Configuration file for xwatermark-guide.tex] -\NeedsTeXFormat{LaTeX2e} -\usepackage{xkvltxp} -\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% -} -\makeatother -\new\let\TC\textcolor -\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{\TC{purple}{\today}\vadjust{\kern2ex\hrule}} -\renewcommand*\reftextcurrent{on this page} -\newcommand*\nTeX{\TeX\xspace} -\newcommand*\nLaTeX{\LaTeX\xspace} -\newcommand*\La{\leavevmode L\raise.42ex\hbox{\footnotesize\kern-.45em A}} -\newcommand*\texorlatex{\mbox{(\La\kern-.20em)\kern-.15em\TeX}\xspace} -\newcommand*\Xe{\leavevmode X\raise.45em\hbox{\rotatebox{180}{E}}\xspace} -\def\XeTeX{\mbox{\Xe\kern-.45em\TeX}\xspace} -\def\XeLaTeX{\mbox{\Xe\kern-.45em(\La\kern-.45em)\kern-.15em\TeX}\xspace} -\def\pdfTeX{pdf\TeX\xspace} -\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{e.g.\xspace} -\def\ie{i.e.\xspace} -\def\etc{etc.\xspace} -\newcommand*\email[1]{\href{mailto:#1}{#1}} -\newrobustcmd*\stya[1]{\TC{xgreen1}{\texttt{#1}}\xspace} -\newrobustcmd*\styb[1]{\TC{teal}{\texttt{#1}}\xspace} -\newrobustcmd*\cmda[1]{\escapechar=92\TC{xgreen1}{\ttfamily\string#1}\xspace} -\newrobustcmd*\cmdb[1]{\escapechar=92\TC{teal}{\texttt{\string#1}}\xspace} -\newrobustcmd*\usepackxwm{\cmda{\usepackage\{xwatermark\}}} -\newrobustcmd*\dclass{\cmdb{\documentclass}} -\newrobustcmd*\wmsetup{\cmda{\watermarksetup}} -\newrobustcmd*\xcopyright[2]{#1\TC{#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]{\marginparsep+\marginparwidth} -\lhead{\helv The \texttt{\TC{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}% - \TC{red}{\textbullet}\hspace{1cm}The marks on these pages were placed effortlessly - by using the \TC{blue}{xwatermark} package\hspace{1cm}% - \TC{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*{-1.2mm}% - \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}% - \TC{red}{\textbullet}% - \hspace{1cm}Page~\thepage~of~\pageref*{LastPage}\hspace{1cm}% - \TC{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.6cm}[0cm][0cm]{% - \hspace*{-.12mm}% - \makebox[0cm][r]{% - \xwcolorbox{framesep=5pt,framerule=2pt,fillcolor=yellow!55,framecolor=white, - align=justified,width=.81\paperwidth,% - text={\normalfont\small\\[\baselineskip]\color{xblue1}% - Copyright (c) 2009 Ahmed Musa \TC{red}{\textbullet}~% - This work may be distributed and/or modified for non-commercial purposes only. - The LPPL maintenance status of this software is \emph{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}% - \TC{red}{\textbullet}% - \hspace{4.3cm}User manual for the \TC{blue}{xwatermark} package\hspace{4.3cm}% - \TC{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. -} -\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}% - \TC{red}{$\blacktriangleright$}\hspace{1cm}The \texttt{\TC{white}{xwatermark}}~ - package\hspace{1cm}\TC{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*{-1.2mm}% - \xwcolorbox{framesep=5pt,framerule=2pt,fillcolor=red!75,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=red!55,framecolor=white, - align=center,width=.81\paperwidth,textcolor=white, - text={Copyright (c) 2009 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}% - \TC{red}{$\blacktriangleright$}\hspace{2.1cm}Page~\thepage~of~\pageref*{LastPage}% - \hspace{2cm}\TC{red}{$\blacktriangleleft$}\hspace{1cm}% - \color{white}\framebox[2.1cm][t]{\phantom{Hello}}% - \rotatebox[origin=c]{90}{\makebox[1.4cm][c]{\phantom{Hello}}}% - }}% -} -\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}}% -} -\endinput \ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/xwatermark/xwatermark-manifest-1dot4.tex b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-manifest-1dot4.tex new file mode 100644 index 00000000000..65e1fe1f161 --- /dev/null +++ b/Master/texmf-dist/doc/latex/xwatermark/xwatermark-manifest-1dot4.tex @@ -0,0 +1,17 @@ + +2010/01/10 + +The xwatermark bundle (version 1.4) consists of the following files: + +xwatermark.sty - The style file +xwatermark-guide-1dot4.tex - The user manual +xwatermark-examples-1dot4.tex - The examples file +xwatermark-guide-1dot4.cfg - The configuration file for the user + manual and example files +xwatermark-bugreport-1dot4.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/keyreader.sty b/Master/texmf-dist/tex/latex/xwatermark/keyreader.sty deleted file mode 100644 index 1de651a1221..00000000000 --- a/Master/texmf-dist/tex/latex/xwatermark/keyreader.sty +++ /dev/null @@ -1,113 +0,0 @@ -%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% -% This is file 'keyreader.sty', version 0.1. % -% % -% This package reads multiple keys to be defined by xkeyval.sty. % -% % -% This work 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 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. % -% % -% 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 Ahmed Musa (a.musa@rocketmail.com). % -%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% -\begingroup -\catcode064=11% @ -\catcode123=01% { -\catcode125=02% } -\def\x{\endgroup - \edef\kr@restorecodeatend{% - \catcode035=\the\catcode035\relax - \catcode064=\the\catcode064\relax - \catcode123=\the\catcode123\relax - \catcode125=\the\catcode125\relax - }% -} -\x -\catcode035=06% # -\catcode064=11% @ -\catcode123=01% { -\catcode125=02% } -\def\kr@ensurecode#1#2{% - \edef\kr@restorecodeatend{% - \kr@restorecodeatend - \catcode#1=\the\catcode#1\relax - }% - \catcode#1=#2\relax -} -\AtEndOfPackage{\kr@restorecodeatend} -\kr@ensurecode{044}{12}% , -\kr@ensurecode{059}{12}% ; -\kr@ensurecode{038}{03}% & -\ProvidesPackage{keyreader}% - [2009/12/15 v0.1 Read keys for the xkeyval package (AM)] -\NeedsTeXFormat{LaTeX2e}[1996/12/01] -\RequirePackage{xkeyval}[2008/08/13] -\newcommand\kr@warn[1]{\PackageWarningNoLine{keyreader}{#1}} -\newcommand\kr@err[1]{\PackageError{keyreader}{#1}{\@ehc}} -\define@cmdkey[KV]{keyreader}[kr@]{parser}[;]{} -\define@cmdkey[KV]{keyreader}[kr@]{keyprefix}[KV]{} -\define@cmdkey[KV]{keyreader}[kr@]{keyfamily}[fam]{} -\define@cmdkey[KV]{keyreader}[kr@]{macroprefix}[mp@]{} -\DeclareOptionX*{\kr@warn{Unknown option '\CurrentOption' ignored}} -\ExecuteOptionsX[KV]{parser,keyprefix,keyfamily,macroprefix} -\ProcessOptionsX*[KV]\relax -\@ifdefinable\krsetup{% - \def\krsetup#1{\setkeys[KV]{keyreader}{#1}}% -} -\long\def\ifblank#1{\kr@ifblank#1&&\@secondoftwo\@firstoftwo:} -\long\def\kr@ifblank#1#2#4#5:{#4} -\@ifdefinable\stopread{% - \long\def\stopread#1&{\long\def\kr@remainder{#1}}% -} -\def\kr@allist{} -\gdef\kr@define@key#1,#2,#3,#4&{% - \edef\kr@keytype{#1}% - \edef\kr@key{#2}% - \edef\kr@default{#3}% - \def\kr@func{#4}% - \ifcase\number\kr@keytype\relax - \or - \edef\x{\noexpand\define@key[\kr@keyprefix]{\kr@keyfamily}% - {\kr@key}[\kr@default]{\expandafter\noexpand\kr@func}% - }\x - \or - \edef\x{\noexpand\define@cmdkey[\kr@keyprefix]{\kr@keyfamily}% - [\kr@macroprefix]{\kr@key}[\kr@default]{\expandafter\noexpand\kr@func}% - }\x - \or - \edef\x{\noexpand\define@boolkey[\kr@keyprefix]{\kr@keyfamily}% - [\kr@macroprefix]{\kr@key}[\kr@default]{\expandafter\noexpand\kr@func}% - }\x - \or - \ifx\kr@allist\@empty - \kr@err{'\string\kr@allist' is empty: choicekey can't be defined. - \MessageBreak You need to first define '\string\kr@allist' - \MessageBreak as a nonempty set}% - \fi - \edef\x{\noexpand\define@choicekey*[\kr@keyprefix]{\kr@keyfamily}{\kr@key}% - [\noexpand\kr@val\noexpand\kr@nr]{\kr@allist}[\kr@default]% - {\expandafter\noexpand\kr@func}% - }\x - \else - \kr@err{Unknown key type/identifier '\kr@keytype'}% - \fi -} -\newcount\kr@cnta -\newcommand\define@keylist[1]{% - \kr@cnta=\z@\relax\romannumeral-`\q\expandafter\kr@readlist#1;&} -\expandafter\def\expandafter\kr@readlist\expandafter#\expandafter 1\kr@parser#2&{% - \ifblank{#1}{}{% - \ifx#1\stopread\stopread#2&\kr@cnta=1\relax\else\kr@define@key#1&\fi - }% - \ifnum\kr@cnta=\z@\ifblank{#2}{}{\kr@readlist#2&}\fi -} - -\endinput \ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/xwatermark/xwatermark.sty b/Master/texmf-dist/tex/latex/xwatermark/xwatermark.sty index bce397e73a3..b7973759d62 100644 --- a/Master/texmf-dist/tex/latex/xwatermark/xwatermark.sty +++ b/Master/texmf-dist/tex/latex/xwatermark/xwatermark.sty @@ -1,14 +1,15 @@ %++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% -% This is file 'xwatermark.sty', version 1.3. % +% This is file 'xwatermark.sty', version 1.4. % % % % This package puts user-specified watermarks (graphics and arbitrary % % texts) on select pages of documents. See package documentation % % for further details. % % % -% This work 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 in http://www.latex-project.org/lppl.txt and version 1.3 or later % +% 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 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. % % % % The LPPL maintenance status of this software is 'author-maintained'. % @@ -18,21 +19,23 @@ % implied warranties of merchantability and fitness for a particular % % purpose. % % % -% Copyright (c) 2009 Ahmed Musa (a.musa@rocketmail.com). % +% Copyright (c) 2010 Ahmed Musa (a.musa@rocketmail.com). % %++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% \begingroup -\catcode064=11% @ -\catcode123=01% { -\catcode125=02% } +\catcode064 11% @ +\catcode123 01% { +\catcode125 02% } \def\x{\endgroup \edef\xwm@RestoreCodeAtEnd{% - \catcode035=\the\catcode035\relax - \catcode064=\the\catcode064\relax - \catcode123=\the\catcode123\relax - \catcode125=\the\catcode125\relax + \catcode035 \the\catcode035% # + \catcode064 \the\catcode064% @ + \catcode123 \the\catcode123% { + \catcode125 \the\catcode125% } + \catcode061 \the\catcode061% = }% } \x +\@makeother{\=}% \catcode035=06% # \catcode064=11% @ \catcode123=01% { @@ -57,7 +60,6 @@ \xwm@EnsureCode{047}{12}% / \xwm@EnsureCode{058}{12}% : \xwm@EnsureCode{060}{12}% < -\xwm@EnsureCode{061}{12}% = \xwm@EnsureCode{062}{12}% > \xwm@EnsureCode{094}{07}% ^ (superscript) \xwm@EnsureCode{096}{12}% ` @@ -68,28 +70,43 @@ \def\filedate{#4}% \def\fileversion{v#3}% \def\filetime{#5}% - \def\fileauthor{#6\space#7} + \def\fileauthor{#6\space#7}% } \def\filedesc{% Puts user-specified watermarks on select document pages (\fileauthor)} \readRCS -$Id: xwatermark.sty,v 1.3 2009/10/27 09:00:00 Ahmed Musa Exp $ +$Id: xwatermark.sty,v 1.4 2010/01/10 09:00:00 Ahmed Musa Exp $ \ProvidesPackage{xwatermark}[\filedate\space\fileversion\space\filedesc] \NeedsTeXFormat{LaTeX2e}[1996/12/01] -\RequirePackage{etoolbox}[2009/08/06] -\RequirePackage{ltxnew}[2009/07/22] +\@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 + \fi + \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]{% - \ifstrempty{#2}{\xwm@err{Empty argument for dimension}}{} + \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{% @@ -97,10 +114,10 @@ $Id: xwatermark.sty,v 1.3 2009/10/27 09:00:00 Ahmed Musa Exp $ \renew\def\xwm@pageend{}% \xwm@pagerange@ifhyphen#1-\@nil{% \ifx\xwm@pagestart\@empty - \expandafter\xwm@err{Empty page range passed to package} + \xwm@afterelsefi\xwm@err{Empty page range passed to package}% \else - \expandafter\xwm@err{Only page \xwm@pagestart\MessageBreak - was passed as page range} + \xwm@afterfi + \xwm@err{Only page \xwm@pagestart\space was passed as page range}% \fi }{% \xwm@pagerange@split#1\@nil @@ -111,29 +128,28 @@ $Id: xwatermark.sty,v 1.3 2009/10/27 09:00:00 Ahmed Musa Exp $ \renew\def\xwm@pageend{#2}% \xwm@pagerange@ifhyphen#2-\@nil{% \ifx\xwm@pagestart\@empty - \expandafter\xwm@err{No starting page for page range} + \expandafter\xwm@err{No starting page for page range}% \else \ifx\xwm@pageend\@empty - \expandafter\expandafter\expandafter% - \xwm@err{No ending page for page range} + \xwm@afterelsefi + \xwm@err{No ending page for page range}% \else - \expandafter\expandafter\expandafter% - \xwm@info{Page range:\space - \xwm@pagestart\space to \xwm@pageend} + \xwm@afterfi + \xwm@info{Page range:\space\xwm@pagestart\space to \xwm@pageend}% \fi \fi }{% - \xwm@err{Too many hyphens in page range} + \xwm@err{Too many hyphens in page range}% }% } \new\def\xwm@pagerange@ifhyphen#1-#2\@nil{% - \ifstrempty{#2}{\expandafter\@firstoftwo}{\expandafter\@secondoftwo} + \ifstrempty{#2}{\@firstoftwo}{\@secondoftwo}% } -\RequirePackage{fix-cm} -\RequirePackage{graphicx} -\RequirePackage{xkeyval}[2008/08/13] -\RequirePackage{atbegshi}[2008/07/31] -\RequirePackage{picture}[2008/11/26] +\@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 @@ -143,14 +159,16 @@ $Id: xwatermark.sty,v 1.3 2009/10/27 09:00:00 Ahmed Musa Exp $ \xwm@info{'xcolor' package loaded with\MessageBreak options 'table', 'hyperref'} } -\RequirePackage{xifthen}[2009/04/17] -\RequirePackage{boxedminipage} +\@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 -\newtoggle{pdf} +\providetoggle{pdf} \ifundef\pdfoutput{}{\unless\ifnum\pdfoutput<1\toggletrue{pdf}\fi} \define@boolkey[XWM]{xwatermark}[xwm@]{printwatermark}[true]{% \ifxwm@printwatermark\xwm@minmark=\@ne\fi} @@ -177,9 +195,9 @@ $Id: xwatermark.sty,v 1.3 2009/10/27 09:00:00 Ahmed Musa Exp $ \fi }% } -\define@choicekey*+[XWM]{xwatermark}{align}[\xwm@val\xwm@nr]% +\define@choicekey*+[XWM]{xwatermark}{align}[\val\nr]% {center,right,left,justified}[center]{% - \ifcase\xwm@nr\relax + \ifcase\nr\relax \def\xwm@align{\centering}% \or \def\xwm@align{\flushright}% @@ -189,23 +207,20 @@ $Id: xwatermark.sty,v 1.3 2009/10/27 09:00:00 Ahmed Musa Exp $ \let\xwm@align\relax \fi }{% - \xwm@err{Inadmissible value '#1' for align} + \xwm@err{Inadmissible value '\string#1' for align}% } \define@cmdkey[XWM]{xwatermark}[xwm@]{page}[1]{% - \xwm@bool@onepageonlytrue - \xwm@minmark=\@ne\relax + \xwm@bool@onepageonlytrue\xwm@minmark=\@ne } \define@key[XWM]{xwatermark}{pages}[1-1]{% \xwm@bool@prangetrue - \xwm@pagerange{#1}% - \xwm@minmark=\@ne\relax + \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\relax - } + \xwm@bool@pmarktrue\xwm@minmark=\@ne + }% } \define@cmdkey[XWM]{xwatermark}[xwm@]{textmark}[DRAFT]{% \ifstrempty{#1}{\xwm@bool@tmarkfalse}{\xwm@bool@tmarktrue}% @@ -223,12 +238,10 @@ $Id: xwatermark.sty,v 1.3 2009/10/27 09:00:00 Ahmed Musa Exp $ {\def\xwm@picfilex{eps}}{}% }% } -\RequirePackage[parser=;,macroprefix=xwm@,keyprefix=XWM, - keyfamily=xwatermark]{keyreader} \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,;} + 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}{} @@ -236,15 +249,8 @@ $Id: xwatermark.sty,v 1.3 2009/10/27 09:00:00 Ahmed Musa Exp $ \ExecuteOptionsX[XWM]{printwatermark} \ProcessOptionsX*[XWM]\relax \newrobustcmd\watermarksetup[1]{\setkeys[XWM]{xwatermark}{#1}} -\def\xwm@nolateoptions{printwatermark} \AtBeginDocument{% - \@for\@mem:=\xwm@nolateoptions\do{% - \expandafter\edef\expandafter\@mem\expandafter{\expandafter - \expandafter\expandafter\zap@space\expandafter\@mem\space\@empty}% - \key@ifundefined[XWM]{xwatermark}{\@mem}{}{% - \xwm@disable@keys[XWM]{xwatermark}{\@mem}% - }% - }% + \xwm@disable@keys[XWM]{xwatermark}{printwatermark,dgeometry}% } \new\def\xwm@coords{\begingroup% \protected@edef\@tempa{\endgroup% @@ -252,7 +258,7 @@ $Id: xwatermark.sty,v 1.3 2009/10/27 09:00:00 Ahmed Musa Exp $ \number\xwm@xcoord\xwm@coordunit}% \xwm@dimdef{\xwm@ycoord@a}{-0.5\paperheight+ \number\xwm@ycoord\xwm@coordunit}% - }\@tempa% + }\@tempa } \unless\ifxwm@printwatermark \xwm@info{printwatermark=false: no watermark printed} @@ -262,28 +268,29 @@ $Id: xwatermark.sty,v 1.3 2009/10/27 09:00:00 Ahmed Musa Exp $ \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% - }}}}\relax - \removelastskip\normalcolor% -}% + \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}}\relax -}% + \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 @@ -317,89 +324,81 @@ $Id: xwatermark.sty,v 1.3 2009/10/27 09:00:00 Ahmed Musa Exp $ \fi \fi\fi\fi\fi\fi\fi\fi \fi -}% +} \ifxwm@printwatermark \AtBeginShipout{\AtBeginShipoutUpperLeft{\xwm@insertmark}}% \xwm@info{Option 'printwatermark=true': watermark printed}% \fi -\krsetup{keyfamily=minipage,macroprefix=mp@} +\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@cmdkey[XWM]{minipage}[mp@]{align}[center]{% - \protected@edef\mp@align{\mp@align}% - \def\@tempa{center}% - \ifx\mp@align\@tempa - \gdef\mp@align{\centering}% + 2,text,No text passed.,}% +\define@key[XWM]{minipage}{align}[center]{% + \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 \else - \def\@tempa{right}% - \ifx\mp@align\@tempa - \gdef\mp@align{\flushright}% - \else - \def\@tempa{left}% - \ifx\mp@align\@tempa - \gdef\mp@align{\flushleft}% - \else - \def\@tempa{justified}% - \ifx\mp@align\@tempa - \global\let\mp@align\relax - \else - \xwm@err{Inadmissible value '#1' for minipage's align} - \fi - \fi - \fi + \xwm@err{Inadmissible value '\string#1' for minipage's align}% \fi -} +}% \presetkeys[XWM]{minipage}{align,width,textcolor,text,framesep, framerule,framecolor}{}% \long\def\xwminipage#1{% \setkeys[XWM]{minipage}{#1}% - \begingroup - \fboxsep=\mp@framesep\relax - \fboxrule=\mp@framerule\relax + \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}\relax + \end{boxedminipage}% \removelastskip \endgroup -} +}% \krsetup{keyfamily=colorbox,macroprefix=cb@} \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@,} \define@choicekey*+[XWM]{colorbox}{align}[\val\nr]% {center,right,left,justified}[center]{% - \protected@edef\cb@align{\val} + \protected@edef\cb@align{\val}% }{% - \xwm@err{Inadmissible value '#1' for colorbox's align} -} + \xwm@err{Inadmissible value '\string#1' for colorbox's align}% +}% \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}{\relax + \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% - }\relax + text=\cb@text,textcolor=\cb@textcolor + }% }% - \removelastskip\normalcolor + \removelastskip\normalcolor% }% \newcommand\ywcolorbox[1]{% \setkeys[XWM]{colorbox}{#1}% \color{\cb@framecolor}% \begin{center}% \makebox[\z@][c]{% - \colorbox{\cb@fillcolor}{\relax + \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 - }\relax + }% }% }% \end{center}% @@ -419,28 +418,30 @@ $Id: xwatermark.sty,v 1.3 2009/10/27 09:00:00 Ahmed Musa Exp $ }{\xwm@err{No file \xwm@picfile.\xwm@picfilex\space or wrong path}}% }% }\@tempa% -} +}% \newrobustcmd\xwm@dis@ble@keys[1]{% - \XKV@checksanitizeb{#1}\XKV@tempa - \XKV@for@o\XKV@tempa\XKV@tempa{% - \XKV@ifundefined{\XKV@header\XKV@tempa}{% - \XKV@err{key '\XKV@tempa' undefined}% + \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}% }{% - \edef\XKV@tempb{% - \noexpand\xwm@err{Key '\XKV@tempa' has been disabled.\MessageBreak + \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}% }% - \XKV@ifundefined{\XKV@header\XKV@tempa @default}{% - \edef\XKV@tempc{\noexpand\XKV@define@key{\XKV@tempa}}% + \XKV@ifundefined{\XKV@header\xwm@tempa @default}{% + \edef\xwm@tempc{\noexpand\XKV@define@key{\xwm@tempa}}% }{% - \edef\XKV@tempc{\noexpand\XKV@define@key{\XKV@tempa}[]}% + \edef\xwm@tempc{\noexpand\XKV@define@key{\xwm@tempa}[]}% }% - \expandafter\XKV@tempc\expandafter{\XKV@tempb}% + \expandafter\xwm@tempc\expandafter{\xwm@tempb}% }% }% -} -\newcommand\xwm@disable@keys{\XKV@testoptb\xwm@dis@ble@keys} +}% +\newrobustcmd\xwm@disable@keys{\XKV@testoptb\xwm@dis@ble@keys}% \endinput + +%%% End of file xwatermark.sty %%% \ No newline at end of file -- cgit v1.2.3