Debian Codegraph @

texmf-dist/tex/latex/eso-pic/eso-pic.sty

raw
1 %%
2 %% This is file `eso-pic.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% eso-pic.dtx (with options: `package')
8 %%
9 %% Copyright (C) 1998-2015
10 %% Rolf Niepraschk <[email protected]>
11 %%
12 %% This file may be distributed and/or modified under the
13 %% conditions of the LaTeX Project Public License, either version 1.3
14 %% of this license or (at your option) any later version.
15 %% The latest version of this license is in:
16 %%
17 %% http://www.latex-project.org/lppl.txt
18 %%
19 %% and version 1.3 or later is part of all distributions of LaTeX
20 %% version 2003/12/01 or later.
21 %%
22 %% This work has the LPPL maintenance status "author-maintained".
23 %%
24 \NeedsTeXFormat{LaTeX2e}[2020/10/01]
25 \ProvidesPackage{eso-pic}
26 [2025/12/10 v3.0d eso-pic (RN)]
27 \providecommand*\LenToUnit[1]{#1}
28 \newdimen\ESO@tempdima
29 \newdimen\ESO@tempdimb
30 \newcommand\ESO@isMEMOIR[2]{#2}
31 \@ifclassloaded{memoir}{\renewcommand\ESO@isMEMOIR[2]{#1}}{}
32 \newcommand\AtPageUpperLeft[1]{%
33 \put(0,-\ESO@yoffsetI){#1}%
34 }
35 \newcommand\AtPageLowerLeft[1]{\AtPageUpperLeft{%
36 \put(0,-\paperheight){#1}}}
37 \newcommand\AtPageCenter[1]{\AtPageUpperLeft{%
38 \put(.5\paperwidth,-.5\paperheight){#1}}%
39 }
40 \newcommand\AtStockLowerLeft{}
41 \ESO@isMEMOIR{%
42 \renewcommand\AtStockLowerLeft[1]{%
43 \begingroup
44 \ESO@tempdima=-\stockwidth
45 \advance\ESO@tempdima\trimedge
46 \advance\ESO@tempdima\paperwidth
47 \if@twoside\ifodd\c@page\else
48 \ESO@tempdima=-\trimedge
49 \fi\fi
50 \ESO@tempdimb=-\stockheight
51 \advance\ESO@tempdimb\paperheight
52 \advance\ESO@tempdimb\trimtop
53 \AtPageLowerLeft{%
54 \put(\ESO@tempdima,\ESO@tempdimb){#1}%
55 }%
56 \endgroup
57 }
58 }{%
59 \let\AtStockLowerLeft=\AtPageLowerLeft
60 }
61 \newcommand\AtStockUpperLeft{}
62 \ESO@isMEMOIR{%
63 \renewcommand\AtStockUpperLeft[1]{%
64 \AtStockLowerLeft{%
65 \put(0,\stockheight){#1}%
66 }%
67 }%
68 }{%
69 \let\AtStockUpperLeft=\AtPageUpperLeft
70 }
71 \newcommand\AtStockCenter{}
72 \ESO@isMEMOIR{%
73 \renewcommand\AtStockCenter[1]{%
74 \AtStockLowerLeft{%
75 \put(.5\stockwidth,.5\stockheight){#1}%
76 }%
77 }%
78 }{%
79 \let\AtStockCenter=\AtPageCenter
80 }
81 \ESO@isMEMOIR{%
82 \newcommand\AtTextUpperLeft[1]{%
83 \begingroup
84 \if@twoside
85 \ifodd\c@page
86 \ESO@tempdima=\spinemargin
87 \else
88 \ESO@tempdima=\paperwidth
89 \advance\ESO@tempdima-\textwidth
90 \advance\ESO@tempdima-\spinemargin
91 \fi
92 \else
93 \ESO@tempdima=\spinemargin
94 \fi
95 \ESO@tempdimb=-\uppermargin
96 \AtPageUpperLeft{%
97 \put(\ESO@tempdima,\ESO@tempdimb){#1}%
98 }%
99 \endgroup
100 }%
101 }{%
102 \newcommand\AtTextUpperLeft[1]{%
103 \begingroup
104 \ESO@tempdima=1in\relax
105 \if@twoside
106 \ifodd\c@page
107 \advance\ESO@tempdima\oddsidemargin
108 \else
109 \advance\ESO@tempdima\evensidemargin
110 \fi
111 \else
112 \advance\ESO@tempdima\oddsidemargin
113 \fi
114 \ESO@tempdimb=-1in\relax
115 \advance\ESO@tempdimb-\topmargin
116 \advance\ESO@tempdimb-\headheight
117 \advance\ESO@tempdimb-\headsep
118 \AtPageUpperLeft{%
119 \put(\ESO@tempdima,\ESO@tempdimb){#1}%
120 }%
121 \endgroup
122 }
123 }
124 \newcommand\AtTextLowerLeft[1]{\AtTextUpperLeft{%
125 \put(0,-\textheight){#1}}}
126 \newcommand\AtTextCenter[1]{\AtTextUpperLeft{%
127 \put(.5\textwidth,-.5\textheight){#1}}}
128 \newcommand{\ESO@HookIBG}{}
129 \newcommand{\ESO@HookIIBG}{}
130 \newcommand{\ESO@HookIIIBG}{}
131 \newcommand{\ESO@HookIFG}{}
132 \newcommand{\ESO@HookIIFG}{}
133 \newcommand{\ESO@HookIIIFG}{}
134 \newcommand{\ESO@HookI}{}
135 \newcommand{\ESO@HookII}{}
136 \newcommand{\ESO@HookIII}{}
137 \let\ESO@HookI=\ESO@HookIBG
138 \let\ESO@HookII=\ESO@HookIIBG
139 \let\ESO@HookIII=\ESO@HookIIIBG
140 \newcommand{\AddToShipoutPictureBG}{%
141 \@ifstar{\g@addto@macro\ESO@HookIIBG}{\g@addto@macro\ESO@HookIBG}}
142 \newcommand{\AddToShipoutPicture}{}
143 \let\AddToShipoutPicture=\AddToShipoutPictureBG
144 \newcommand{\AddToShipoutPictureFG}{%
145 \@ifstar{\g@addto@macro\ESO@HookIIFG}{\g@addto@macro\ESO@HookIFG}}
146 \newcommand{\ClearShipoutPictureBG}{\global\let\ESO@HookIBG\@empty}
147 \newcommand{\ClearShipoutPicture}{}
148 \let\ClearShipoutPicture=\ClearShipoutPictureBG
149 \newcommand{\ClearShipoutPictureFG}{\global\let\ESO@HookIFG\@empty}
150 \ESO@isMEMOIR{%
151 \newcommand*\ESO@MEMOIR@corr{%
152 \ESO@tempdima=-\trimedge
153 \advance\ESO@tempdima-\paperwidth
154 \advance\ESO@tempdima\stockwidth
155 \if@twoside\ifodd\c@page\else
156 \advance\ESO@tempdima2\trimedge
157 \advance\ESO@tempdima\paperwidth
158 \advance\ESO@tempdima-\stockwidth
159 \fi\fi
160 \ESO@tempdimb=\ESO@yoffsetI
161 \advance\ESO@tempdimb-\trimtop
162 }
163 \AddToHook{shipout/background}{%
164 \ESO@MEMOIR@corr
165 \put(\ESO@tempdima,\ESO@tempdimb){%
166 \ESO@HookIIIBG\ESO@HookIBG\ESO@HookIIBG
167 \global\let\ESO@HookIIBG\@empty
168 }%
169 }%
170 \AddToHook{shipout/foreground}{%
171 \ESO@MEMOIR@corr
172 \put(\ESO@tempdima,\ESO@tempdimb){%
173 \ESO@HookIFG\ESO@HookIIFG\ESO@HookIIIFG
174 \global\let\ESO@HookIIFG\@empty
175 }%
176 }%
177 }{%
178 \AddToHook{shipout/background}{%
179 \put(0,\ESO@yoffsetI){%
180 \ESO@HookIIIBG\ESO@HookIBG\ESO@HookIIBG
181 \global\let\ESO@HookIIBG\@empty
182 }%
183 }%
184 \AddToHook{shipout/foreground}{%
185 \put(0,\ESO@yoffsetI){%
186 \ESO@HookIFG\ESO@HookIIFG\ESO@HookIIIFG
187 \global\let\ESO@HookIIFG\@empty
188 }%
189 }%
190 }
191 \RequirePackage{keyval}
192 \newif\ifESO@dvips\ESO@dvipsfalse \newif\ifESO@grid\ESO@gridfalse
193 \newif\ifESO@texcoord\ESO@texcoordfalse \newif\ifESO@gridBG\ESO@gridBGfalse
194 \newcommand*\ESO@gridunitname{}
195 \newcommand*\ESO@gridunit{}
196 \newcommand*\ESO@labelfactor{}
197 \newcommand*\ESO@griddelta{}\newcommand*\ESO@griddeltaY{}
198 \newcommand*\ESO@gridDelta{}\newcommand*\ESO@gridDeltaY{}
199 \newcommand*\ESO@gridcolor{}
200 \newcommand*\ESO@subgridcolor{}
201 \newcommand*\ESO@subgridstyle{dotted}% ???
202 \newcommand*\ESO@gap{}
203 \newcommand*\ESO@yoffsetI{}\newcommand*\ESO@yoffsetII{}
204 \newcommand*\ESO@gridlines{\thinlines}
205 \newcommand*\ESO@subgridlines{\thinlines}
206 \newcommand*\ESO@hline[1]{\ESO@subgridlines\line(1,0){#1}}
207 \newcommand*\ESO@vline[1]{\ESO@subgridlines\line(0,1){#1}}
208 \newcommand*\ESO@Hline[1]{\ESO@gridlines\line(1,0){#1}}
209 \newcommand*\ESO@Vline[1]{\ESO@gridlines\line(0,1){#1}}
210 \newcommand\ESO@fcolorbox[3]{\fbox{#3}}
211 \newcommand\ESO@color[1]{}
212 \newcommand\ESO@colorbox[2]{%
213 \begingroup
214 \fboxrule=\z@\fbox{#2}%
215 \endgroup
216 }
217 \newcommand\gridSetup[6][]{%
218 \edef\ESO@gridunitname{#1}\edef\ESO@gridunit{#2}
219 \edef\ESO@labelfactor{#3}\edef\ESO@griddelta{#4}
220 \edef\ESO@gridDelta{#5}\edef\ESO@gap{#6}}
221 \define@key{ESO}{texcoord}[true]{\csname ESO@texcoord#1\endcsname}
222 \define@key{ESO}{pscoord}[true]{\csname @tempswa#1\endcsname
223 \if@tempswa\ESO@texcoordfalse\else\ESO@texcoordtrue\fi}
224 \define@key{ESO}{dvips}[true]{\csname ESO@dvips#1\endcsname}
225 \define@key{ESO}{grid}[true]{\csname ESO@grid#1\endcsname
226 \setkeys{ESO}{gridcolor=black,subgridcolor=black}}
227 \define@key{ESO}{gridBG}[true]{\csname ESO@gridBG#1\endcsname}
228 \define@key{ESO}{colorgrid}[true]{\csname ESO@grid#1\endcsname
229 \setkeys{ESO}{gridcolor=red,subgridcolor=green}}
230 \define@key{ESO}{gridcolor}{\def\ESO@gridcolor{#1}}
231 \define@key{ESO}{subgridcolor}{\def\ESO@subgridcolor{#1}}
232 \define@key{ESO}{subgridstyle}{\def\ESO@subgridstyle{#1}}%
233 \define@key{ESO}{gridunit}{%
234 \def\@tempa{#1}
235 \def\@tempb{bp}
236 \ifx\@tempa\@tempb
237 \gridSetup[\@tempa]{1bp}{1}{10}{50}{2}
238 \else
239 \def\@tempb{pt}
240 \ifx\@tempa\@tempb
241 \gridSetup[\@tempa]{\p@}{1}{10}{50}{2}
242 \else
243 \def\@tempb{in}
244 \ifx\@tempa\@tempb
245 \gridSetup[\@tempa]{.1in}{.1}{2}{10}{.5}
246 \else
247 \gridSetup[mm]{1mm}{1}{5}{20}{1}
248 \fi
249 \fi
250 \fi
251 }
252 \setkeys{ESO}{subgridstyle=solid,pscoord=true,gridunit=mm}
253 \providecommand*\@classoptionslist{}
254 \def\ProcessOptionsWithKV#1{%
255 \let\@tempc\@empty
256 \@for\CurrentOption:=\@classoptionslist\do{%
257 \@ifundefined{KV@#1@\CurrentOption}%
258 {}{\edef\@tempc{\@tempc,\CurrentOption,}}}%
259 \edef\@tempc{%
260 \noexpand\setkeys{#1}{\@tempc\@ptionlist{\@currname.\@currext}}}%
261 \@tempc
262 \AtEndOfPackage{\let\@unprocessedoptions\relax}}%
263 \ProcessOptionsWithKV{ESO}%
264 \newcommand\ESO@div[2]{%
265 \ESO@tempdima=#1\relax\ESO@tempdimb=\ESO@gridunit\relax
266 \ESO@tempdimb=#2\ESO@tempdimb\divide\ESO@tempdima by \ESO@tempdimb
267 \@tempcnta\ESO@tempdima\advance\@tempcnta\@ne}
268 \@ifundefined{colorbox}{%
269 \IfFileExists{xcolor.sty}{\RequirePackage{xcolor}}%
270 {\RequirePackage{color}}%
271 }{}%
272 \let\ESO@color=\color
273 \renewcommand\ESO@colorbox[2]{%
274 \begingroup
275 \fboxsep=.4ex %
276 \colorbox{#1}{#2}%
277 \endgroup
278 }
279 \renewcommand\ESO@fcolorbox[3]{%
280 \begingroup
281 \fboxsep=.5ex %
282 \fcolorbox{#1}{#2}{#3}%
283 \endgroup
284 }
285 \AtBeginDocument{%
286 \ESO@dvipsfalse
287 \@ifundefined{Gin@driver}{}%
288 {%
289 \ifx\Gin@driver\@empty\else%
290 \filename@parse{\Gin@driver}\def\reserved@a{dvips}%
291 \ifx\filename@base\reserved@a\ESO@dvipstrue\fi
292 \fi
293 }%
294 \ifESO@dvips\def\@tempb{eepic}\else\def\@tempb{epic}\fi
295 \def\@tempa{dotted}%\def\ESO@gap{6\@wholewidth}%
296 \ifx\@tempa\ESO@subgridstyle
297 \IfFileExists{\@tempb.sty}%
298 {%
299 \RequirePackage{\@tempb}
300 \renewcommand*\ESO@hline[1]{\ESO@subgridlines\dottedline{\ESO@gap}%
301 (0,0)(##1,0)}
302 \renewcommand*\ESO@vline[1]{\ESO@subgridlines\dottedline{\ESO@gap}%
303 (0,0)(0,##1)}
304 }{}
305 \else
306 \ifx\ESO@gridcolor\ESO@subgridcolor
307 \renewcommand*\ESO@gridlines{\thicklines}
308 \fi
309 \fi
310 \ifESO@texcoord
311 \def\ESO@yoffsetI{\z@}\def\ESO@yoffsetII{-\paperheight}
312 \edef\ESO@griddeltaY{-\ESO@griddelta}\edef\ESO@gridDeltaY{-\ESO@gridDelta}
313 \else
314 \def\ESO@yoffsetI{-\paperheight}\def\ESO@yoffsetII{\z@}
315 \edef\ESO@griddeltaY{\ESO@griddelta}\edef\ESO@gridDeltaY{\ESO@gridDelta}
316 \fi
317 }
318 \newcommand\ESO@gridpicture{%
319 \begingroup
320 \setlength\unitlength{\ESO@gridunit}%
321 \ESO@color{\ESO@subgridcolor}%
322 \ESO@div{\paperheight}{\ESO@griddelta}%
323 \multiput(0,0)(0,\ESO@griddeltaY){\@tempcnta}%
324 {\ESO@hline{\paperwidth}}%
325 \ESO@div{\paperwidth}{\ESO@griddelta}%
326 \multiput(0,\ESO@yoffsetII)(\ESO@griddelta,0){\@tempcnta}%
327 {\ESO@vline{\paperheight}}%
328 \ESO@color{\ESO@gridcolor}%
329 \ESO@div{\paperheight}{\ESO@gridDelta}%
330 \multiput(0,0)(0,\ESO@gridDeltaY){\@tempcnta}%
331 {\ESO@Hline{\paperwidth}}%
332 \ESO@div{\paperwidth}{\ESO@gridDelta}%
333 \multiput(0,\ESO@yoffsetII)(\ESO@gridDelta,0){\@tempcnta}%
334 {\ESO@Vline{\paperheight}}%
335 \fontsize{10}{12}\normalfont%
336 \ESO@div{\paperwidth}{\ESO@gridDelta}%
337 \multiput(0,\ESO@gridDeltaY)(\ESO@gridDelta,0){\@tempcnta}{%
338 \@tempcntb=\@tempcnta\advance\@tempcntb-\@multicnt
339 \ifnum\@tempcntb>1\relax
340 \multiply\@tempcntb by \ESO@gridDelta\relax
341 \ESO@tempdima=\@tempcntb sp\ESO@tempdima=\ESO@labelfactor\ESO@tempdima
342 \@tempcntb=\ESO@tempdima%
343 \makebox(0,0)[c]{\ESO@colorbox{white}{\the\@tempcntb}}%
344 \fi}%
345 \ifx\ESO@gridunitname\@empty\def\@tempa{0}\else\def\@tempa{1}\fi
346 \ESO@div{\paperheight}{\ESO@gridDelta}%
347 \multiput(\ESO@gridDelta,0)(0,\ESO@gridDeltaY){\@tempcnta}{%
348 \@tempcntb=\@tempcnta\advance\@tempcntb-\@multicnt%
349 \ifnum\@tempcntb>\@tempa\relax
350 \multiply\@tempcntb by \ESO@gridDelta\relax%
351 \ESO@tempdima=\@tempcntb sp\ESO@tempdima=\ESO@labelfactor\ESO@tempdima
352 \@tempcntb=\ESO@tempdima
353 \makebox(0,0)[c]{\ESO@colorbox{white}{\the\@tempcntb}}%
354 \fi
355 }%
356 \ifx\ESO@gridunitname\@empty\else
357 \thicklines\fboxrule=\@wholewidth
358 \put(\ESO@gridDelta,\ESO@gridDeltaY){\makebox(0,0)[c]{%
359 \ESO@fcolorbox{\ESO@gridcolor}{white}{%
360 \textbf{\ESO@gridunitname}}}}%
361 \fi
362 \normalcolor%
363 \endgroup
364 }
365 \ifESO@grid
366 \ifESO@gridBG
367 \g@addto@macro\ESO@HookIIIBG{\ESO@gridpicture}%
368 \else
369 \g@addto@macro\ESO@HookIIIFG{\ESO@gridpicture}%
370 \fi
371 \fi
372 \endinput
373 %%
374 %% End of file `eso-pic.sty'.