summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/background
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-03-05 23:18:10 +0000
committerKarl Berry <karl@freefriends.org>2014-03-05 23:18:10 +0000
commit78421b8cf188c4dab7c54d40b422386364441fcd (patch)
tree111fbde500b346f39cc4bf9586e8a0c1358c1170 /Master/texmf-dist/source/latex/background
parente92a34caec5eab0a4c9409d6f0b8372d43dd0684 (diff)
background (4mar14)
git-svn-id: svn://tug.org/texlive/trunk@33100 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/background')
-rw-r--r--Master/texmf-dist/source/latex/background/background.dtx147
-rw-r--r--Master/texmf-dist/source/latex/background/background.ins4
2 files changed, 102 insertions, 49 deletions
diff --git a/Master/texmf-dist/source/latex/background/background.dtx b/Master/texmf-dist/source/latex/background/background.dtx
index 58ff5b2d671..26720cc94a3 100644
--- a/Master/texmf-dist/source/latex/background/background.dtx
+++ b/Master/texmf-dist/source/latex/background/background.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 2009, 2012 by Gonzalo Medina
+% Copyright (C) 2009, 2012, 2014 by Gonzalo Medina
%
% --------------------------------------------------------------------------
%
@@ -27,14 +27,15 @@
%
%<*driver>
\documentclass{ltxdoc}
-\usepackage{booktabs,multirow}
+\usepackage{booktabs}
+\usepackage[T1]{fontenc}
\usepackage[svgnames,x11names]{xcolor}
\usepackage{tikz}
\usepackage{ragged2e}
\usepackage{ntheorem}
\usepackage{framed}
-\usepackage{kpfonts}
-\usepackage{fancypar}
+\usepackage{fourier}
+\usepackage{beramono}
\usepackage{ifpdf}
\ifpdf
\usepackage[placement=top]{background}
@@ -57,6 +58,11 @@
pdfstartview={},%
breaklinks=true,%
linktocpage}
+
+\makeatletter
+\global\let\tikz@ensure@dollar@catcode=\relax
+\makeatother
+
\newcommand\MarNote[1]{\marginpar{\RaggedLeft\textcolor{blue}{#1}}}
\newcommand*\package[1]{{\upshape\mdseries\sffamily #1}}
@@ -97,9 +103,9 @@
\newcommand\impo{%
\tikz{%
- \node[draw=Tomato, very thick , fill=Honeydew2,%xshift=2cm,%
+ \node[draw=Maroon, very thick , fill=Honeydew2,%xshift=2cm,%
text width=0.8cm , text height=.8cm , text depth=0cm , text badly centered]
- {\textcolor{Tomato}{\fontsize{30}{72}\selectfont\bfseries !}};
+ {\textcolor{Maroon}{\fontsize{30}{72}\selectfont\bfseries !}};
}
}
@@ -137,7 +143,7 @@
% Grave accent \` Left brace \{ Vertical bar \|
% Right brace \} Tilde \~}
%
-% \CheckSum{204}
+% \CheckSum{208}
%
% \changes{v 1.0}{2009/11/07}{First version}
% \changes{v 2.0}{2012/08/06}{Second version}
@@ -165,8 +171,6 @@
% packages to provide a simple and flexible mechanism to include background material on all
% (or on some of) the pages of a \LaTeX2e document.
% \par\medskip
-% This version reimplements almost completely version 1.0; a most friendly interface was implemented using the |key=value| functionality.
-% \par\medskip
% The author will gladly receive suggestions, comments and bug reports.
%
% \section{User Interface}
@@ -191,12 +195,12 @@
% \end{mycode}
% So, for example,
% \begin{mycode}
-%|\usepackage[contents=Confidential,color=blue!30]{background}|
+%|\usepackage[contents=Confidential,color=blue]{background}|
% \end{mycode}
% and
% \begin{mycode}
%|\usepackage{background}|\\
-%|\backgroundsetup{contents=Confidential,color=blue!30}|
+%|\backgroundsetup{contents=Confidential,color=blue}|
% \end{mycode}
% produce the same result. The advantage of |\backgroundsetup| is that it can be used not only in the preamble but on the body of the document, as many times as required.\medskip
% \begin{Alerta}
@@ -248,11 +252,19 @@
%|position={5cm,7cm}|
% \end{mycode}
-%\DescribeMacro{anchor=}
+%\DescribeMacro{nodeanchor=}
%This option allows the user to set the anchor for the node containing the background material. Typical values for this key are:
% \begin{mycode}
-%|anchor=north east|\\
-%|anchor=below|
+%|nodeanchor=south east|\\
+%|nodeanchor=north|
+% \end{mycode}
+% \par\medskip
+
+%\DescribeMacro{anchor=}
+%This option allows the user to set the simplified anchor for the node containing the background material. Typical values for this key are:
+% \begin{mycode}
+%|anchor=left|\\
+%|anchor={below=30pt}|
% \end{mycode}
% \par\medskip
@@ -262,31 +274,33 @@
% These two options control the horizontal and vertical shifting, respectively, of the node position.
% \begin{table}[!ht]
% \centering
+% \caption{Available options.}
+% \renewcommand\arraystretch{1.3}
% \makebox[\textwidth]{
% \begin{tabular}{rll}\toprule
-% Key & Possible Values & Default\\\toprule
+% Key & Possible Values & Default\\\midrule
% |pages| & |<all|$\mid$|some>| & |all| \\
% |firstpage| & |<true|$\mid$|false>| & |false| \\
% |placement| & |<center|$\mid$|top|$\mid$|bottom>| & |center| \\
% |contents| & Text, images, etc. & |Draft|\\
-% |color| & Any valid color & red!45\ \ \colorsample{red!45}\\
-% |angle| & Any value between -360 and 360 & 60, for |center| \\
-% & & 0, for |top| and |bottom|\\
-% |opacity| & Any value between 0 and 1 & 0.5 \\
-% |scale| & Any positive value & 15 for |center| \\
-% & & 8 for |top| and |bottom| \\
+% |color| & Any valid color & |red!45|\ \ \colorsample{red!45}\\
+% |angle| & Any value between -360 and 360 & |60|, for |center| \\
+% & & |0|, for |top| and |bottom|\\
+% |opacity| & Any value between 0 and 1 & |0.5| \\
+% |scale| & Any positive value & |15| for |center| \\
+% & & |8| for |top| and |bottom| \\
% |position| & Any value for node placement & |current page.center| for |center| \\
% & & |current page.north| for |top| \\
% & & |current page.south| for |bottom| \\
-% |anchor| & Any value for node anchor & empty for |center| \\
+% |anchor| & Any simplified value for node anchor & |empty| for |center| \\
% & & |below| for |top| \\
% & & |above| for |bottom| \\
-% |hshift| & Any value. & 0 \\
-% |vshift| & Any value. & 0 \\
+% |nodeanchor| & Any value for node anchor & |center| \\
+% |hshift| & Any length. & 0pt \\
+% |vshift| & Any length. & 0pt \\
% \\\bottomrule
% \end{tabular}
% }
-% \caption{The available options.}
% \label{tab:options}
% \end{table}
%
@@ -332,8 +346,14 @@
% \end{exam}
% \begin{mycode}
% |\documentclass{article}|\\
-% |\usepackage[placement=top,angle=0,%|\\
-% | color=black!40,scale=4,hshift=60,vshift=-5]{background}| \\
+% |\usepackage[|\\
+% | placement=top,|\\
+% | angle=0, |\\
+% | color=black!40, |\\
+% | scale=4, |\\
+% | hshift=60, |\\
+% | vshift=-5 |\\
+% | ]{background}| \\
% |\backgroundsetup{contents={-\thepage-}}|\\
% |\usepackage{lipsum}|\\
%
@@ -345,7 +365,7 @@
% \end{mycode}
%
% \begin{exam}\label{exa:bgthispage}
-% This example illustrates how to use of the |\BgThispage| command to add background material on selected pages and how to use |\backgroundsetup|.
+% This example illustrates how to use of the {\normalfont |\BgThispage|} command to add background material on selected pages and how to use {\normalfont |\backgroundsetup|}.
% \end{exam}
% \begin{mycode}
% |\documentclass{article}|\\
@@ -371,17 +391,29 @@
% \end{exam}
% \begin{mycode}
% |\documentclass{article}|\\
-% |\usepackage[contents={},opacity=1,scale=1.5,|
-% | color=blue!90]{background}|\\
+% |\usepackage[ |\\
+% | contents={}, |\\
+% | opacity=1, |\\
+% | scale=1.5, |\\
+% | color=blue!90 |\\
+% | ]{background} |\\
% |\usepackage{lipsum}|\\
% |\usepackage{ifthen}|\\
%
% |\AddEverypageHook{%|\\
-% | \ifthenelse{\isodd{\thepage}}%|\\
-% | {\backgroundsetup{angle=90,position={0,-0.65\textheight},%|\\
-% | contents={The background package}}}%|\\
-% | {\backgroundsetup{angle=270,position={0.9\textwidth,-.7\textheight},%|\\
-% | contents={Version 2.0}}}%|\\
+% | \ifthenelse{\isodd{\value{page}}}%|\\
+% | {\backgroundsetup{ |\\
+% | angle=90, |\\
+% | position={0,-0.65\textheight}, |\\
+% | contents={The background package} |\\
+% | }% |\\
+% | }% |\\
+% | {\backgroundsetup{|\\
+% | angle=270,|\\
+% | position={0.9\textwidth,-.7\textheight},%|\\
+% | contents={Version 2.1}|\\
+% | }% |\\
+% | }% |\\
% | \BgMaterial}|\\
%
% |\begin{document}|\\
@@ -391,9 +423,9 @@
%
% \begin{exam}\label{exa:nobgthispage}
% This example
-% illustrates the use of the |\NoBgThispage| command, to
+% illustrates the use of the {\normalfont |\NoBgThispage|} command, to
% suppress the background material on selected pages (page 2, in this case).
-% Adding the |twocolumn| class option will produce compilation errors
+% Adding the {\normalfont |twocolumn|} class option will produce compilation errors
% \end{exam}
% \begin{mycode}
% |\documentclass{article}|\\
@@ -447,6 +479,13 @@
% \item A user command |\BgMaterial| has been added.
% \end{itemize}
%
+% \textbf{Version 2.1 (2014/03/04)}:
+% \begin{itemize}
+% \item Added the |nodeanchor| key..
+% \item The containing node has now |inner sep=0pt|.
+% \item Improved documentation.
+% \end{itemize}
+%
% \DoNotIndex{\#,\$,\%,\&,\@,\\,\{,\},\^,\_,\~,\ }
% \DoNotIndex{\@ifpackageloaded }
% \DoNotIndex{\advance,\AtEndDocument,\begingroup,\begin,\catcode,\clearpage}
@@ -464,7 +503,7 @@
% Standard identification:
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{background}[2012/08/06 v2.0 background material]
+\ProvidesPackage{background}[2014/03/04 v2.1 background material]
% \end{macrocode}
%
% Next, we check if the needed packages have been already loaded; if not, we load them:
@@ -472,7 +511,7 @@
% \begin{macrocode}
\@ifpackageloaded{xkeyval}{}{\RequirePackage{xkeyval}}
\@ifpackageloaded{tikz}{}{\RequirePackage{tikz}}
-\@ifpackageloaded{everypar}{}{\RequirePackage{everypage}}
+\@ifpackageloaded{everypage}{}{\RequirePackage{everypage}}
\@ifpackageloaded{afterpage}{}{\RequirePackage{afterpage}}
% \end{macrocode}
%
@@ -483,6 +522,7 @@
% \begin{macro}{scale=}
% \begin{macro}{position=}
% \begin{macro}{anchor=}
+% \begin{macro}{nodeanchor=}
% \begin{macro}{hshift=}
% \begin{macro}{vshift=}
% Now we declare the options that will control the background material
@@ -501,6 +541,8 @@
\def\Background@Position{#1}}
\DeclareOptionX[BG]<background>{anchor}{%
\def\Background@Anchor{#1}}
+\DeclareOptionX[BG]<background>{nodeanchor}{%
+ \def\Background@NodeAnchor{#1}}
\DeclareOptionX[BG]<background>{hshift}{%
\def\Background@HShift{#1}}
\DeclareOptionX[BG]<background>{vshift}{%
@@ -515,6 +557,7 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\bg@some}
% A boolean (initially set to |false|) to control whether the background material will be displayed in
@@ -606,10 +649,11 @@
\ExecuteOptions{all,center}
% \begin{macrocode}
-% Now we process any unknown inputs. A warning will be produced when the user issues an option that has not been declared.
+% Now we process any unknown inputs. A warning will be produced when the
+% user issues an option that has not been declared.
% \begin{macrocode}
-\DeclareOptionX*{\PackageWarning{background}{‘ \CurrentOption’ ignored}}
+\DeclareOptionX*{\PackageWarningNoLine{background}{Option '\CurrentOption' ignored}}
% \end{macrocode}
%
% We next execute and process the options:
@@ -624,8 +668,9 @@
scale=10,%
position=current page.center,%
anchor={},%
- hshift=0,%
- vshift=0%
+ nodeanchor={center},%
+ hshift=0pt,%
+ vshift=0pt%
}
\ProcessOptionsX[BG]<background>
@@ -647,10 +692,18 @@
\newcommand\bg@material{%
\begin{tikzpicture}[remember picture,overlay,scale=\Background@Scale]
- \node [rotate=\Background@Angle,scale=\Background@Scale,
- opacity=\Background@Opacity,%
- xshift=\Background@HShift,yshift=\Background@VShift,color=\Background@Color]
- at (\Background@Position) [\Background@Anchor] {\Background@Contents};
+ \node[
+ rotate=\Background@Angle,
+ scale=\Background@Scale,
+ opacity=\Background@Opacity,
+ anchor=\Background@NodeAnchor,
+ xshift=\Background@HShift,
+ yshift=\Background@VShift,
+ color=\Background@Color,
+ inner sep=0pt
+ ]
+ at (\Background@Position) [\Background@Anchor]
+ {\Background@Contents};
\end{tikzpicture}}%
% \end{macrocode}
% \end{macro}
diff --git a/Master/texmf-dist/source/latex/background/background.ins b/Master/texmf-dist/source/latex/background/background.ins
index 1ce7f6e36e5..7eff8ebea33 100644
--- a/Master/texmf-dist/source/latex/background/background.ins
+++ b/Master/texmf-dist/source/latex/background/background.ins
@@ -2,7 +2,7 @@
\keepsilent
\preamble
-Copyright (C) 2009-2012 Gonzalo Medina (gmedinaar@unal.edu.co)
+Copyright (C) 2009, 2012, 2014 Gonzalo Medina (gmedinaar@unal.edu.co)
--------------------------------------------------------------------------
@@ -31,7 +31,7 @@ and the derived files background.sty and background.pdf.
\Msg{* \space\space background.sty}
\Msg{*}
\Msg{* To produce the documentation run the file background.dtx}
-\Msg{* through LaTeX.}
+\Msg{* through pdfLaTeX.}
\Msg{*}
\Msg{* Happy TeXing!}
\Msg{*********************************************************}