summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/adjustbox/adjustbox.dtx
blob: bf3471581774bb871f8d43a16157794f76ed8201 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
% \iffalse meta-comment
%
% Copyright (C) 2011 by Martin Scharrer <martin@scharrer-online.de>
% -----------------------------------------------------------------
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3c
% 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.3c or later is part of all distributions of LaTeX
% version 2008/05/04 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is Martin Scharrer.
%
% This work consists of the files adjustbox.dtx, adjustbox.ins
% and the derived file adjustbox.sty.
%
% $Id: adjustbox.dtx 2085 2011-01-27 01:29:39Z martin $
% \fi
%
% \iffalse
%<package>\ProvidesPackage{adjustbox}
%<*driver>
\ProvidesFile{adjustbox.dtx}
%</driver>
  [2011/01/27 v0.2 Adjusting TeX boxes (trim, clip, ...)]
%<*driver>
\documentclass{ydoc}[2011/01/26]
\GetFileInfo{\jobname.dtx}
\usepackage{adjustbox}[\filedate]
\usepackage{array}
\usepackage{amsmath}
\usepackage{xcolor}
\usepackage{booktabs}

%\EnableCrossrefs
%\CodelineIndex
%\RecordChanges
%\OnlyDescription
\renewcommand{\bottomfraction}{0.5}
\begin{document}
  \DocInput{\jobname.dtx}
  \PrintChanges
  %\newpage\PrintIndex
