summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/eso-pic
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/eso-pic
Initial commit
Diffstat (limited to 'macros/latex/contrib/eso-pic')
-rw-r--r--macros/latex/contrib/eso-pic/README11
-rw-r--r--macros/latex/contrib/eso-pic/eso-article-test.tex34
-rw-r--r--macros/latex/contrib/eso-pic/eso-ex1.tex39
-rw-r--r--macros/latex/contrib/eso-pic/eso-ex2.tex40
-rw-r--r--macros/latex/contrib/eso-pic/eso-ex3.tex42
-rw-r--r--macros/latex/contrib/eso-pic/eso-ex4.tex46
-rw-r--r--macros/latex/contrib/eso-pic/eso-ex5.tex46
-rw-r--r--macros/latex/contrib/eso-pic/eso-memoir-test.tex43
-rw-r--r--macros/latex/contrib/eso-pic/eso-pic.dtx719
-rw-r--r--macros/latex/contrib/eso-pic/eso-pic.ins47
-rw-r--r--macros/latex/contrib/eso-pic/eso-pic.pdfbin0 -> 250322 bytes
-rw-r--r--macros/latex/contrib/eso-pic/showframe.sty68
12 files changed, 1135 insertions, 0 deletions
diff --git a/macros/latex/contrib/eso-pic/README b/macros/latex/contrib/eso-pic/README
new file mode 100644
index 0000000000..57772f8909
--- /dev/null
+++ b/macros/latex/contrib/eso-pic/README
@@ -0,0 +1,11 @@
+eso-pic
+=======
+
+LaTeX package to add pic­ture com­mands (or back­grounds) to ev­ery page.
+
+The pack­age adds one or more user com­mands to LaTeX’s shipout rou­tine, which
+may be used to place the out­put at fixed po­si­tions. The grid op­tion may be
+used to find the cor­rect places.
+
+Rolf Niepraschk (Rolf.Niepraschk@gmx.de)
+
diff --git a/macros/latex/contrib/eso-pic/eso-article-test.tex b/macros/latex/contrib/eso-pic/eso-article-test.tex
new file mode 100644
index 0000000000..b35d69a405
--- /dev/null
+++ b/macros/latex/contrib/eso-pic/eso-article-test.tex
@@ -0,0 +1,34 @@
+
+\listfiles
+\documentclass[a4paper,twoside]{article}
+
+\usepackage{eso-pic}
+\usepackage{pict2e,showframe,xcolor}
+
+\AddToShipoutPicture{%
+ \AtPageLowerLeft{\circle*{40}}%
+ \AtPageUpperLeft{\circle*{40}}%
+ \AtPageCenter{\circle*{40}}%
+ \AtTextLowerLeft{\circle*{15}}%
+ \AtTextUpperLeft{\circle*{15}}%
+ \color{red}%
+ \AtStockLowerLeft{\circle*{20}}%
+ \AtStockUpperLeft{\circle*{20}}%
+ \AtStockCenter{\circle*{20}}%
+}
+
+\begin{document} \Huge \bfseries
+
+\noindent
+\hrulefill First Page\hrulefill
+\vfill
+\noindent
+X \hfill X
+\newpage
+\noindent
+\hrulefill Second Page\hrulefill
+\vfill
+\noindent
+X \hfill X
+
+\end{document}
diff --git a/macros/latex/contrib/eso-pic/eso-ex1.tex b/macros/latex/contrib/eso-pic/eso-ex1.tex
new file mode 100644
index 0000000000..6241e37d3f
--- /dev/null
+++ b/macros/latex/contrib/eso-pic/eso-ex1.tex
@@ -0,0 +1,39 @@
+
+% file `eso-ex1.tex'; a framed background example
+% Rolf Niepraschk, 2015-07-14, Rolf.Niepraschk@gmx.de
+
+\documentclass[a4paper]{article}
+\usepackage{eso-pic,calc}
+\listfiles
+
+\makeatletter
+\AddToShipoutPicture{%
+ \begingroup
+ \setlength{\@tempdima}{15mm}%
+ \setlength{\@tempdimb}{\paperwidth-2\@tempdima}%
+ \setlength{\@tempdimc}{\paperheight-2\@tempdima}%
+ \thicklines%
+ \put(\LenToUnit{\@tempdima},\LenToUnit{\@tempdima}){%
+ \framebox(\LenToUnit{\@tempdimb},\LenToUnit{\@tempdimc}){}}%
+ \endgroup
+}
+\makeatother
+
+\begin{document}
+
+ \section*{First page}
+
+ This page and all the following have a frame with 15~mm
+ distance from the paper edges.\newpage
+
+ \section*{Second page}
+
+ \AddToShipoutPicture*{\put(100,100){\circle{40}}}
+
+ Only this page has a circle on the lower left side.
+
+ \newpage
+
+ \section*{Last page}
+
+\end{document}
diff --git a/macros/latex/contrib/eso-pic/eso-ex2.tex b/macros/latex/contrib/eso-pic/eso-ex2.tex
new file mode 100644
index 0000000000..37012a958e
--- /dev/null
+++ b/macros/latex/contrib/eso-pic/eso-ex2.tex
@@ -0,0 +1,40 @@
+
+% file `eso-ex2.tex'; an example for background pictures
+% Rolf Niepraschk, 2015-07-14, Rolf.Niepraschk@gmx.de
+\listfiles\setcounter{errorcontextlines}{100}
+\documentclass{article}
+
+\usepackage{eso-pic}
+\usepackage{graphicx}
+\usepackage[dvips]{geometry}
+% Tells `dvips' and `pdfTeX' the papersize.
+
+% `rose.eps' from CTAN: macros/generic/boxedeps/
+\newcommand\BackgroundPicture{%
+ \put(0,0){%
+ \parbox[b][\paperheight]{\paperwidth}{%
+ \vfill
+ \centering
+ \includegraphics[width=\paperwidth,height=\paperheight,%
+ keepaspectratio]{rose}%
+ \vfill
+ }}}
+% The picture is centered on the page background
+
+\AddToShipoutPicture{\BackgroundPicture}
+
+\begin{document}
+
+\section{\TeX}
+
+\newpage
+
+\ClearShipoutPicture
+\section{Empty}
+
+\newpage
+
+\AddToShipoutPicture{\BackgroundPicture}
+\section{\LaTeX}
+
+\end{document}
diff --git a/macros/latex/contrib/eso-pic/eso-ex3.tex b/macros/latex/contrib/eso-pic/eso-ex3.tex
new file mode 100644
index 0000000000..4465d3e3f8
--- /dev/null
+++ b/macros/latex/contrib/eso-pic/eso-ex3.tex
@@ -0,0 +1,42 @@
+
+% file `eso-ex3.tex'; an example for import pages of another (pdf) document.
+% This works only with `pdfTeX' (maybe `VTeX'?).
+% Based on an article from Andreas Matthias <amat@kabsi.at> in d.c.t.t
+%
+% A much better solution is Andreas' package `pdfpages'.
+%
+% Rolf Niepraschk, 2015-07-14, Rolf.Niepraschk@gmx.de
+
+\documentclass[a4paper]{article}
+\usepackage[pdftex]{graphicx}%
+% `pdftex.def' >= 2000/05/12 v0.02u and `pdftex' >= v0.14 are needed.
+\usepackage{ifthen,calc,eso-pic}
+
+\newcounter{thispdfpage}\newcounter{afterlastpdfpage}
+\newcommand{\includepdfpages}[3]
+{%
+ \setcounter{thispdfpage}{#2}\setcounter{afterlastpdfpage}{#3+1}%
+ \newpage
+ \whiledo{\value{thispdfpage} < \value{afterlastpdfpage}}%
+ {%
+ \AddToShipoutPicture*
+ {%
+ \put(0,0){%
+ \includegraphics[width=\paperwidth,height=\paperheight,%
+ keepaspectratio,page=\arabic{thispdfpage}]{#1}}%
+ }
+ \thispagestyle{empty}\mbox{}\newpage
+ \stepcounter{thispdfpage}%
+ }
+}
+
+\begin{document}
+
+\section{First page of the main document}
+
+% import pages 1 to 3 of an external document.
+\includepdfpages{ltx3info.pdf}{1}{3}
+
+\section{First page after the imported pages of the external document}
+
+\end{document}
diff --git a/macros/latex/contrib/eso-pic/eso-ex4.tex b/macros/latex/contrib/eso-pic/eso-ex4.tex
new file mode 100644
index 0000000000..eb617a7bbd
--- /dev/null
+++ b/macros/latex/contrib/eso-pic/eso-ex4.tex
@@ -0,0 +1,46 @@
+
+% file `eso-ex4.tex'; a framed text area example
+% Rolf Niepraschk, 2015-07-14, Rolf.Niepraschk@gmx.de
+
+\listfiles\setcounter{errorcontextlines}{100}
+\documentclass[a4paper,twoside]{article}
+\usepackage{graphicx,color}
+\usepackage{eso-pic}
+\definecolor{lightgray}{gray}{.75}
+
+\AddToShipoutPicture{%
+ \AtTextLowerLeft{%
+ \framebox(\LenToUnit{\textwidth},\LenToUnit{\textheight}){}}}
+
+\setlength\parindent{0pt}
+
+\begin{document}
+
+ \section*{First page}
+
+ This page and all the following have a frame around the
+ text area.
+
+ \vfill
+ X \hfill X\newpage
+
+ \section*{Second page}
+
+ \AddToShipoutPicture*{%
+ \AtTextCenter{%
+ \makebox(0,0)[c]{\resizebox{\textwidth}{!}{%
+ \rotatebox{45}{\textsf{\textbf{\color{lightgray}DRAFT}}}}}
+ }
+ }
+
+ Only this page has rotated text in the center of the text area.
+
+ \vfill
+ X \hfill X\newpage
+
+ \section*{Last page}
+
+ \vfill
+ X \hfill X
+
+\end{document}
diff --git a/macros/latex/contrib/eso-pic/eso-ex5.tex b/macros/latex/contrib/eso-pic/eso-ex5.tex
new file mode 100644
index 0000000000..6c6e1e9ea5
--- /dev/null
+++ b/macros/latex/contrib/eso-pic/eso-ex5.tex
@@ -0,0 +1,46 @@
+
+% file `eso-ex5.tex'; background grid example
+% Rolf Niepraschk, 2015-07-14, Rolf.Niepraschk@gmx.de
+
+\listfiles\setcounter{errorcontextlines}{100}
+\documentclass[a4paper,twoside]{article}
+% a4paper = 210mm x 297mm = 596bp x 842bp = 8.27in x 11.69in
+% letterpaper = 215.9mm x 279.4mm = 612bp x 792bp = 8.5in x 11in
+
+%\usepackage[a3,center]{crop}
+
+\usepackage[dvips]{geometry}
+% `dvips', `pdfTeX' and `VTeX' should know the papersize.
+
+\usepackage[colorgrid,gridBG=true,gridunit=mm,texcoord]{eso-pic}
+%\usepackage[colorgrid,gridunit=in,subgridcolor=blue,texcoord]{eso-pic}
+%\usepackage[grid,gridunit=bp,subgridstyle=dotted]{eso-pic}
+
+\newcommand*\cmd[1]{\texttt{\symbol{`\\}#1}}
+
+\AddToShipoutPicture{%
+ \thicklines\normalfont\ttfamily\Large%
+ \color{blue}\setlength\unitlength{1mm}%
+ \AtTextCenter{\circle*{6}%
+ \put(-2,0){\makebox(0,0)[lb]{\cmd{AtTextCenter}}}}%
+ \AtTextUpperLeft{\circle*{6}%
+ \put(-2,5){\makebox(0,0)[lt]{\cmd{AtTextUpperLeft}}}}%
+ \AtTextLowerLeft{\circle*{6}%
+ \put(-2,-5){\makebox(0,0)[lb]{\cmd{AtTextLowerLeft}}}}%
+ \color{red}%
+ \AtPageCenter{\circle*{6}%
+ \put(-2,0){\makebox(0,0)[lt]{\cmd{AtPageCenter}}}}%
+ \AtPageUpperLeft{\circle*{6}%
+ \put(-2,-5){\makebox(0,0)[lb]{\cmd{AtPageUpperLeft}}}}%
+ \AtPageLowerLeft{\circle*{6}%
+ \put(-2,5){\makebox(0,0)[lt]{\cmd{AtPageLowerLeft}}}}%
+}
+
+\setlength\parindent{0pt}
+
+\begin{document} \Huge \bfseries
+
+\hrulefill First Page\hrulefill \vfill X \hfill X \newpage
+\hrulefill Second Page\hrulefill \vfill X \hfill X
+
+\end{document}
diff --git a/macros/latex/contrib/eso-pic/eso-memoir-test.tex b/macros/latex/contrib/eso-pic/eso-memoir-test.tex
new file mode 100644
index 0000000000..5df69f737e
--- /dev/null
+++ b/macros/latex/contrib/eso-pic/eso-memoir-test.tex
@@ -0,0 +1,43 @@
+% Rolf Niepraschk, 2015-07-14, Rolf.Niepraschk@gmx.de
+
+\setcounter{errorcontextlines}{100}
+\listfiles
+\documentclass[twoside,a4paper,showtrims]{memoir}
+%------------------------------------
+\stockaiii
+\setlength{\trimedge}{\stockwidth}
+\addtolength{\trimedge}{-\paperwidth}
+\setlength{\trimedge}{.25\trimedge}
+\setlength{\trimtop}{\stockheight}
+\addtolength{\trimtop}{-\paperheight}
+\setlength{\trimtop}{.25\trimtop}
+\checkandfixthelayout
+%------------------------------------
+\usepackage{eso-pic}
+\usepackage{pict2e,showframe}
+
+\AddToShipoutPicture{%
+ \AtPageLowerLeft{\circle*{40}}%
+ \AtPageUpperLeft{\circle*{40}}%
+ \AtTextLowerLeft{\circle*{15}}%
+ \AtTextUpperLeft{\circle*{15}}%
+ \AtStockLowerLeft{\circle*{40}}%
+ \AtStockUpperLeft{\circle*{40}}%
+ \AtStockCenter{\circle*{40}}%
+}
+
+\begin{document} \Huge \bfseries
+
+\noindent
+\hrulefill First Page\hrulefill
+\vfill
+\noindent
+X \hfill X
+\newpage
+\noindent
+\hrulefill Second Page\hrulefill
+\vfill
+\noindent
+X \hfill X
+
+\end{document}
diff --git a/macros/latex/contrib/eso-pic/eso-pic.dtx b/macros/latex/contrib/eso-pic/eso-pic.dtx
new file mode 100644
index 0000000000..5c7ec360c5
--- /dev/null
+++ b/macros/latex/contrib/eso-pic/eso-pic.dtx
@@ -0,0 +1,719 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 1998-2015 by Rolf Niepraschk <Rolf.Niepraschk@gmx.de>
+% -------------------------------------------------------------------
+%
+% This file may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.2
+% of this license or (at your option) any later version.
+% The latest version of this license is in:
+%
+% http://www.latex-project.org/lppl.txt
+%
+% and version 1.2 or later is part of all distributions of LaTeX
+% version 1999/12/01 or later.
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "author-maintained".
+%
+% Please send error reports and suggestions for improvements to
+% Rolf Niepraschk <Rolf.Niepraschk@gmx.de>.
+%
+% \fi
+%
+% \iffalse
+%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+%<package>\ProvidesPackage{eso-pic}
+%<package> [2018/04/12 v2.0h eso-pic (RN)]
+%
+%<*driver>
+\documentclass[a4paper]{ltxdoc}
+\usepackage{eso-pic,array}
+\EnableCrossrefs\CodelineIndex\RecordChanges
+\begin{document}
+ \DocInput{eso-pic.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \CheckSum{778}
+%
+% \CharacterTable
+% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+% Digits \0\1\2\3\4\5\6\7\8\9
+% Exclamation \! Double quote \" Hash (number) \#
+% Dollar \$ Percent \% Ampersand \&
+% Acute accent \' Left paren \( Right paren \)
+% Asterisk \* Plus \+ Comma \,
+% Minus \- Point \. Solidus \/
+% Colon \: Semicolon \; Less than \<
+% Equals \= Greater than \> Question mark \?
+% Commercial at \@ Left bracket \[ Backslash \\
+% Right bracket \] Circumflex \^ Underscore \_
+% Grave accent \` Left brace \{ Vertical bar \|
+% Right brace \} Tilde \~}
+%
+% \iffalse meta-comment
+% ===================================================================
+% @LaTeX-package-file{
+% author = {Rolf Niepraschk},
+% version = "v2.0i",
+% date = "12 Apr 2018",
+% filename = "eso-pic.sty",
+% address = "",
+% telephone = "",
+% email = "Rolf.Niepraschk@gmx.de",
+% codetable = "ISO/ASCII",
+% keywords = "LaTeX2e, \shipout, picture",
+% dependences = "atbegshi",
+% supported = "yes",
+% docstring = "LaTeX package which makes it easy to add some
+% picture commands to every page."
+% }
+% ===================================================================
+% \fi
+%
+% \providecommand\env[1]{\textsf{#1}}
+% \providecommand\clsname[1]{\textsf{#1}}
+% \providecommand\pkgname[1]{\textsf{#1}}
+% \providecommand\optname[1]{\textsf{#1}}
+% \providecommand\progname[1]{\textsf{#1}}
+%
+% \setlength\emergencystretch{3em}
+%
+% \changes{v0.4}{1998/06/02}{Initial version}
+% \changes{v0.5}{1998/07/11}{Some bug corrections}
+% \changes{v0.6}{2000/05/13}{Some corrections for compatibility with
+% the \pkgname{html} package suggested by Ross Moore and a licence note}
+% \changes{v0.7}{2001/07/20}{New command \cmd{\AddToShipoutPicture*}}
+% \changes{v1.0}{2002/07/03}{New commands \cmd{\LenToUnit},%
+% \cmd{\AtPageUpperLeft}, \cmd{\AtPageCenter}, \cmd{\AtTextUpperLeft},
+% and \cmd{\AtTextCenter}.}
+% \changes{v1.0c}{2002/10/30}{New command \cmd{\AtTextLowerLeft} and
+% corrections to \cmd{\AtTextUpperLeft}.}
+% \changes{v1.1}{2002/11/07}{New commands and package options for
+% background grids.}
+% \changes{v1.1b}{2002/11/16}{New package options "texcoord" and "pscoord"}
+% \changes{v1.1b}{2002/11/16}{New command \cmd{\AtPageLowerLeft}}
+%
+% \GetFileInfo{eso-pic.sty}
+%
+% \DoNotIndex{\newcommand,\newenvironment}
+%
+% \title{The \pkgname{eso-pic} package\thanks{This document
+% corresponds to \pkgname{eso-pic}~\fileversion, dated \filedate.}}
+% \author{Rolf Niepraschk \\ \texttt{Rolf.Niepraschk@gmx.de}}
+%
+% \date{}
+%
+% \maketitle
+%
+% \section{Introduction}
+%
+% This package makes it easy to add some picture commands to every page
+% at absolute positions.
+% \section{Usage}
+% See also the example \LaTeX\ documents (|eso-*.tex|).
+%
+% \subsection{Basic commands for adding \LaTeX{} stuff to the page background}
+% \DescribeMacro{\AddToShipoutPictureBG} All the picture commands which are
+% parameters of an \cs{AddToShipoutPictureBG} command will be added to the
+% internal macro \cs{ESO@HookIBG}. This macro is part of a
+% zero-length \texttt{picture} environment with basepoint at the lower left
+% corner of the page (default) or at the upper left corner
+% (package option "texcoord"). The \texttt{picture} environment will be
+% shipped out at every new page.
+%
+% \DescribeMacro{\AddToShipoutPictureBG*} \cs{AddToShipoutPictureBG*} works like
+% \cs{AddToShipoutPictureBG} but only for the current page. It used the internal
+% macro \cs{ESO@HookIIBG} which contents will be removed
+% automatically.
+%
+% For compatibility the macros \cs{AddToShipoutPicture} and
+% \cs{AddToShipoutPicture*} are aliases for \cs{AddToShipoutPictureBG}
+% and \cs{AddToShipoutPictureBG*}.
+%
+% \DescribeMacro{\AddToShipoutPictureFG}
+% \DescribeMacro{\AddToShipoutPictureFG*} Works like
+% \cs{AddToShipoutPictureBG} but the picture commands are on the top
+% oft the normal document content.
+%
+% \DescribeMacro{\ClearShipoutPictureBG} A call of
+% \cs{ClearShipoutPictureBG}
+% clears the contents of \cs{ESO@HookIBG}.
+%
+% For compatibility the macro \cs{ClearShipoutPicture}
+% is an alias for \cs{ClearShipoutPictureBG}.
+%
+% \DescribeMacro{\ClearShipoutPictureFG} A call of
+% \cs{ClearShipoutPictureFG}
+% clears the contents of \cs{ESO@HookIFG}.
+%
+% \DescribeMacro{\LenToUnit} Allows a length as parameter to a picture
+% command. Note that this macro is no more necessary when using
+% |\usepackage{picture}|.
+%
+% \DescribeMacro{\gridSetup}
+% \cmd{\gridSetup}\oarg{gridunitname}\marg{gridunit}\marg{labelfactor}^^A
+% \marg{griddelta} \marg{gridDelta}\marg{gap}. For details see the
+% implementation section.\par\clearpage
+% \DescribeMacro{\AtPageUpperLeft}
+% \DescribeMacro{\AtPageLowerLeft}
+% \DescribeMacro{\AtPageCenter}
+% \DescribeMacro{\AtTextUpperLeft}
+% \DescribeMacro{\AtTextLowerLeft}
+% \DescribeMacro{\AtTextCenter}
+% \DescribeMacro{\AtStockUpperLeft}
+% \DescribeMacro{\AtStockLowerLeft}
+% \DescribeMacro{\AtStockCenter}
+% Helper macros for easier positioning on the page.
+%
+% \subsection{Package options}
+% \begin{center}
+% \begin{tabular}{@{}>{\ttfamily}llp{.5\textwidth}@{}}
+% \textnormal{Option} & Value & Comments \\ \hline
+% pscoord & empty or \textit{true}, \textit{false} & The zero point of
+% the coordinate system is the lower left corner of the page
+% (the default). \\
+% texcoord & empty or \textit{true}, \textit{false} & The zero point of
+% the coordinate system is the upper left corner of the page. \\
+% grid & empty or \textit{true}, \textit{false} & A grid is drawing;
+% default: false. \\
+% gridBG & empty or \textit{true}, \textit{false} & Put the grid in the
+% background; default: false.\\
+% gridunit & \textit{mm}, \textit{in}, \textit{bp}, \textit{pt} & Distance
+% between gridlines are multiples of \texttt{gridunit}. default: mm.\\
+% gridcolor & a valid color name & Color of the main gridlines;
+% default: black \\
+% subgridcolor & a valid color name & Color of the subgridlines;
+% default: black. \\
+% subgridstyle & \textit{solid} or \textit{dotted} & `dotted' is very slow!
+% default: solid. \\
+% colorgrid & empty or \textit{true}, \textit{false} & Shortcut for
+% `grid=true', `gridcolor=red' and `subgridcolor=green';
+% default: false.\\
+% dvips & empty or \textit{true}, \textit{false} & Is also true
+% if the package option \texttt{dvips} is
+% used by \pkgname{color} or \pkgname{graphics}. If true package
+% \pkgname{eepic} is loaded for better performance of dotted lines.
+%
+% \end{tabular}
+% \end{center}
+%
+% \StopEventually{\PrintChanges\PrintIndex}
+%
+% \section{Implementation}
+%
+% \subsection{The main functionality}
+%
+% \begin{macrocode}
+\RequirePackage{atbegshi}
+% \end{macrocode}
+% \begin{macro}{\LenToUnit}
+% \changes{v1.0d}{2006/07/14}{Using \cmd{\providecommand} instead of
+% \cmd{\newcommand} for \cmd{\LenToUnit}}
+% \changes{v2.0f}{2015/07/14}{Changed definition for better compatibility
+% with package \pkgname{curve2e} suggested by Claudio Beccari.}
+% \begin{macrocode}
+\providecommand*\LenToUnit[1]{\strip@pt\dimexpr#1*\p@/\unitlength}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ESO@isMEMOIR}
+% Support for the \clsname{memoir} class.
+% \begin{macrocode}
+\newcommand\ESO@isMEMOIR[2]{#2}
+\@ifclassloaded{memoir}{\renewcommand\ESO@isMEMOIR[2]{#1}}{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AtPageUpperLeft}
+% \begin{macrocode}
+\newcommand\AtPageUpperLeft[1]{%
+ \put(0,\LenToUnit{-\ESO@yoffsetI}){#1}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AtPageLowerLeft}
+% \begin{macrocode}
+\newcommand\AtPageLowerLeft[1]{\AtPageUpperLeft{%
+ \put(0,\LenToUnit{-\paperheight}){#1}}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AtPageCenter}
+% \begin{macrocode}
+\newcommand\AtPageCenter[1]{\AtPageUpperLeft{%
+ \put(\LenToUnit{.5\paperwidth},\LenToUnit{-.5\paperheight}){#1}}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AtStockLowerLeft}
+% \changes{v2.0a}{2009/10/07}{New}
+% \begin{macrocode}
+\newcommand\AtStockLowerLeft{}
+\ESO@isMEMOIR{%
+ \renewcommand\AtStockLowerLeft[1]{%
+ \begingroup
+ \@tempdima=-\stockwidth
+ \advance\@tempdima\trimedge
+ \advance\@tempdima\paperwidth
+ \if@twoside\ifodd\c@page\else
+ \@tempdima=-\trimedge
+ \fi\fi
+ \@tempdimb=-\stockheight
+ \advance\@tempdimb\paperheight
+ \advance\@tempdimb\trimtop
+ \AtPageLowerLeft{%
+ \put(\LenToUnit{\@tempdima},\LenToUnit{\@tempdimb}){#1}%
+ }%
+ \endgroup
+ }
+}{%
+ \let\AtStockLowerLeft=\AtPageLowerLeft
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AtStockUpperLeft}
+% \changes{v2.0a}{2009/10/07}{New}
+% \begin{macrocode}
+\newcommand\AtStockUpperLeft{}
+\ESO@isMEMOIR{%
+ \renewcommand\AtStockUpperLeft[1]{%
+ \AtStockLowerLeft{%
+ \put(0,\LenToUnit{\stockheight}){#1}%
+ }%
+ }%
+}{%
+ \let\AtStockUpperLeft=\AtPageUpperLeft
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AtStockCenter}
+% \changes{v2.0a}{2009/10/07}{New}
+% \begin{macrocode}
+\newcommand\AtStockCenter{}
+\ESO@isMEMOIR{%
+ \renewcommand\AtStockCenter[1]{%
+ \AtStockLowerLeft{%
+ \put(\LenToUnit{.5\stockwidth},\LenToUnit{.5\stockheight}){#1}%
+ }%
+ }%
+}{%
+ \let\AtStockCenter=\AtPageCenter
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AtTextUpperLeft}
+% \changes{v2.0a}{2009/10/07}{Works now for class \clsname{memoir}}
+% \changes{v2.0e}{2014/04/20}{Wrong horizontal position in one-column mode}
+% \begin{macrocode}
+\ESO@isMEMOIR{%
+ \newcommand\AtTextUpperLeft[1]{%
+ \begingroup
+ \ifodd\c@page
+ \@tempdima=\spinemargin
+ \else
+ \@tempdima=\paperwidth
+ \advance\@tempdima-\textwidth
+ \advance\@tempdima-\spinemargin
+ \fi
+ \@tempdimb=-\uppermargin
+ \AtPageUpperLeft{%
+ \put(\LenToUnit{\@tempdima},\LenToUnit{\@tempdimb}){#1}%
+ }%
+ \endgroup
+ }
+}{%
+ \newcommand\AtTextUpperLeft[1]{%
+ \begingroup
+ \@tempdima=1in\relax
+ \if@twoside
+ \ifodd\c@page
+ \advance\@tempdima\oddsidemargin
+ \else
+ \advance\@tempdima\evensidemargin
+ \fi
+ \else
+ \advance\@tempdima\oddsidemargin
+ \fi
+ \@tempdimb=-1in\relax
+ \advance\@tempdimb-\topmargin
+ \advance\@tempdimb-\headheight
+ \advance\@tempdimb-\headsep
+ \AtPageUpperLeft{%
+ \put(\LenToUnit{\@tempdima},\LenToUnit{\@tempdimb}){#1}%
+ }%
+ \endgroup
+ }
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AtTextLowerLeft}
+% \begin{macrocode}
+\newcommand\AtTextLowerLeft[1]{\AtTextUpperLeft{%
+ \put(0,\LenToUnit{-\textheight}){#1}}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AtTextCenter}
+% \begin{macrocode}
+\newcommand\AtTextCenter[1]{\AtTextUpperLeft{%
+ \put(\LenToUnit{.5\textwidth},\LenToUnit{-.5\textheight}){#1}}}
+% \end{macrocode}
+% \end{macro}
+% \DescribeMacro{\ESO@HookIBG}\DescribeMacro{\ESO@HookIIBG}
+% \DescribeMacro{\ESO@HookIIIBG}\DescribeMacro{\ESO@HookIFG}
+% \DescribeMacro{\ESO@HookIIFG}\DescribeMacro{\ESO@HookIIIFG}
+% \changes{v2.0g}{2015/07/21}{New macro \cmd{\ESO@HookIIIFG} for foreground grid.}
+% \begin{macrocode}
+\newcommand{\ESO@HookIBG}{}
+\newcommand{\ESO@HookIIBG}{}
+\newcommand{\ESO@HookIIIBG}{}
+\newcommand{\ESO@HookIFG}{}
+\newcommand{\ESO@HookIIFG}{}
+\newcommand{\ESO@HookIIIFG}{}
+\newcommand{\ESO@HookI}{}
+\newcommand{\ESO@HookII}{}
+\newcommand{\ESO@HookIII}{}
+\let\ESO@HookI=\ESO@HookIBG
+\let\ESO@HookII=\ESO@HookIIBG
+\let\ESO@HookIII=\ESO@HookIIIBG
+% \end{macrocode}
+% \begin{macro}{\AddToShipoutPictureBG}
+% \begin{macro}{\AddToShipoutPictureFG}
+% \changes{v2.0b}{2010/06/08}{New command \cmd{\AddToShipoutPictureFG}}
+% \begin{macrocode}
+\newcommand{\AddToShipoutPictureBG}{%
+ \@ifstar{\g@addto@macro\ESO@HookIIBG}{\g@addto@macro\ESO@HookIBG}}
+\newcommand{\AddToShipoutPicture}{}
+\let\AddToShipoutPicture=\AddToShipoutPictureBG
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\AddToShipoutPictureFG}
+% \begin{macrocode}
+\newcommand{\AddToShipoutPictureFG}{%
+ \@ifstar{\g@addto@macro\ESO@HookIIFG}{\g@addto@macro\ESO@HookIFG}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ClearShipoutPictureBG}
+% \begin{macro}{\ClearShipoutPicture}
+% \begin{macro}{\ClearShipoutPictureFG}
+% \changes{v1.0a}{2002/10/07}{Changed \cmd{\let} to
+% \cmd{\global}\cmd{\let} (suggested by Alberto Lusiani).}
+% \begin{macrocode}
+\newcommand{\ClearShipoutPictureBG}{\global\let\ESO@HookIBG\@empty}
+\newcommand{\ClearShipoutPicture}{}
+\let\ClearShipoutPicture=\ClearShipoutPictureBG
+\newcommand{\ClearShipoutPictureFG}{\global\let\ESO@HookIFG\@empty}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\AtBeginShipout}
+% \begin{macro}{\AtBeginShipoutUpperLeft}
+% \begin{macro}{\AtBeginShipoutUpperLeftForeground}
+% (see package \pkgname{atbegshi})
+% \changes{v2.0c}{2010/10/06}{bugfix for memoir class
+% (reported by YI Hoze)}
+% \begin{macrocode}
+\ESO@isMEMOIR{%
+ \AtBeginShipout{%
+ \@tempdima=-\trimedge
+ \advance\@tempdima-\paperwidth
+ \advance\@tempdima\stockwidth
+ \if@twoside\ifodd\c@page\else
+ \advance\@tempdima2\trimedge
+ \advance\@tempdima\paperwidth
+ \advance\@tempdima-\stockwidth
+ \fi\fi
+ \@tempdimb=\ESO@yoffsetI
+ \advance\@tempdimb-\trimtop
+ \nointerlineskip
+ \AtBeginShipoutUpperLeft{%
+ \put(\LenToUnit{\@tempdima},\LenToUnit{\@tempdimb}){%
+ \ESO@HookIIIBG\ESO@HookIBG\ESO@HookIIBG
+ \global\let\ESO@HookIIBG\@empty
+ }%
+ }%
+ \AtBeginShipoutUpperLeftForeground{%
+ \put(\LenToUnit{\@tempdima},\LenToUnit{\@tempdimb}){%
+ \ESO@HookIFG\ESO@HookIIFG\ESO@HookIIIFG
+ \global\let\ESO@HookIIFG\@empty
+ }%
+ }%
+ }
+}{%
+ \AtBeginShipout{%
+ \nointerlineskip
+ \AtBeginShipoutUpperLeft{%
+ \put(0,\LenToUnit{\ESO@yoffsetI}){%
+ \ESO@HookIIIBG\ESO@HookIBG\ESO@HookIIBG
+ \global\let\ESO@HookIIBG\@empty
+ }%
+ }%
+ \AtBeginShipoutUpperLeftForeground{%
+ \put(0,\LenToUnit{\ESO@yoffsetI}){%
+ \ESO@HookIFG\ESO@HookIIFG\ESO@HookIIIFG
+ \global\let\ESO@HookIIFG\@empty
+ }%
+ }%
+ }
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \subsection{The background grid}
+% \begin{macrocode}
+\RequirePackage{keyval}
+% \end{macrocode}
+% Initialising some macros
+% \changes{v2.0g}{2015/07/21}{New \cmd{\ifESO@gridBG} for foreground/background grid.}
+% \begin{macrocode}
+\newif\ifESO@dvips\ESO@dvipsfalse \newif\ifESO@grid\ESO@gridfalse
+\newif\ifESO@texcoord\ESO@texcoordfalse \newif\ifESO@gridBG\ESO@gridBGfalse
+\newcommand*\ESO@gridunitname{}
+\newcommand*\ESO@gridunit{}
+\newcommand*\ESO@labelfactor{}
+\newcommand*\ESO@griddelta{}\newcommand*\ESO@griddeltaY{}
+\newcommand*\ESO@gridDelta{}\newcommand*\ESO@gridDeltaY{}
+\newcommand*\ESO@gridcolor{}
+\newcommand*\ESO@subgridcolor{}
+\newcommand*\ESO@subgridstyle{dotted}% ???
+\newcommand*\ESO@gap{}
+\newcommand*\ESO@yoffsetI{}\newcommand*\ESO@yoffsetII{}
+\newcommand*\ESO@gridlines{\thinlines}
+\newcommand*\ESO@subgridlines{\thinlines}
+\newcommand*\ESO@hline[1]{\ESO@subgridlines\line(1,0){#1}}
+\newcommand*\ESO@vline[1]{\ESO@subgridlines\line(0,1){#1}}
+\newcommand*\ESO@Hline[1]{\ESO@gridlines\line(1,0){#1}}
+\newcommand*\ESO@Vline[1]{\ESO@gridlines\line(0,1){#1}}
+\newcommand\ESO@fcolorbox[3]{\fbox{#3}}
+\newcommand\ESO@color[1]{}
+\newcommand\ESO@colorbox[2]{%
+ \begingroup
+ \fboxrule=\z@\fbox{#2}%
+ \endgroup
+}
+% \end{macrocode}
+% \begin{macro}{\gridSetup}
+% \begin{macrocode}
+\newcommand\gridSetup[6][]{%
+ \edef\ESO@gridunitname{#1}\edef\ESO@gridunit{#2}
+ \edef\ESO@labelfactor{#3}\edef\ESO@griddelta{#4}
+ \edef\ESO@gridDelta{#5}\edef\ESO@gap{#6}}
+% \end{macrocode}
+% \end{macro}
+% All the key-value options
+% \changes{v2.0g}{2015/07/21}{New option `gridBG'.}
+% \begin{macrocode}
+\define@key{ESO}{texcoord}[true]{\csname ESO@texcoord#1\endcsname}
+\define@key{ESO}{pscoord}[true]{\csname @tempswa#1\endcsname
+ \if@tempswa\ESO@texcoordfalse\else\ESO@texcoordtrue\fi}
+\define@key{ESO}{dvips}[true]{\csname ESO@dvips#1\endcsname}
+\define@key{ESO}{grid}[true]{\csname ESO@grid#1\endcsname
+ \setkeys{ESO}{gridcolor=black,subgridcolor=black}}
+\define@key{ESO}{gridBG}[true]{\csname ESO@gridBG#1\endcsname}
+\define@key{ESO}{colorgrid}[true]{\csname ESO@grid#1\endcsname
+ \setkeys{ESO}{gridcolor=red,subgridcolor=green}}
+\define@key{ESO}{gridcolor}{\def\ESO@gridcolor{#1}}
+\define@key{ESO}{subgridcolor}{\def\ESO@subgridcolor{#1}}
+\define@key{ESO}{subgridstyle}{\def\ESO@subgridstyle{#1}}%
+\define@key{ESO}{gridunit}{%
+ \def\@tempa{#1}
+ \def\@tempb{bp}
+ \ifx\@tempa\@tempb
+ \gridSetup[\@tempa]{1bp}{1}{10}{50}{2}
+ \else
+ \def\@tempb{pt}
+ \ifx\@tempa\@tempb
+ \gridSetup[\@tempa]{\p@}{1}{10}{50}{2}
+ \else
+ \def\@tempb{in}
+ \ifx\@tempa\@tempb
+ \gridSetup[\@tempa]{.1in}{.1}{2}{10}{.5}
+ \else
+ \gridSetup[mm]{1mm}{1}{5}{20}{1}
+ \fi
+ \fi
+ \fi
+}
+\setkeys{ESO}{subgridstyle=solid,pscoord=true,gridunit=mm}
+% \end{macrocode}
+% \changes{v2.0h}{2018/04/12}{\cmd\@classoptionslist must not be \cmd\relax}
+% \begin{macrocode}
+\providecommand*\@classoptionslist{}
+% \end{macrocode}
+% \begin{macro}{\ProcessOptionsWithKV}
+% This macro can process package options using `key=value' syntax.
+% \begin{macrocode}
+\def\ProcessOptionsWithKV#1{%
+ \let\@tempc\@empty
+ \@for\CurrentOption:=\@classoptionslist\do{%
+ \@ifundefined{KV@#1@\CurrentOption}%
+ {}{\edef\@tempc{\@tempc,\CurrentOption,}}}%
+ \edef\@tempc{%
+ \noexpand\setkeys{#1}{\@tempc\@ptionlist{\@currname.\@currext}}}%
+ \@tempc
+ \AtEndOfPackage{\let\@unprocessedoptions\relax}}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\ProcessOptionsWithKV{ESO}%
+% \end{macrocode}
+% \begin{macro}{\ESO@div}
+% Divides length |#1| by |#2| \(\times\) \cmd{\ESO@gridunit} and adds one.
+% Result is in \cmd{\@tempcnta}.
+% \begin{macrocode}
+\newcommand\ESO@div[2]{%
+ \@tempdima=#1\relax\@tempdimb=\ESO@gridunit\relax
+ \@tempdimb=#2\@tempdimb\divide\@tempdima by \@tempdimb
+ \@tempcnta\@tempdima\advance\@tempcnta\@ne}
+% \end{macrocode}
+% \end{macro}
+% \changes{v1.1c}{2005/12/24}{Remove the disadvantageous check of
+% `pdfTeX'. Now using with Xe\LaTeX\ should be possible.}
+% \changes{v2.0a}{2009/10/07}{Better test of color/xcolor}
+% \changes{v2.0d}{2013/10/06}{Improved color commands}
+% \begin{macrocode}
+\@ifundefined{colorbox}{%
+ \IfFileExists{xcolor.sty}{\RequirePackage{xcolor}}%
+ {\RequirePackage{color}}%
+}{}%
+\let\ESO@color=\color
+\renewcommand\ESO@colorbox[2]{%
+ \begingroup
+ \fboxsep=.4ex %
+ \colorbox{#1}{#2}%
+ \endgroup
+}
+\renewcommand\ESO@fcolorbox[3]{%
+ \begingroup
+ \fboxsep=.5ex %
+ \fcolorbox{#1}{#2}{#3}%
+ \endgroup
+}
+\AtBeginDocument{%
+ \ESO@dvipsfalse
+ \@ifundefined{Gin@driver}{}%
+ {%
+ \ifx\Gin@driver\@empty\else%
+ \filename@parse{\Gin@driver}\def\reserved@a{dvips}%
+ \ifx\filename@base\reserved@a\ESO@dvipstrue\fi
+ \fi
+ }%
+ \ifESO@dvips\def\@tempb{eepic}\else\def\@tempb{epic}\fi
+ \def\@tempa{dotted}%\def\ESO@gap{\LenToUnit{6\@wholewidth}}%
+ \ifx\@tempa\ESO@subgridstyle
+ \IfFileExists{\@tempb.sty}%
+ {%
+ \RequirePackage{\@tempb}
+ \renewcommand*\ESO@hline[1]{\ESO@subgridlines\dottedline{\ESO@gap}%
+ (0,0)(##1,0)}
+ \renewcommand*\ESO@vline[1]{\ESO@subgridlines\dottedline{\ESO@gap}%
+ (0,0)(0,##1)}
+ }{}
+ \else
+ \ifx\ESO@gridcolor\ESO@subgridcolor
+ \renewcommand*\ESO@gridlines{\thicklines}
+ \fi
+ \fi
+}
+\ifESO@texcoord
+ \def\ESO@yoffsetI{\z@}\def\ESO@yoffsetII{-\paperheight}
+ \edef\ESO@griddeltaY{-\ESO@griddelta}\edef\ESO@gridDeltaY{-\ESO@gridDelta}
+\else
+ \def\ESO@yoffsetI{-\paperheight}\def\ESO@yoffsetII{\z@}
+ \edef\ESO@griddeltaY{\ESO@griddelta}\edef\ESO@gridDeltaY{\ESO@gridDelta}
+\fi
+% \end{macrocode}
+% \begin{macro}{\ESO@gridpicture}
+% \begin{macrocode}
+\newcommand\ESO@gridpicture{%
+ \begingroup
+ \setlength\unitlength{\ESO@gridunit}%
+ \ESO@color{\ESO@subgridcolor}%
+% \end{macrocode}
+% --- horizontal subgrid lines ---
+% \begin{macrocode}
+ \ESO@div{\paperheight}{\ESO@griddelta}%
+ \multiput(0,0)(0,\ESO@griddeltaY){\@tempcnta}%
+ {\ESO@hline{\LenToUnit{\paperwidth}}}%
+% \end{macrocode}
+% --- vertical subgrid lines ---
+% \begin{macrocode}
+ \ESO@div{\paperwidth}{\ESO@griddelta}%
+ \multiput(0,\LenToUnit{\ESO@yoffsetII})(\ESO@griddelta,0){\@tempcnta}%
+ {\ESO@vline{\LenToUnit{\paperheight}}}%
+ \ESO@color{\ESO@gridcolor}%
+% \end{macrocode}
+% --- horizontal grid lines ---
+% \begin{macrocode}
+ \ESO@div{\paperheight}{\ESO@gridDelta}%
+ \multiput(0,0)(0,\ESO@gridDeltaY){\@tempcnta}%
+ {\ESO@Hline{\LenToUnit{\paperwidth}}}%
+% \end{macrocode}
+% --- vertical grid lines ---
+% \begin{macrocode}
+ \ESO@div{\paperwidth}{\ESO@gridDelta}%
+ \multiput(0,\LenToUnit{\ESO@yoffsetII})(\ESO@gridDelta,0){\@tempcnta}%
+ {\ESO@Vline{\LenToUnit{\paperheight}}}%
+% \end{macrocode}
+% --- horizontal numbers ---
+% \changes{v1.1a}{2002/11/09}{Font setting added.}
+% \begin{macrocode}
+ \fontsize{10}{12}\normalfont%
+ \ESO@div{\paperwidth}{\ESO@gridDelta}%
+ \multiput(0,\ESO@gridDeltaY)(\ESO@gridDelta,0){\@tempcnta}{%
+ \@tempcntb=\@tempcnta\advance\@tempcntb-\@multicnt
+ \ifnum\@tempcntb>1\relax
+ \multiply\@tempcntb by \ESO@gridDelta\relax
+ \@tempdima=\@tempcntb sp\@tempdima=\ESO@labelfactor\@tempdima
+ \@tempcntb=\@tempdima%
+ \makebox(0,0)[c]{\ESO@colorbox{white}{\the\@tempcntb}}%
+ \fi}%
+% \end{macrocode}
+% --- vertical numbers ---
+% \begin{macrocode}
+ \ifx\ESO@gridunitname\@empty\def\@tempa{0}\else\def\@tempa{1}\fi
+ \ESO@div{\paperheight}{\ESO@gridDelta}%
+ \multiput(\ESO@gridDelta,0)(0,\ESO@gridDeltaY){\@tempcnta}{%
+ \@tempcntb=\@tempcnta\advance\@tempcntb-\@multicnt%
+ \ifnum\@tempcntb>\@tempa\relax
+ \multiply\@tempcntb by \ESO@gridDelta\relax%
+ \@tempdima=\@tempcntb sp\@tempdima=\ESO@labelfactor\@tempdima
+ \@tempcntb=\@tempdima
+ \makebox(0,0)[c]{\ESO@colorbox{white}{\the\@tempcntb}}%
+ \fi
+ }%
+% \end{macrocode}
+% --- the unit label ---
+% \begin{macrocode}
+ \ifx\ESO@gridunitname\@empty\else
+ \thicklines\fboxrule=\@wholewidth
+ \put(\ESO@gridDelta,\ESO@gridDeltaY){\makebox(0,0)[c]{%
+ \ESO@fcolorbox{\ESO@gridcolor}{white}{%
+ \textbf{\ESO@gridunitname}}}}%
+ \fi
+ \normalcolor%
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+% Add the grid to the shipout picture (\cmd{\ESO@HookIIIFG} or
+% \cmd{\ESO@HookIIIBG}) is independed from the user commands
+% \cmd{\AddToShipoutPictureBG} and \cmd{\AddToShipoutPictureBG*}).
+% \changes{v2.0d}{2013/10/06}{grid should be in foreground}
+% \changes{v2.0g}{2015/07/21}{Foreground/background grid.}
+% \begin{macrocode}
+\ifESO@grid
+ \ifESO@gridBG
+ \g@addto@macro\ESO@HookIIIBG{\ESO@gridpicture}%
+ \else
+ \g@addto@macro\ESO@HookIIIFG{\ESO@gridpicture}%
+ \fi
+\fi
+% \end{macrocode}
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/eso-pic/eso-pic.ins b/macros/latex/contrib/eso-pic/eso-pic.ins
new file mode 100644
index 0000000000..d4cd5bc1e9
--- /dev/null
+++ b/macros/latex/contrib/eso-pic/eso-pic.ins
@@ -0,0 +1,47 @@
+
+\input docstrip
+
+\preamble
+
+Copyright (C) 1998-2015
+Rolf Niepraschk <Rolf.Niepraschk@gmx.de>
+
+This file may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) 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 2003/12/01 or later.
+
+This work has the LPPL maintenance status "author-maintained".
+
+\endpreamble
+
+\keepsilent
+\askforoverwritefalse
+
+\usedir{tex/latex/contrib/eso-pic}
+
+\generate{
+ \file{eso-pic.sty}{\from{eso-pic.dtx}{package}}
+}
+
+\obeyspaces
+\Msg{*************************************************************}
+\Msg{* *}
+\Msg{* To finish the installation you have to move the following *}
+\Msg{* file into a directory searched by TeX: *}
+\Msg{* *}
+\Msg{* eso-pic.sty *}
+\Msg{* *}
+\Msg{* To produce the documentation run the file eso-pic.dtx *}
+\Msg{* through LaTeX. *}
+\Msg{* *}
+\Msg{* Happy TeXing! *}
+\Msg{* *}
+\Msg{*************************************************************}
+
+\endbatchfile
diff --git a/macros/latex/contrib/eso-pic/eso-pic.pdf b/macros/latex/contrib/eso-pic/eso-pic.pdf
new file mode 100644
index 0000000000..53c9ba100b
--- /dev/null
+++ b/macros/latex/contrib/eso-pic/eso-pic.pdf
Binary files differ
diff --git a/macros/latex/contrib/eso-pic/showframe.sty b/macros/latex/contrib/eso-pic/showframe.sty
new file mode 100644
index 0000000000..5bc0366f10
--- /dev/null
+++ b/macros/latex/contrib/eso-pic/showframe.sty
@@ -0,0 +1,68 @@
+
+% Rolf Niepraschk -- Rolf.Niepraschk@gmx.de
+
+% showframe.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 (at your option) 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 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "author-maintained".
+
+% Draws visible frames for the text and margin area, and lines
+% for the head and foot to check layout in detail. Using the package
+% option "noframe" you can draw the frames later only for a single
+% page with \AddToShipoutPicture*{\ShowFramePicture}. Another useful
+% options maybe eso-pic's "colorgrid", "grid" and "texcoord".
+%
+% \ShowFrameColor and \ShowFrameLinethickness can be used to change
+% the frames.
+
+\ProvidesPackage{showframe}[2011/02/24 v0.1i showframe (new impl., RN)]
+
+\newif\ifSF@frame\SF@frametrue
+
+\DeclareOption{noframe}{\SF@framefalse}
+\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{eso-pic}}
+\ProcessOptions\relax
+
+\RequirePackage{eso-pic}[2002/10/30]
+
+\newcommand*\ShowFrameColor{\normalcolor}
+\newcommand*\ShowFrameLinethickness{.8pt}
+
+\newcommand\ShowFramePicture{%
+ \begingroup
+ \ShowFrameColor\linethickness{\ShowFrameLinethickness}%
+ \AtPageLowerLeft{%
+ \framebox(\LenToUnit{\paperwidth},\LenToUnit{\paperheight}){}}%
+ \AtTextLowerLeft{%
+ \framebox(\LenToUnit{\textwidth},\LenToUnit{\textheight}){}}%
+ \AtTextUpperLeft{%
+ \put(0,\LenToUnit{\headsep}){%
+ \framebox(\LenToUnit{\textwidth},\LenToUnit{\headheight}){}}}%
+ \AtTextLowerLeft{%
+ \put(0,\LenToUnit{-\footskip}){%
+ \line(1,0){\LenToUnit{\textwidth}}}}%
+ \AtTextLowerLeft{%
+ \@tempdima=\textwidth\advance\@tempdima\marginparsep%
+ \if@twoside
+ \ifodd\c@page\else
+ \if@mparswitch
+ \@tempdima=-\marginparsep\advance\@tempdima-\marginparwidth
+ \fi
+ \fi
+ \fi
+ \put(\LenToUnit{\@tempdima},0)%
+ {\framebox(\LenToUnit{\marginparwidth},\LenToUnit{\textheight}){}}%
+ }%
+ \endgroup
+}
+
+\ifSF@frame\AddToShipoutPictureFG{\ShowFramePicture}\fi
+
+\endinput