\end{document}
%</driver>
% \fi
%
% \CheckSum{185}
%
% \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         \~}
%
%
% \changes{v0.1}{2011/01/24}{First internal version}
% \changes{v0.2}{2011/01/27}{First released version}
%
% \GetFileInfo{\jobname.dtx}
%
% \DoNotIndex{\newcommand,\newenvironment,\def,\edef,\xdef,\gdef,\let}
%
% \ifpdf
% \hypersetup{%
%   pdfauthor   = {Martin Scharrer <martin@scharrer-online.de>},
%   pdftitle    = {The adjustbox package},
%   pdfsubject  = {Documentation of LaTeX package adjustbox},
%   pdfkeywords = {adjustbox, LaTeX, TeX}
% }%
% \fi
% \clearpage
% \null
% \vspace*{-2em}
% \begin{center}
%   {\huge The \textsf{adjustbox} Package\\[\medskipamount]}
%   {\large Martin Scharrer \\[\medskipamount]\normalsize
%   \url{martin@scharrer-online.de}\\[.8ex]
%   \url{http://www.ctan.org/pkg/adjustbox/}\\[\bigskipamount]}
%   {\large Version \fileversion\ -- \filedate}\\
% \end{center}
% \vspace{1.2em}%
% \def\optstar{\textcolor{optional}{*}}
%
% \makeatletter
% \def\LATeX{(L\kern -.36em{\sbox \z@ T\vbox to\ht \z@ {\hbox {\check@mathfonts
%  \fontsize \sf@size \z@ \math@fontsfalse \selectfont A}\vss }}\kern -.15em)\TeX}
% \makeatother
%
% \begin{abstract}
%  This package provides macros missing in \pkg{graphics/x} to trim, clip and generally adjust boxed \LaTeX{} material.
%  The macros allow for verbatim content. Equivalent environments are also provided. The trim and clip operation
%  are implemented using the \pkg{pgf} package, which supports both DVI/PS and PDF output.
%  \\
%  \textcolor{red}{This package is new and the implementation might change in upcoming releases!}
% \end{abstract}
%
% \section{Introduction}
% The standard \LaTeX{} package \pkg{graphicx} (the extended version of \pkg{graphics}) provides the macro \Macro\includegraphics[<options>]{<file name>} which can
% be used to include graphic files. Several options can be used to scale, resize, rotate, trim and/or clip the graphic.
% The macros \Macro\scalebox, \Macro\resizebox and \Macro\rotatebox are also provided to apply the corresponding 
% operation on \LATeX{} material, which is subsequently placed inside a \Macro\hbox.
% However no macros are provided to trim or clip \LATeX{} material, most likely because this operations
% are not done by \TeX{} but by the output format, i.e. using PostScript (PS) or PDF operations.
% 
% This package provides the missing macros \Macro\clipbox and \Macro\trimbox
% as well as the general \Macro\adjustbox macro. The clipping and trimming operations are implemented using
% a \env{pgfpicture} environment from the \pkg{pgf} package which supports both PS and PDF output.
%
%
% \section{Usage}
% This section describes the usage of the provided macros, which are outlined in section~\ref{sec:boxmacros}.
% Possible advanced values for the macro arguments are mentioned in section~\ref{sec:argval}. The existing verbatim support
% is explained in section~\ref{sec:verbatim}. Finally section~\ref{sec:alternatives} compares the existing macros with the 
% corresponding options of \Macro\adjustbox.
% It is recommended to also read the \emph{Graphics Guide} (|grfguide|, i.e.~the manual of the |graphics|/|x| packages),
% to understand the existing options for \Macro\includegraphics. See the example section for examples of this macros.
%
% \subsection{Box Modification Macros}\label{sec:boxmacros}
%
% \subsubsection*{Trim Box Content}
%
% \vskip-\lastskip
% \DescribeMacro\trimbox*{<llx>~<lly>~<urx>~<ury>}{<text>}
% The macro \Macro\trimbox trims the given amount from the lower left (ll) and the upper right (ur) corner of
% the box. This means that the amount \meta{llx} is trimmed from the left side, \meta{lly} from the bottom and
% \meta{urx} and \meta{ury} from the right and top of the box, respectively.
% Trimming means that the official size of the box is reduced, but no material
% is actual removed. The material in the trimmed areas simply swaps over the official border.
%
% If the starred version is used the four coordinates are taken as the |viewport| instead, i.e. the box
% is trimmed to the rectangle described by the coordinates.
%
%
%
% \DescribeEnv[<text>]{trimbox}*{<llx>~<lly>~<urx>~<ury>}
% \vspace{-\baselineskip}
% \DescribeEnv[<text>]{trimbox*}{<llx>~<lly>~<urx>~<ury>}
% The \env{trimbox} and \env{trimbox*} environments do the same as the corresponding macros.
% Special care is taken so that the macros and the environments can have the same name.
% Because of this the star can be either part of the name or an optional argument.
% Also the plain\TeX{} syntax for environments (|\trimbox ... \endtrimbox|) can not be used
% because it will trigger \Macro\trimbox in macro mode. 
%
%
% \subsubsection*{Clip Box Content}
% \vskip-\lastskip
% \DescribeMacro\clipbox*{<llx>~<lly>~<urx>~<ury>}{<text>}
% The \Macro\clipbox macro works like the \Macro\trimbox and trims the given amounts from the \meta{text}.
% However, in addition the trimmed material is also clipped, i.e. it is not shown in the final document.
% Note that the material will still be part of the output file but is simply not shown.
% It might be exported using special tools, so using \Macro\clipbox\relax (or \Macro\includegraphics[clip,trim=...])
% to censor classified information would be a bad idea.
% The starred version will again use the given coordinates as |viewport|.
%
% \DescribeEnv[<text>]{clipbox}*{<llx>~<lly>~<urx>~<ury>}
% \vspace{-\baselineskip}
% \DescribeEnv[<text>]{clipbox*}{<llx>~<lly>~<urx>~<ury>}
% The environment versions of \Macro\clipbox and \Macro\clipbox*.
%
%
% \subsubsection*{Adjust Box Content}
% \vskip-\lastskip
% \DescribeMacro\adjustbox{<includegraphics options>}{<text>}
% The \Macro\adjustbox macro is the general form of all box modifying macros mentioned in the introduction.
% It can be thought as an \Macro\includegraphics for \LATeX{} material.
% It supports the same set of \meta{options}, however they are provided as a mandatory not as an optional argument.
% An \Macro\adjustbox without options would not make sense and can be replaced by a simple \Macro\mbox.
% There is no starred version of this macro. See also Table~\ref{tab:alternatives} for a comparison of \Macro\adjustbox
% with the other macros.
%
% \DescribeEnv[<text>]{adjustbox}{<includegraphics options>}
% The environment version of \Macro\adjustbox.
%
%
% \subsection{Argument Values}\label{sec:argval}
%
% The\marginpar{Parsing} argument values are parsed by versatile \Macro\pgfmathparse of the already used |pgf| package. See the |pgfmanual| for detailed information.
% This allows very complex arithmetic expressions as any of the trim/clip coordinates or other numeric options.
% Note\marginpar{Space=Separator} that the four values for \Macro\trimbox and \Macro\clipbox as well as for the |trim| and |viewport| option of \Macro\adjustbox
% are separated by spaces. If the expression of any of this values holds a space or ends with a macro (eats trailing spaces!) it must be wrapped into braces `|{ }|'.
%
% \DescribeMacros
%    \hbox{\Macro\width~~~\Macro\height~~~\Macro\depth~~~\Macro\totalheight}%
% \endDescribeMacros
% This \LaTeX{} lengths hold the original dimension of \meta{text} and can be used as part of the arguments to \Macro\adjustbox, \Macro\trimbox and \Macro\clipbox.
% The totalheight is the height plus depth.
%
% If\marginpar{Default unit} no unit is provided for of the bounding box coordinates (llx, lly, urx, ury) then PostScript points
% (\emph{big points}, bp, $72\,\text{bp}=1\,\text{inch}$) are used, as it is the default behaviour
% of the |trim| and |viewport| ptions of \pkg{graphicx}'s \Macro\includegraphics. Note that \pkg{graphicx} converts all values, independent if a unit is provided or not,
% internally to bp, because graphics where traditionally stored in Encapsulated PostScript (EPS) files. The more modern PDF files also use bp instead of pt.
% Because the |adjustbox| package macros target \LATeX{} material and users will mostly use pt values this internal conversion to bp got disabled for them to 
% avoid unnecessary rounding errors.
%
%
% \subsubsection*{Examples for Argument Values}
% \hbox to \linewidth{\hss\Macro\trimbox{'{.5\width} 10 {log10(10)/sin(45) + 1} 10pt'}{<content>}\hss}
% will trim half the original amount from the left, 10\,bp from the bottom and 
% 2.42328\,bp from the right (bp, because no unit was used in the formula; change e.g. `|+ 1|' to `|+ 1pt|' to get 2.42328\,pt),
% as well as 10\,pt from the top.
%
% \subsection{Verbatim Support}\label{sec:verbatim}
% The macros read the \meta{text} as \TeX{} \Macro\hbox and not as an macro argument in order to support verbatim content.
% This means that the braces around the content can also be written as \Macro\bgroup and \Macro\egroup:\\[\smallskipamount]
% \hspace*{2\parindent}\Macro\trimbox{1 2 3 4}\AlsoMacro\bgroup~<content>\AlsoMacro\egroup\\[\smallskipamount]
% Special care is taken to allow the \meta{text} to be a single macro (except \Macro\bgroup) without any braces:\\[\smallskipamount]
% \hspace*{2\parindent}\Macro\clipbox{1 2 3 4}\AlsoMacro\somemacro\\[\smallskipamount]
% This is to support the questionable habit of some \LaTeX{} users to drop the braces for single token arguments.
% All environments support verbatim content.
%
% \subsection{Alternatives for existing Macros}\label{sec:alternatives}
% The flexible \Macro\adjustbox can also be used as an alternative to existing macros from the \pkg{graphics} package as shown by Table~\ref{tab:alternatives}.
% Because it is longer then the originals this is only of benefit if combinations are to be replaced or verbatim text must be supported.
%
% \begin{table}[b]
% \belowcaptionskip\abovecaptionskip
% \colorlet{optional}{black}
% \caption{Alternatives for existing Macros}\label{tab:alternatives}
% \hbox to \linewidth{\hss
% \begin{tabular}{ll}
%   \toprule
%   Original Macro (w/o text argument)  &  Alternative  (w/o text argument) \\
%   \midrule
%   \Macro\rotatebox{<angle>}    &   \Macro\adjustbox{'angle='<angle>}  \\
%   \Macro\scalebox{<factor>}    &   \Macro\adjustbox{'scale='<factor>}  \\
%   \Macro\scalebox{<x-factor>}[<y-factor>]    &   \Macro\adjustbox{'width='<x-factor>\AlsoMacro\width',height='<y-factor>\AlsoMacro\height}  \\
%   \Macro\reflectbox            &   \Macro\adjustbox{'width=-'\AlsoMacro\width',height='\AlsoMacro\height}  \\
%   \Macro\resizebox{<width>}{<height>}    &   \Macro\adjustbox{'width='<width>',height='<height>}  \\
%   \Macro\resizebox*{<width>}{<totalheight>}    &   \Macro\adjustbox{'width='<width>',totalheight='<totalheight>}  \\
%   \Macro\trimbox{<llx>~<lly>~<urx>~<ury>}    &   \Macro\adjustbox{'trim='<llx>~<lly>~<urx>~<ury>}  \\
%   \Macro\trimbox*{<llx>~<lly>~<urx>~<ury>}    &   \Macro\adjustbox{'viewport='<llx>~<lly>~<urx>~<ury>}  \\
%   \Macro\clipbox{<llx>~<lly>~<urx>~<ury>}    &   \Macro\adjustbox{'trim='<llx>~<lly>~<urx>~<ury>,clip}  \\
%   \Macro\clipbox*{<llx>~<lly>~<urx>~<ury>}    &   \Macro\adjustbox{'viewport='<llx>~<lly>~<urx>~<ury>,clip}  \\
%   \bottomrule
% \end{tabular}%
% \hss}%
% \end{table}
%
% \clearpage
% \section{Examples}
%
% \def\examplecontent{\begin{tabular}{@{}|c|c|@{}}
%       \hline
%       A & B \\
%       \hline
%       C & D \\
%       \hline
%   \end{tabular}}
% The following examples show the application of the package macros on an example text.
% The result is placed in a tight, colored frame box to show the resulting dimensions.
% \begingroup
% \fboxsep=0pt%
% \def\Fbox{\fcolorbox{red}{white}}%
% \def\X{\vspace*{20pt}}%
% \par\bigskip\noindent
% \begin{tabular}{@{}lc}
%   \X\Macro\example      & \Fbox{\examplecontent} \\
%   \X\Macro\trimbox{10 5 10 5}{\AlsoMacro\example} & \Fbox{\trimbox{10 5 10 5}{\examplecontent}} \\
%   \X\Macro\clipbox{10 5 10 5}{\AlsoMacro\example} & \Fbox{\clipbox{10 5 10 5}{\examplecontent}} \\
%   \X\Macro\trimbox*{15 5 25 30}{\AlsoMacro\example} & \Fbox{\trimbox*{15 5 25 30}{\examplecontent}} \\
%   \X\Macro\clipbox*{15 5 25 30}{\AlsoMacro\example} & \Fbox{\clipbox*{15 5 25 30}{\examplecontent}} \\
%   \X\Macro\adjustbox{trim=10 5 10 5,angle=45}{\AlsoMacro\example} & \Fbox{\adjustbox{trim=10 5 10 5,angle=45}{\examplecontent}} \\
%   \X\Macro\adjustbox{scale=1.5}{\AlsoMacro\example} & \Fbox{\adjustbox{scale=1.5}{\examplecontent}} \\
%   \X\Macro\adjustbox{width=180pt,height=20pt}{\AlsoMacro\example} & \Fbox{\adjustbox{width=40pt,height=10pt}{\examplecontent}} \\
%   \X\Macro\adjustbox{width=180pt,height=20pt,keepaspectratio}{\AlsoMacro\example} & \Fbox{\adjustbox{width=40pt,height=10pt,keepaspectratio}{\examplecontent}} \\
% \end{tabular}
%
% \subsubsection*{Environment example:}
% \noindent
% \Macro\begin{adjustbox}{angle=2}:\\
% \begin{adjustbox}{angle=2}
%    | verbatim inside \begin{adjustbox}{angle=2} ... \end{adjustbox} |
% \end{adjustbox}
% \endgroup
%
% \StopEventually{}
% \clearpage
% \iffalse
%<*package>
% \fi
% \section{Implementation}
%
%    \begin{macrocode}
\RequirePackage{graphicx}[1999/02/16]
\RequirePackage{pgf}
%    \end{macrocode}
%
% \begin{environment}{clipbox}
% \begin{macro}{\clipbox}
%    \begin{macrocode}
\newcommand\clipbox{%
    \begingroup
    \def\adjustbox@name{clipbox}%
    \@ifstar
        {\adjustbox@{clip,viewport=}}%
        {\adjustbox@{clip,trim=}}%
}
%    \end{macrocode}
% \end{macro}
%    \begin{macrocode}
\def\endclipbox{%
    \endadjustbox
}
%    \end{macrocode}
% \end{environment}
%
% \begin{environment}{clipbox*}
%    \begin{macrocode}
\newenvironment{clipbox*}
    {\begin{clipbox}*}
    {\end{clipbox}}
%    \end{macrocode}
% \end{environment}
%
% \begin{environment}{trimbox}
% \begin{macro}{\trimbox}
%    \begin{macrocode}
\newcommand\trimbox{%
    \begingroup
    \def\adjustbox@name{trimbox}%
    \@ifstar
        {\adjustbox@{viewport=}}%
        {\adjustbox@{trim=}}%
}
%    \end{macrocode}
% \end{macro}
%    \begin{macrocode}
\def\endtrimbox{%
    \endadjustbox
}
%    \end{macrocode}
% \end{environment}
%
% \begin{environment}{trimbox*}
%    \begin{macrocode}
\newenvironment{trimbox*}
    {\begin{trimbox}*}
    {\end{trimbox}}
%    \end{macrocode}
% \end{environment}
%
% \begin{environment}{adjustbox}
% \begin{macro}{\adjustbox}
%    \begin{macrocode}
\newcommand\adjustbox{%
    \begingroup
    \tracinggroups=1%
    \def\adjustbox@name{adjustbox}%
    \adjustbox@{}%
}
%    \end{macrocode}
% \end{macro}
%    \begin{macrocode}
\def\endadjustbox{%
    \unskip
    \egroup
    \color@endgroup
    \egroup
    \adjustbox@@
}
%    \end{macrocode}
% \end{environment}
%
%
% \begin{macro}{\adjustbox@}
%    \begin{macrocode}
\def\adjustbox@#1#2{%
    \def\adjustbox@setkeys{\setkeys{Gin}{#1#2}}%
    \ifx\@currenvir\adjustbox@name
        \expandafter\def\expandafter\@currenvir\expandafter{\@currenvir\empty}%
        \def\next{%
            \setbox\@tempboxa\hbox\bgroup
                \color@setgroup\bgroup
                \ignorespaces
        }%
    \else
        \def\next{%
            \setbox\@tempboxa\hbox\bgroup%0
                \color@setgroup\bgroup%
                \aftergroup\color@endgroup
                \aftergroup\egroup%
                \aftergroup\adjustbox@@
                \@ifnextchar\bgroup
                    {\let\@let@token=}%
                    {\adjust@box}%
        }%
    \fi
    \next
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\adjust@box}
%    \begin{macrocode}
\def\adjust@box#1{%
    #1\egroup
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\adjustbox@@}
%    \begin{macrocode}
\def\adjustbox@@{%
%    \end{macrocode}
% Set the box dimension macros.
%    \begin{macrocode}
    \def\width{\wd\@tempboxa}%
    \def\height{\ht\@tempboxa}%
    \def\depth{\dp\@tempboxa}%
    \@tempdimc=\ht\@tempboxa
    \advance\@tempdimc by \dp\@tempboxa\relax
    \def\totalheight{\@tempdimc}%
%    \end{macrocode}
% Locally redefine \Macro\Gin@defaultbp to use \Macro\pgfmathsetmacro
% with |bp| as the default unit.
% This should yield the same results (apart of smaller rounding errors) if values
% are given without unit but avoids the internal conversion to |bp| of values with
% units.
%    \begin{macrocode}
    \def\pgfmathresultunitscale{1bp}%
    \let\pgfmathpostparse\pgfmathscaleresult
    \let\Gin@defaultbp\pgfmathsetmacro
    \let\setlength\pgfmathsetlength
%    \end{macrocode}
% The rest of the code was adapted from the \Macro\Gin@ii macro from the |graphicx| package.
% The \emph{temp switch a} is set to |true| to indicate to |graphicx| that the
% scaling should be done internal, so this package doesn't have to do it.
% The content including macro \Macro\adjustbox@@@ is but into place,
% the saved options are activated and the final size is set.
% The typesetting of the content is finally done by executing the token register.
%    \begin{macrocode}
    \@tempswatrue
    \toks@{{\adjustbox@@@}}%
    \adjustbox@setkeys
    \Gin@esetsize
    \the\toks@
    \endgroup
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\adjustbox@@@}
%    \begin{macrocode}
\def\adjustbox@@@{%
    \def\Gin@llx{0}%
    \Gin@defaultbp\Gin@lly{+-\dp\@tempboxa}%
    \Gin@defaultbp\Gin@urx{+\wd\@tempboxa}%
    \Gin@defaultbp\Gin@ury{+\ht\@tempboxa}%
    \Gin@viewport@code
    \begin{pgfpicture}%
        \pgfpathmoveto{\pgfqpoint{\Gin@llx pt}{\Gin@lly pt}}%
        \pgfpathlineto{\pgfqpoint{\Gin@urx pt}{\Gin@lly pt}}%
        \pgfpathlineto{\pgfqpoint{\Gin@urx pt}{\Gin@ury pt}}%
        \pgfpathlineto{\pgfqpoint{\Gin@llx pt}{\Gin@ury pt}}%
        \pgfpathclose
        \expandafter\pgfusepath\ifGin@clip{clip}\else{use as bounding box}\fi\relax
        \pgfset{inner sep=\z@,outer sep=\z@}%
        \pgfnode{rectangle}{base west}{\box\@tempboxa}{}{}%
    \end{pgfpicture}%
}
%    \end{macrocode}
% \end{macro}
%
% \Finale
% \iffalse
%</package>
% \fi