Debian Codegraph @

texmf-dist/source/latex/pst-pdf/pst-pdf.dtx

raw
1 % \iffalse meta-comment
2 %
3 % Copyright (C)
4 % 2005--2008: Rolf Niepraschk <[email protected]>, Hubert Gaesslein
5 % 2008-- Rolf Niepraschk <[email protected]>
6 % --------------------------------------------------------------
7 %
8 % This file may be distributed and/or modified under the
9 % conditions of the LaTeX Project Public License, either version 1.2
10 % of this license or (at your option) any later version.
11 % The latest version of this license is in:
12 %
13 % http://www.latex-project.org/lppl.txt
14 %
15 % and version 1.2 or later is part of all distributions of LaTeX
16 % version 1999/12/01 or later.
17 %
18 % \fi
19 %
20 % \iffalse
21 %<*driver>
22 \ProvidesFile{pst-pdf.dtx}
23 %</driver>
24 %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
25 %<package>\ProvidesPackage{pst-pdf}
26 %<*package>
27 [2020/10/10 v1.2f PS graphics for pdfLaTeX (RN,HjG)]
28 %</package>
29 %
30 %<*driver>
31 \listfiles
32 \documentclass[a4paper]{ltxdoc}
33 \usepackage[ignore]{pst-pdf}
34 \providecommand*\mainlang{}
35 \usepackage[english,\mainlang]{babel}
36 \usepackage{booktabs,calc,array,url}
37 \usepackage[T1]{fontenc}
38 \usepackage{textcomp}
39 \setlength\emergencystretch{3em}
40 \EnableCrossrefs
41 \CodelineIndex
42 \RecordChanges
43 \begin{document}
44 \DocInput{pst-pdf.dtx}
45 \begin{otherlanguage}{english}
46 \PrintChanges \clearpage
47 \PrintIndex
48 \end{otherlanguage}
49 \end{document}
50 %</driver>
51 % \fi
52 %
53 % \CheckSum{818}
54 %
55 % \CharacterTable
56 % {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
57 % 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
58 % Digits \0\1\2\3\4\5\6\7\8\9
59 % Exclamation \! Double quote \" Hash (number) \#
60 % Dollar \$ Percent \% Ampersand \&
61 % Acute accent \' Left paren \( Right paren \)
62 % Asterisk \* Plus \+ Comma \,
63 % Minus \- Point \. Solidus \/
64 % Colon \: Semicolon \; Less than \<
65 % Equals \= Greater than \> Question mark \?
66 % Commercial at \@ Left bracket \[ Backslash \\
67 % Right bracket \] Circumflex \^ Underscore \_
68 % Grave accent \` Left brace \{ Vertical bar \|
69 % Right brace \} Tilde \~}
70 %
71 % \changes{v1.0a}{2005/01/27}{Initial version.}
72 % \changes{v1.0b}{2005/01/28}{Some code and documentation cleaning. (RN)}
73 % \changes{v1.0d}{2005/01/30}{Redefinition of \cmd{\includegraphics} in
74 % modes 0 und 1. Now using of eps graphics directly in pdf\LaTeX{} is
75 % possible. (RN)}
76 % \changes{v1.0j}{2005/02/22}{Check AtBeginDocument for package
77 % `pstricks' even if ``nopstricks'' is given. (RN)}
78 % \changes{v1.0j}{2005/02/22}{For \cmd{\includegraphics}
79 % \cmd{\usepicture} and \string\verb+postscript+ the new options ``frame'',
80 % ``framesep'', ``framerule'', ``linewidth'', and ``ignore'' added. (RN)}
81 % \changes{v1.0l}{2005/02/25}{Options ``framesep'', ``framerule'',
82 % ``linewidth'' removed, ``fname'' and ``innerframe'' added. (RN)}
83 % \changes{v1.0m}{2005/02/26}{New package option ``notightpage'' added. (RN)}
84 % \changes{v1.0n}{2005/02/27}{Some code cleaning. (RN)}
85 % \changes{v1.0n}{2005/02/27}{Changed marcro names (\cmd{\savepicture}
86 % and \cmd{\usepicture}). (RN)}
87 % \changes{v1.0o}{2005/03/12}{Option ``fname'' renamed to ``showname''. (RN)}
88 % \changes{v1.0p}{2005/03/13}{Some code and documentation cleaning. (RN)}
89 % \changes{v1.0s}{2005/03/28}{Scaling e.g. of PostScript pictures now only
90 % in extraction mode. Some code cleaning. (RN)}
91 % \changes{v1.1b}{2005/04/09}{Some code and documentation cleaning. (RN)}
92 % \changes{v1.1c}{2005/04/17}{New package option ``tightpage'' added. (RN)}
93 % \changes{v1.1k}{2006/02/10}{New environment pst-pdf-defs: Support for
94 % PSTricks environment ``psmatrix'' inside user definitions. (RN,HjG)}
95 % \changes{v1.1m}{2006/03/10}{Merge english and german version of the
96 % documentation. (RN)}
97 % \changes{v1.2c}{2017/04/24}{``postscript'' environment no more allowed before
98 % \cmd{\begin}{\ttfamily\char`\{document\char`\}} (changed example file). }
99 % \GetFileInfo{pst-pdf.dtx}
100 %
101 % \DoNotIndex{\newcommand,\renewcommand,\newenvironment,\renewenvironment}
102 % \DoNotIndex{\providecommand,\def,\edef,\let,\gdef,\xdef,\global,\newtoks}
103 % \DoNotIndex{\chardef,\@namedef,\g@addto@macro,\newif,\newcounter}
104 % \DoNotIndex{\RequirePackage,\DeclareOption,\ProcessOptions,\ExecuteOptions}
105 % \DoNotIndex{\input,\endinput,\IfFileExists,\InputIfFileExists}
106 % \DoNotIndex{\@ifdefinable,\@ifundefined,\@percentchar}
107 % \DoNotIndex{\iftrue,\iffalse}
108 % \DoNotIndex{\the,\if,\ifx,\else,\or,\fi,\ifnum,\ifdim,\ifcase,\ifodd}
109 % \DoNotIndex{\AtBeginDocument,\AtEndDocument,\AtEndOfPackage}
110 % \DoNotIndex{\PackageError,\PackageWarning,\PackageWarningNoLine,\PackageInfo}
111 % \DoNotIndex{\message,\MessageBreak,\typeout,\space,\@spaces}
112 % \DoNotIndex{\@tempa,\@tempb,\x}
113 % \DoNotIndex{\z@,\z@skip,\p@,\@ne,\tw@,\thr@@,\@iv,\two@fourteen,\strip@pt}
114 % \DoNotIndex{\advance,\multiply,\divide}
115 % \DoNotIndex{\@for,\@tfor,\do,\@gobble,\@gobbletwo,\relax,\ignorespaces}
116 % \DoNotIndex{\csname,\endcsname,\begingroup,\endgroup,\bgroup,\egroup}
117 % \DoNotIndex{\expandafter,\afterassignment,\aftergroup,\noexpand}
118 % \DoNotIndex{\setbox,\box,\hbox,\vbox,\ht,\wd,\dp,\llap,\rlap}
119 % \DoNotIndex{\small,\large,\tiny,\ttfamily,\lowercase}
120 % \DoNotIndex{\@@,\@empty,\@firstoftwo,\@secondoftwo}
121 % \DoNotIndex{\@tempboxa,\@tempcnta,\@temptokena,\toks@,\@namedef,\@nameuse}
122 %
123 % \providecommand*\env[1]{\textsf{#1}}
124 % \providecommand*\clsname[1]{\textsf{#1}}
125 % \providecommand*\pkgname[1]{\textsf{\mbox{#1}}}
126 % \providecommand*\optname[1]{\textsf{#1}}
127 % \providecommand*\progname[1]{\textsf{`#1'}}
128 %
129 % \providecommand*\PS{Post\-Script}
130 %
131 % \newenvironment{optlist}%
132 % {\begin{description}%
133 % \renewcommand\makelabel[1]{%
134 % \descriptionlabel{\bfseries\optname{##1}}}%
135 % \itemsep0.25\itemsep}%
136 % {\end{description}}
137 %
138 % \newcommand*\META[1]{\meta{\normalfont#1}}
139 % \newcommand*\TorF{\META{true\textbar false}}
140 %
141 % \newif\ifGERMAN \GERMANfalse
142 % \newif\ifENGLISH \ENGLISHfalse
143 % \iflanguage{ngerman}{\GERMANtrue}{%
144 % \iflanguage{german}{\GERMANtrue}{\GERMANfalse}}
145 % \iflanguage{english}{\ENGLISHtrue}{\ENGLISHfalse}
146 %
147 % ^^A ----------------------------------------------------------
148 %
149 % \ifGERMAN
150 % \title{Das Paket \pkgname{pst-pdf}\thanks{Dieses Dokument
151 % bezieht sich auf \textsf{pst-pdf}~\fileversion\ vom \filedate.}}
152 % \fi
153 % \ifENGLISH
154 % \title{The \pkgname{pst-pdf} package\thanks{This document
155 % corresponds to \textsf{pst-pdf}~\fileversion, dated \filedate.
156 % Thanks to Peter Dyballa for the translation.}}
157 % \fi
158 %
159 % \author{%
160 % Rolf Niepraschk\thanks{\texttt{[email protected]}}
161 % \and
162 % Hubert G\"a{\ss}lein}
163 % \date{\filedate}
164 %
165 % \maketitle
166 %
167 % \ifGERMAN
168 % \section{Einleitung}
169 %
170 % Das Paket \pkgname{pst-pdf} vereinfacht die Verwendung von
171 % PSTricks-Grafiken und anderem \PS-Code in PDF-Dokumenten.
172 % \"Ahnlich wie beim Erstellen des Literaturverzeichnisses mit bib\TeX{}
173 % werden zus\"atzlich externe Programme aufgerufen. Sie dienen in
174 % diesem Fall dazu, eine PDF-Datei, die s\"amtliche Grafiken
175 % enth\"alt, zu erzeugen. Ihr Inhalt wird im endg\"ultigen Dokument
176 % statt des urspr\"unglichen \PS-Codes eingef\"ugt.
177 % \fi
178 %
179 % \ifENGLISH
180 % \section{Introduction}
181 %
182 % The package \pkgname{pst-pdf} simplifies the use of graphics from
183 % PSTricks and other \PS\ code in PDF documents. As in building a
184 % bibliography with \BibTeX{} additional external programmes are being
185 % invoked. In this case they are used to create a PDF file
186 % (\cmd{\PDFcontainer}) that will contain all this graphics material. In the
187 % final document this contents will be inserted instead of the original
188 % \PS\ code.
189 % \fi
190 %
191 % \ifGERMAN
192 % \section{Anwendung}
193 % \fi
194 %
195 % \ifENGLISH
196 % \section{Usage}
197 % \fi
198 %
199 % \ifGERMAN
200 % \subsection{Paketoptionen}
201 %
202 % \begin{optlist}
203 %
204 % \item[active] Aktiviert den Extraktionsmodus (DVI-Ausgabe).
205 % Die explizite Angabe ist normalerweise unn\"otig (Standard im
206 % \LaTeX-Modus).
207 %
208 % \item[inactive] Keine besonderen Aktionen; es werden nur die
209 % Pakete \pkgname{pstricks} und \pkgname{graphicx} geladen
210 % (Standard bei Verwendung von V\TeX). Kann dazu benutzt werden,
211 % um das Dokument mit \LaTeX\ in eine DVI-Datei zu wandeln und
212 % dabei die automatische Verwendung des Extraktionsmodus' zu vermeiden.
213 %
214 % \item[pstricks] Das Paket \pkgname{pstricks} wird geladen
215 % (Standard).
216 %
217 % \item[nopstricks] Das Paket \pkgname{pstricks} wird nicht
218 % geladen. Wird sp\"ater festgestellt, dass \pkgname{pstricks} doch
219 % noch anderweitig geladen wurde, wird die Umgebung |pspicture|
220 % nachtr\"aglich in der Weise behandelt, als w\"are die Option
221 % ``pstricks'' doch angegeben worden.
222 %
223 % \item[draft] Im pdf\LaTeX-Modus werden aus der
224 % Containerdatei eingef\"ugte Grafiken nur als Rahmen dargestellt.
225 %
226 % \item[final] Im pdf\LaTeX-Modus werden aus der
227 % Containerdatei eingef\"ugte Grafiken vollst\"andig
228 % dargestellt (Standard).
229 %
230 % \item[tightpage] Die Abmessung Grafiken in der Containerdatei
231 % entsprechen denen der zugeh\"origen \TeX-Boxen (Standard).
232 %
233 % \item[notightpage]
234 % Die Abmessung der zur Grafik geh\"orenden \TeX-Box ist manchmal
235 % nicht korrekt, da \PS-Anweisungen auch au{\ss}erhalb der Box
236 % zeichnen k\"onnen. Die Option ``notightpage'' f\"uhrt dazu, dass die
237 % Grafiken in der Containerdatei mindestens die Gr\"o{\ss}e des
238 % gesamten Blattes einnehmen. Um die Grafiken
239 % im sp\"ateren pdf\LaTeX-Lauf verwenden zu k\"onnen, muss die
240 % Containerdatei nachbearbeitet werden, so dass die Gr\"o{\ss}e der
241 % Grafiken auf die der sichtbaren Bestandteile reduziert ist. Dazu
242 % kann z.\,B. das Programm |pdfcrop|\footnote{%
243 % CTAN:~\url{support/pdfcrop/}} dienen. Die Anwendung dieses Verfahrens
244 % kann die Angabe der Option ``trim'' er\"ubrigen (siehe
245 % Abschnitt~\ref{sec:copt}).
246 %
247 % \item[displaymath]
248 % Es werden zus\"atzlich die mathematischen Umgebungen
249 % \env{displaymath}, \env{eqnarray} und \env{\$\$} extrahiert und im
250 % pdf-Modus
251 % als Grafik eingef\"ugt. So k\"onnen zus\"atzliche PSTricks-Erg\"anzungen
252 % leicht dem Inhalt dieser Umgebungen zugef\"ugt werden. (Frage: Wie
253 % verhalten sich die AMS\LaTeX-Umgebungen?)
254 %
255 % \item[\meta{other}] Alle anderen Optionen werden an das Paket
256 % \pkgname{pstricks} weitergereicht.
257 %
258 % \end{optlist}
259 % \fi
260 % \ifENGLISH
261 % \subsection{Package options}
262 %
263 % \begin{optlist}
264 %
265 % \item[active] Activates the extraction mode (DVI output). An explicit
266 % declaration usually is not necessary (default in \LaTeX\ mode).
267 %
268 % \item[inactive] No special actions; only the packages
269 % \pkgname{pstricks} and \pkgname{graphicx} are loaded (default in
270 % V\TeX). Can be used to just convert the document with \LaTeX\ into a
271 % DVI file while avoiding the automatic extraction mode.
272 %
273 % \item[pstricks] The package \pkgname{pstricks} is loaded (default).
274 %
275 % \item[nopstricks] The package \pkgname{pstricks} does not get loaded.
276 % Once it is detected that \pkgname{pstricks} was loaded however in
277 % some other way, the \env{pspicture} environment is treated as if the
278 % option ``pstricks'' was given.
279 %
280 % \item[draft] From the \cmd{\PDFcontainer} file included graphics is
281 % displayed as frame in pdf\LaTeX\ mode.
282 %
283 % \item[final] From the \cmd{\PDFcontainer} file included graphics is
284 % correctly displayed in pdf\LaTeX\ mode (default).
285 %
286 % \item[tightpage] The graphics' dimensions in the \cmd{\PDFcontainer}
287 % file match exactly those of the corresponding \TeX\ boxes (default).
288 %
289 % \item[notightpage] The dimensions of the \TeX\ box corresponding to its
290 % graphics is not always correct, since a \PS\ statement can draw
291 % outside its box. The option ``notightpage'' makes the graphics in the
292 % \cmd{\PDFcontainer} file to be at least the size of the whole page.
293 % To be able to make use of the graphics' in a later pdf\LaTeX\ run,
294 % the \cmd{\PDFcontainer} file needs to be finished in a way that each
295 % graphics gets reduced in size to its visible part. For this an
296 % external programme like
297 % |pdfcrop|\footnote{CTAN:~\url{support/pdfcrop/}} can be useful. Its
298 % use can save declaring the option ``trim'' (see also
299 % section~\ref{sec:copt}).
300 %
301 % \item[displaymath] In PDF mode the mathematical environments
302 % \env{displaymath}, \env{eqnarray}, and \env{\$\$} get also extracted
303 % and included as graphics. This way additional PSTricks extensions can
304 % easily be added to the contents of these environments. (Question: how
305 % do AMS\LaTeX\ environments behave?)
306 %
307 % \item[\meta{other}] All other options are passed to \pkgname{pstricks}
308 % package.
309 %
310 % \end{optlist}
311 % \fi
312 % \ifGERMAN
313 % \subsection{Programmaufrufe}
314 %
315 % Die folgende Tabelle zeigt den Ablauf, der n\"otig ist, um ein
316 % PDF-Dokument mit \PS-Grafiken zu erzeugen\footnote{%
317 % Die Shell-Scripte |ps4pdf| bzw. |ps4pdf.bat| f\"uhren alle angegebenen
318 % Programmaufrufe automatisch aus.}. Im Vergleich dazu ist der
319 % analoge Ablauf f\"ur Literaturverzeichnisse angegeben.\bigskip
320 %
321 % \newcolumntype{P}[1]{>{\mbox{}\raggedright}p{#1}}
322 % \noindent
323 % \begin{tabular}[t]{@{}P{.65\linewidth}@{}P{.35\linewidth}@{}}
324 % \textbf{\PS-Grafiken} & \textbf{Literaturverzeichnis} \tabularnewline
325 % \toprule
326 % |pdflatex document.tex| & |pdflatex document.tex|
327 % \tabularnewline\midrule
328 % \multicolumn{2}{@{}c@{}}{\emph{Hilfsaufrufe}} \tabularnewline
329 % |latex document.tex| \tabularnewline
330 % |dvips -o document-pics.ps document.dvi| \tabularnewline
331 % |ps2pdf document-pics.ps|
332 % &
333 % |bibtex document.aux|
334 % \tabularnewline\midrule
335 % |pdflatex document.tex| & |pdflatex document.tex|
336 % \end{tabular}\bigskip
337 %
338 % Bei der Erzeugung wird nur
339 % Code ber\"ucksichtigt, der sich innerhalb der Umgebungen |pspicture|
340 % oder |postscript| befindet. Ebenfalls werden \PS-Grafiken, die
341 % als Parameter von \cmd{\includegraphics} angegeben wurden, der
342 % Containerdatei hinzugef\"ugt.
343 % Der Name dieser Datei ist standardm\"a{\ss}ig
344 % \meta{\cmd{\jobname}}|-pics.pdf|.
345 % Er kann durch Umdefinieren des Makros
346 % \cmd{\PDFcontainer} ge\"andert werden. \medskip
347 % \fi
348 % \ifENGLISH
349 % \subsection{Program calls}
350 %
351 % The following table shows the course necessary to create a PDF document
352 % containing \PS\ graphics\footnote{The \TeX\ distribution ``te\TeX''
353 % contains a UNIX shell script |ps4pdf| which executes all the necessary
354 % steps. See: CTAN:~\url{macros/latex/contrib/ps4pdf/}}. As comparison
355 % the analogous course for a bibliography is shown.\bigskip
356 %
357 % \newcolumntype{P}[1]{>{\mbox{}\raggedright}p{#1}}
358 % \noindent
359 % \begin{tabular}[t]{@{}P{.65\linewidth}@{}P{.35\linewidth}@{}}
360 % \textbf{\PS\ graphics} & \textbf{bibliography} \tabularnewline
361 % \toprule
362 % |pdflatex document.tex| & |pdflatex document.tex|
363 % \tabularnewline\midrule
364 % \multicolumn{2}{@{}c@{}}{\emph{auxiliary calls}} \tabularnewline
365 % |latex document.tex| \tabularnewline
366 % |dvips -o document-pics.ps document.dvi| \tabularnewline
367 % |ps2pdf document-pics.ps|
368 % &
369 % |bibtex document.aux|
370 % \tabularnewline\midrule
371 % |pdflatex document.tex| & |pdflatex document.tex|
372 % \end{tabular}\bigskip
373 %
374 % While creating the output only code from inside a \env{pspicture} or
375 % \env{postscript} environment is considered. \PS\ graphics files, which
376 % are passed as parameter of an \cmd{\includegraphics} statement, too are
377 % included into the \cmd{\PDFcontainer} file. This file's name is by
378 % default \meta{\cmd{\jobname}}|-pics.pdf|. It can be changed by
379 % re-defining the macro \cmd{\PDFcontainer}. \medskip
380 % \fi
381 %
382 % \ifGERMAN
383 % \subsection{Nutzeranweisungen}
384 %
385 % \DescribeEnv{pspicture}
386 % \indent\cmd{\begin}|{pspicture}|\oarg{keys}%
387 % \parg{x0,x1}\parg{y0,y1} \dots\cmd{\end}|{pspicture}|
388 % \par\noindent
389 % Die |pspicture|-Umgebung steht zur Verf\"ugung, wenn nicht die Option
390 % ``|nopstricks|'' angegeben wurde. Sie wird so wie in PSTricks \"ublich
391 % verwendet. Im pdf\LaTeX-Modus wird ihr Inhalt nur dann dargestellt,
392 % wenn vorher die Containerdatei erzeugt wurde.
393 % \medskip
394 %
395 % \DescribeEnv{postscript}
396 % \cmd{\begin}|{postscript}|\oarg{keys} \dots\cmd{\end}|{postscript}|
397 % \par\noindent
398 % Die |postscript|-Umgebung kann beliebigen Code mit Ausnahme von
399 % Gleitumgebungen aufnehmen. Im pdf\LaTeX-Modus wird ihr Inhalt
400 % ebenfalls der Containerdatei entnommen. Ist diese Datei nicht
401 % vorhanden, wird -- anders als bei der |pspicture|-Umgebung -- der
402 % sp\"ater ben\"otigte Platz m\"oglicherweise nicht korrekt frei gehalten.
403 % \medskip
404 %
405 % \DescribeMacro{\includegraphics}
406 % \cmd{\includegraphics}\oarg{keys}\marg{filename}
407 % \par\noindent
408 % Wie in \pkgname{graphics}/\pkgname{graphicx} definiert zu verwenden.
409 % Zus\"atzlich ist es nun m\"oglich, auch im pdf\LaTeX-Modus
410 % EPS-Dateien als Argument anzugeben und ihren Inhalt darzustellen. Er
411 % wird dazu ebenfalls der Containerdatei entnommen.
412 % \medskip
413 %
414 % \newcommand*\ooarg[1]{{\ttfamily<}\meta{#1}{\ttfamily>}}
415 %
416 % \DescribeMacro{\includegraphicx}
417 % \cmd{\includegraphicx}\oarg{keys}\parg{pfxadd}\ooarg{ovpfgd}\oarg{ovpbgd}%
418 % \marg{filename}
419 % \par\noindent
420 % Wie im Paket \pkgname{psfragx} definiert zu verwenden.
421 % \medskip
422 %
423 % \DescribeMacro{\savepicture}
424 % \cmd{\savepicture}\marg{name}
425 % \par\noindent
426 % Die zuletzt ausgegebene Grafik (Ergebnisse der Umgebungen |pspicture|,
427 % |postscript| und der \cmd{\includegraphics}-Anweisungen mit
428 % \PS-Dateien) wird unter dem als Parameter \"ubergebenen
429 % Namen gespeichert.
430 % \medskip
431 %
432 % \DescribeMacro{\usepicture}
433 % \cmd{\usepicture}\oarg{keys}\marg{name}
434 % \par\noindent
435 % Die zuvor mit \cmd{\savepicture} gespeicherte Grafik wird
436 % ausgegeben. Der optionale Parameter entpricht dem bei der Anweisung
437 % \cmd{\includegraphics} m\"oglichen.
438 % \medskip
439 %
440 % \DescribeEnv{pst-pdf-defs}
441 % \cmd{\begin}\texttt{\{pst-pdf-defs\}} \dots
442 % \cmd{\end}\texttt{\{pst-pdf-defs\}}
443 % \par\noindent
444 % Sollen eigene Makros oder Umgebungen definiert werden, die das Zeichen
445 % \texttt{\&} (andere?) im Ersetzungstext enthalten, so m\"ussen diese
446 % Definitionen von der Umgebung |pst-pdf-defs| umschlossen werden.
447 % \medskip
448 % \fi
449 %
450 % \ifENGLISH
451 % \subsection{User commands}
452 %
453 % \DescribeEnv{pspicture}
454 % \indent\cmd{\begin}|{pspicture}|\oarg{keys}%
455 % \parg{x0,x1}\parg{y0,y1} \dots\cmd{\end}|{pspicture}|
456 % \par\noindent
457 % The \env{pspicture} environment is not available when the option
458 % ``|nopstricks|'' was given. It is to be used the same way as if in
459 % PSTricks. In pdf\LaTeX\ mode this environment's contents is only
460 % displayed when the \cmd{\PDFcontainer} file was created before.
461 % \medskip
462 %
463 % \DescribeEnv{postscript}
464 % \cmd{\begin}|{postscript}|\oarg{keys} \dots\cmd{\end}|{postscript}|
465 % \par\noindent
466 % The \env{postscript} environment can contain any code except floats. In
467 % pdf\LaTeX\ mode its contents is take too off the \cmd{\PDFcontainer}
468 % file. Other as in the \env{pspicture} environment the necessary space is
469 % not always preserved when the \cmd{\PDFcontainer} file does not exist yet.
470 % \medskip
471 %
472 % \DescribeMacro{\includegraphics}
473 % \cmd{\includegraphics}\oarg{keys}\marg{filename}
474 % \par\noindent
475 % To be used as in \pkgname{graphics}/\pkgname{graphicx} defined. In
476 % pdf\LaTeX\ mode it is now additionally feasable to pass the name of an
477 % EPS file. Its visible contents too is taken from the \cmd{\PDFcontainer}
478 % file.
479 % \medskip
480 %
481 % \newcommand*\ooarg[1]{{\ttfamily<}\meta{#1}{\ttfamily>}}
482 %
483 % \DescribeMacro{\includegraphicx}
484 % \cmd{\includegraphicx}\oarg{keys}\parg{pfxadd}\ooarg{ovpfgd}\oarg{ovpbgd}%
485 % \marg{filename}
486 % \par\noindent
487 % To be used like defined in package\pkgname{psfragx}.
488 % \medskip
489 %
490 % \DescribeMacro{\savepicture}
491 % \cmd{\savepicture}\marg{name}
492 % \par\noindent
493 % The last output graphics (result of the \env{pspicture} or \env{postscript}
494 % environments or the \cmd{\includegraphics} statement with an \PS\ file as
495 % argument) is being saved in a file under the name as given by the parameter.
496 % \medskip
497 %
498 % \DescribeMacro{\usepicture}
499 % \cmd{\usepicture}\oarg{keys}\marg{name}
500 % \par\noindent
501 % The graphic previously stored with \cmd{\savepicture} is outputted. The
502 % optional parameter corresponds to \cmd{\includegraphics}.
503 % \medskip
504 %
505 % \DescribeEnv{pst-pdf-defs}
506 % \cmd{\begin}\texttt{\{pst-pdf-defs\}} \dots
507 % \cmd{\end}\texttt{\{pst-pdf-defs\}}
508 % \par\noindent
509 % For defining macros or environments, which contain character \texttt{\&}
510 % (others?) in the output, these defintions have to be wrapped with
511 % environment |pst-pdf-defs|.
512 % \medskip
513 % \fi
514 %
515 % \ifGERMAN
516 % \subsection{Command options} \label{sec:copt}
517 % Das Verhalten der Anweisungen \cmd{\includegraphics}, \cmd{\usepicture}
518 % und der Umgebung |postscript| kann mit den folgenden optionalen
519 % Parametern beeinflusst werden (key-value-Syntax):
520 % \begin{optlist}
521 %
522 % \item[frame=\TorF] Es wird -- \"ahnlich wie bei der
523 % Anweisung \cmd{\fbox}~-- ein Rahmen um die Grafik gezeichnet. Die
524 % durch Rotation ge\"anderte Gesamtgr\"o{\ss}e wird dabei
525 % ber\"ucksichtigt. Das Zeichnen geschieht im
526 % pdf\LaTeX-Modus; vorher beim Erzeugen der Containerdatei wird dieser
527 % Parmeter ignoriert. Standard: false.
528 %
529 % \item[innerframe=\TorF] Wie ``|frame|'' jedoch
530 % wird der Rahmen nur um die Grafik selbst, nicht aber um die
531 % resultierende Box gezeichnet.
532 %
533 % \item[ignore=\TorF] Bei ``|true|'' wird die Grafik
534 % nicht ausgegeben. Bei Angabe von \cmd{\savepicture}\marg{name}
535 % kann sie sp\"ater jedoch an anderer Stelle mit
536 % \cmd{\usepicture} verwendet werden. Standard: false.
537 %
538 % \item[showname=\TorF] Gibt in kleiner
539 % Schrift den tats\"achlich verwendeten Dateinamen unter der Grafik
540 % aus. Standard: false.
541 %
542 % \item[namefont=\META{font commands}] Beinflusst die Schriftart,
543 % die bei ``|showname=true|'' benuzt wird. Standard:
544 % \cmd{\ttfamily}\cmd{\tiny}
545 %
546 % \end{optlist}
547 %
548 % Alle Parameter k\"onnen auch global per
549 % \cmd{\setkeys}|{Gin}|\marg{key=value} gesetzt werden.
550 % \fi
551 %
552 % \ifENGLISH
553 % \subsection{Command options} \label{sec:copt}
554 % The behaviour of the \cmd{\includegraphics} and \cmd{\usepicture}
555 % statements and the \env{postscript} environment can be modified with any
556 % of the following parameters (key value syntax):
557 % \begin{optlist}
558 %
559 % \item[frame=\TorF] As with the \cmd{\fbox} statement a frame is drawn
560 % around the graphics. Any change of size due to rotation is taken into
561 % account. Drawing happens in pdf\LaTeX\ mode; before, in creating the
562 % \cmd{\PDFcontainer} file, it is ignored. Default: false.
563 %
564 % \item[innerframe=\TorF] As in ``|frame|'', but the frame is drawn
565 % around the gra\-phics, not its box.
566 %
567 % \item[ignore=\TorF] If set to ``|true|'' no graphics are outputted. With
568 % macro \cmd{\savepicture}\marg{name} the graphics can be used later in a
569 % different place via \cmd{\usepicture}. Default: false.
570 %
571 % \item[showname=\TorF] A caption of minimal font size records the used
572 % file's name. Default: false.
573 %
574 % \item[namefont=\META{font commands}] Controls the font used when
575 % ``|showname=true|'' is set. Default: \cmd{\ttfamily}\cmd{\tiny}
576 %
577 % \end{optlist}
578 %
579 % All parameters can be set globally as in
580 % \cmd{\setkeys}|{Gin}|\marg{key=value}.
581 % \fi
582 %
583 % \bigskip \pagebreak[2]
584 %
585 % \StopEventually{}
586 %
587 % \section{Implementation}
588 %
589 % \begin{macrocode}
590 %<*package>
591 % \end{macrocode}
592 % \subsection{Package options}
593 % \changes{v1.0c}{2005/01/29}{New options ``pstricks'', ``nopstricks'',
594 % ``draft'' and ``\mbox{final}''. (RN)}
595 % \changes{v1.1e}{2005/04/30}{New option ``displaymath'' (see preview
596 % package). (HjG/RN)}
597 % \changes{v1.1f}{2005/04/30}{Package option ``ignore'' reimplemented.
598 % Now the compilation of the dtx file in \LaTeX\ mode is possible. (RN)}
599 % \begin{macrocode}
600 \newcommand*\ppf@TeX@mode{-1}
601 \newcommand*\ppf@draft{false}
602 \newif\if@ppf@PST@used\@ppf@PST@usedtrue
603 \newif\if@ppf@tightpage \@ppf@tightpagetrue
604 \DeclareOption{active}{\OptionNotUsed}
605 \DeclareOption{inactive}{\def\ppf@TeX@mode{9}}
606 \DeclareOption{ignore}{\def\ppf@TeX@mode{999}}
607 \DeclareOption{pstricks}{\@ppf@PST@usedtrue}
608 \DeclareOption{nopstricks}{\@ppf@PST@usedfalse}
609 \DeclareOption{displaymath}{%
610 \PassOptionsToPackage\CurrentOption{preview}}
611 \DeclareOption{draft}{\def\ppf@draft{true}}
612 \DeclareOption{final}{\def\ppf@draft{false}%
613 \PassOptionsToPackage\CurrentOption{graphicx}}
614 % \end{macrocode}
615 % \changes{v1.1i}{2005/06/29}{Package option ``final'' also
616 % for ``graphicx''. (RN)}
617 % \begin{macrocode}
618 \DeclareOption{notightpage}{\@ppf@tightpagefalse}%
619 \DeclareOption{tightpage}{\@ppf@tightpagetrue}%
620 \DeclareOption*{%
621 \PassOptionsToPackage\CurrentOption{pstricks}}
622 \ProcessOptions\relax
623 \ifnum\ppf@TeX@mode=999\relax\expandafter\endinput\fi
624 % \end{macrocode}
625 % \ifGERMAN
626 % \subsection{Compilertests}
627 % Es wird getestet, welcher \TeX\ compiler in welchem Modus
628 % l\"auft (siehe `|graphics.cfg|' von te\TeX/\TeX Live). Entsprechend
629 % dem Ergebnis bekommen die Umgebungen |pspicture| und |postscript|
630 % unterschiedliche Funktionalit\"at. Der Test wird nur ausgef\"uhrt,
631 % wenn nicht die Paketoptionen |active| oder |inactive| angegeben wurden.
632 % \fi
633 % \ifENGLISH
634 % \subsection{Compiler tests}
635 % It is tested which \TeX\ compiler in which mode of operation is actually
636 % used (see `|graphics.cfg|' in te\TeX/\TeX\ Live). Accordingly the
637 % environments \env{pspicture} and \env{postscript} gain each a different
638 % range of functions. This test is only executed when the options |active|
639 % or |inactive| were not given.
640 % \fi
641 % \changes{v1.2a}{2016/07/11}{Engine tests changed (RN)}
642 % \changes{v1.2b}{2017/02/25}{Loading packages `if*' at wrong place (RN)}
643 % \begin{macrocode}
644 \RequirePackage{ifpdf,ifxetex,ifvtex}
645 \ifnum\ppf@TeX@mode=-1\relax
646 \ifpdf
647 % \end{macrocode}
648 % \quad$\Rightarrow$\,pdf\TeX{} or Lua\TeX{} are running in PDF mode
649 % \begin{macrocode}
650 \def\ppf@TeX@mode{1}%
651 \RequirePackage{luatex85}%
652 \else
653 \ifvtex
654 % \end{macrocode}
655 % \quad$\Rightarrow$\,V\TeX{}
656 % \begin{macrocode}
657 \def\ppf@TeX@mode{9}%
658 \else
659 \ifxetex
660 % \end{macrocode}
661 % \quad$\Rightarrow$\,Xe\TeX{}
662 % \begin{macrocode}
663 \def\ppf@TeX@mode{9}%
664 \else
665 % \end{macrocode}
666 % \quad$\Rightarrow$\,DVI mode
667 % \begin{macrocode}
668 \def\ppf@TeX@mode{0}%
669 \fi
670 \fi
671 \fi
672 \fi
673 % \end{macrocode}
674 % \changes{v1.0g}{2005/02/12}{Definition of \cmd{\PDFcontainer}
675 % now with \cmd{\edef}. (RN)}
676 % \begin{macrocode}
677 \newcommand*\PDFcontainer{}
678 \edef\PDFcontainer{\jobname-pics.pdf}
679 \newcounter{pspicture}
680 \newcommand*\ppf@other@extensions[1]{}
681 \newcommand*\usepicture[2][]{}
682 \newcommand*\savepicture[1]{}
683 % \end{macrocode}
684 %
685 % \begin{environment}{pst-pdf-defs}
686 % \begin{macrocode}
687 \newenvironment*{pst-pdf-defs}{%
688 \endgroup
689 % ??? \@currenvline
690 }{%
691 \begingroup
692 \def\@currenvir{pst-pdf-defs}%
693 }
694 % \end{macrocode}
695 % \end{environment}
696 %
697 % \changes{v1.2d}{2017/06/22}{Version parameter for `graphicx' and rename
698 % \cmd{\GPT@page} to \cmd{\Gin@page} at several places}
699 % \begin{macrocode}
700 \RequirePackage{graphicx}[2017/06/01]%
701 \let\ppf@Ginclude@graphics\Ginclude@graphics
702 \let\ppf@Gin@extensions\Gin@extensions
703 \let\ppf@Gin@ii\Gin@ii
704 % \end{macrocode}
705 % \begin{macrocode}
706 \newif\if@ppf@pdftex@graphic
707 \newif\ifGin@frame\Gin@framefalse
708 \newif\ifGin@innerframe\Gin@innerframefalse
709 \newif\ifGin@showname\Gin@shownamefalse
710 \newif\ifGin@ignore\Gin@ignorefalse
711 % \end{macrocode}
712 % \ifGERMAN
713 % \cmd{\ifpr@outer} wird eigentlich im Paket \pkgname{preview} definiert.
714 % Wir m\"ussen es aber be\-reits hier zus\"atzlich tun, da sonst \TeX\ u.\,U.
715 % beim Parsen der \cs\texttt{ifcase}-Struktur ``au{\ss}er Tritt'' kommt.
716 % \fi
717 % \ifENGLISH
718 % \cmd{\ifpr@outer} in fact is defined in package \pkgname{preview}. We
719 % have to do it here too since otherwise \TeX\ could ``stumble and fall''
720 % while parsing the \cs\texttt{ifcase} structure.
721 % \fi
722 % \changes{v1.1i}{2005/06/29}{\cmd{\ifpr@outer} must be predefined. (HjG/RN)}
723 % \begin{macrocode}
724 \newif\ifpr@outer
725 % \end{macrocode}
726 % \begin{macro}{\ppf@is@pdfTeX@graphic}
727 % \changes{v1.0i}{2005/02/18}{No more errors for given files without
728 % extensions. (RN)}
729 % \changes{v1.0r}{2005/03/25}{Changed \cmd{\ppf@is@known@graphic} to
730 % \cmd{\ppf@is@pdfTeX@graphic}. Now pdf\TeX\ graphics are prefered. (RN)}
731 % \changes{v1.2e}{2019/11/15}{Parameter \string\verb+#2+ is detokenized when
732 % expanded to \cmd{\pdfTeXext}}
733 % \ifGERMAN
734 % Parameter |#1| ist der Name einer Grafikdatei mit oder ohne Endung,
735 % Parameter |#2| enth\"alt die g\"ultigen Dateiendungen im pdf-Modus,
736 % Parameter |#3| enth\"alt die g\"ultigen Dateiendungen im dvi-Modus.
737 % Ist es m\"oglich, die Grafik im pdf-Modus zu verarbeiten, werden die
738 % Anweisungen in |#4| ausgef\"uhrt, sonst die in |#5|.
739 % \fi
740 % \ifENGLISH
741 % Parameter |#1| is the name of a graphics file with or without extension,
742 % parameter |#2| contains the valid extensions in PDF mode,
743 % parameter |#3| contains the valid extensions in DVI mode.
744 % If it works to process the graphics in PDF mode, then the statements
745 % in |#4| are executed, otherwise those in |#5|.
746 % \fi
747 % \begin{macrocode}
748 \newcommand*\ppf@is@pdfTeX@graphic[5]{%
749 \@ppf@pdftex@graphicfalse%
750 \begingroup
751 \edef\pdfTeXext{,#2,}%
752 \edef\pdfTeXext{\detokenize\expandafter{\pdfTeXext}}%
753 % \end{macrocode}
754 % \ifGERMAN
755 % Statt Einladen einer identifizierten Grafik nur Test der Grafikendung.
756 % \fi
757 % \ifENGLISH
758 % Instead of loading the found graphics, only a test on file name extension.
759 % \fi
760 % \begin{macrocode}
761 \def\Gin@setfile##1##2##3{%
762 \edef\@tempa{,##2,}%
763 \@expandtwoargs\in@{\detokenize\expandafter{\@tempa}}{\pdfTeXext}%
764 \ifin@\global\@ppf@pdftex@graphictrue\fi}%
765 % \end{macrocode}
766 % \ifGERMAN
767 % Es m\"ussen Dateitypen beider Moden gefunden werden, um
768 % die Fehlermeldung ``File `|#1|' not found'' zu vermeiden.
769 % \fi
770 % \ifENGLISH
771 % File types for both modes need to be determined to prevent a wrong
772 % error message ``File `|#1|' not found''.
773 % \fi
774 % \begin{macrocode}
775 \edef\Gin@extensions{#2,#3}%
776 % \end{macrocode}
777 % \ifGERMAN
778 % Testaufruf. Dabei Ausgabe vollst\"andig verhindern.
779 % \fi
780 % \ifENGLISH
781 % Trial invocation. Output is completely inhibited.
782 % \fi
783 % \begin{macrocode}
784 \pr@outerfalse\ppf@Ginclude@graphics{#1}%
785 \endgroup
786 \if@ppf@pdftex@graphic#4\else#5\fi
787 }
788 % \end{macrocode}
789 % \end{macro}
790 % \begin{macrocode}
791 \ifcase\ppf@TeX@mode\relax
792 % \end{macrocode}
793 % \ifGERMAN
794 % \subsection{Extraction mode (dvi output)}
795 % Die Umgebung |pspicture| beh\"alt die Definition aus |pstricks.tex|.
796 % Aus\-schlie{\ss}\-lich der Code der Umgebungen |pspicture| und
797 % |postscript| sowie \cmd{\includegraphics} mit PS-Dateien bewirken
798 % Eintr\"age in die DVI-Datei. Der
799 % restliche Code des Dokuments wird bei der Ausgabe der DVI-Datei
800 % ignoriert. Nach Wandlung der DVI-Datei \"uber \PS\ (``|dvips|'')
801 % nach PDF (Datei \cmd{\PDFcontainer}) nimmt jede Grafik
802 % genau eine Seite der pdf-Datei ein.
803 % Der \TeX-Compiler mit DVI-Ausgabe sowie die Paketoption ``|active|''
804 % erzwingen diesen Modus.
805 % \fi
806 % \ifENGLISH
807 % \subsection{Extraction mode (DVI output)}
808 % The \env{pspicture} environment retains any definition from
809 % |pstricks.tex|. Only the code from the environments \env{pspicture} and
810 % \env{postscript} as well as \cmd{\includegraphics} with \PS\ files leads
811 % to records into the DVI file. The remainder of the document's code is
812 % ignored for output. After conversion of the DVI file via \PS\
813 % (``|dvips|'') into PDF (\cmd{\PDFcontainer} file) each graphics takes
814 % exactly one page in the \cmd{\PDFcontainer} file. The \TeX\ compiler with
815 % DVI output and the package option ``|active|'' both force this mode.
816 % \fi
817 % \changes{v1.1n}{2006/07/14}{\cmd{\nofiles} added (suggestion of Torsten
818 % Bronger).}
819 % \changes{v1.1p}{2007/06/04}{\cmd{\nofiles} makes \cmd{\makeindex} and
820 % \cmd{\makeglossary} to \cmd{\relax}. \cmd{\@empty} is better
821 % because of later \cmd{\renewcommand}'s.}
822 % \changes{v1.2e}{2019/11/15}{gobble optional argument for \cmd{\makeindex},
823 % \cmd{\makeglossary} and \cmd{\printindex}}
824 % \changes{v1.1q}{2008/02/17}{\cmd{\overfullrule} must not be > 0.}
825 % \begin{macrocode}
826 \PackageInfo{pst-pdf}{%
827 MODE: \ppf@TeX@mode\space (dvi -- extraction mode)}%
828 \nofiles
829 \let\makeindex\@empty \let\makeglossary\@empty \let\printindex\@empty
830 \renewcommand*\makeindex[1][]{}%
831 \renewcommand*\makeglossary[1][]{}%
832 \renewcommand*\printindex[1][]{}%
833 \AtBeginDocument{\overfullrule=\z@}%
834 \if@ppf@PST@used\RequirePackage{pstricks}\fi
835 \RequirePackage[active,dvips,tightpage]{preview}[2005/01/29]%
836 \newcommand*\ppf@PreviewBbAdjust{}%
837 \newcommand*\ppf@RestoreBbAdjust{%
838 \let\PreviewBbAdjust\ppf@PreviewBbAdjust}%
839 % \end{macrocode}
840 % \ifGERMAN
841 % Es werden auch die im pdf\LaTeX-Modus erlaubten Endungen von Grafikdateien
842 % ben\"otigt (Argument aus `pdftex.def' -- 2020/10/05 -- kopiert).
843 % \fi
844 % \ifENGLISH
845 % The pdf\LaTeX\ mode compliant graphics file formats are needed too.
846 % (Argument copied from `pdftex.def' -- 2020/10/05).
847 % \fi
848 % \changes{v1.1u}{2008/09/16}{\cmd{\pdfoutput} must be set when
849 % loading ``pdftex.def'' in DVI mode. (RN)}
850 % \changes{v1.1v}{2008/10/09}{Local redefinition of \cmd{\pdfoutput} to be a
851 % counter. (RN)}
852 % \changes{v1.2f}{2020/10/10}{No more loading of file `pdftex.def' (RN)}
853 % \begin{macrocode}
854 \def\ppf@other@extensions{%
855 .pdf,.png,.jpg,.mps,.jpeg,.jbig2,.jb2,%
856 .PDF,.PNG,.JPG,.JPEG,.JBIG2,.JB2%
857 }
858 % \end{macrocode}
859 % \changes{v1.1c}{2005/04/17}{Supress handling of pdf\LaTeX\ graphic
860 % formats in DVI mode. (RN)}
861 % \ifGERMAN
862 % F\"ur die im PDF-Modus m\"oglichen Grafikformate d\"urfen keine
863 % speziellen Regeln definiert sein (z.\,B. wegen
864 % \progname{dvips}-Erweiterungen). F\"ur sie wird die universelle
865 % EPS-Regel verwendet, damit sie zumindest gefunden werden.
866 % \fi
867 % \ifENGLISH
868 % In PDF mode no rules must be defined for its compliant (PNG, JPEG, PDF)
869 % graphics file formats (because of for example \progname{dvips} extensions).
870 % The universal EPS rule is used to at least find these files.
871 % \fi
872 % \begin{macrocode}
873 \AtBeginDocument{%
874 \@ifpackageloaded{keyval}{%
875 \def\KV@errx#1{\PackageInfo{keyval}{#1}}%
876 }{}%
877 \@ifpackageloaded{xkeyval}{%
878 \def\XKV@err#1{\PackageInfo{xkeyval}{#1}}%
879 }{}%
880 % \end{macrocode}
881 % \ifGERMAN
882 % In diesem Modus sollten undefinierte keys keinen Fehler bewirken.
883 % \fi
884 % \ifENGLISH
885 % In this mode undefined keys should not be an error.
886 % \fi
887 % \begin{macrocode}
888 \@for\@tempa:=\ppf@other@extensions\do{%
889 \expandafter\let\csname Gin@rule@\@tempa\endcsname\relax}%
890 \DeclareGraphicsRule{*}{eps}{*}{}}%
891 % \end{macrocode}
892 % \ifGERMAN
893 % In diesem Modus keine Funktion.
894 % \fi
895 % \ifENGLISH
896 % No function in this mode.
897 % \fi
898 % \changes{v1.1s}{2008/05/25}{Dummy definition of the page key in DVI mode.}
899 % \begin{macrocode}
900 \define@key{Gin}{innerframe}[true]{}%
901 \define@key{Gin}{frame}[true]{}%
902 \define@key{Gin}{ignore}[true]{}%
903 \define@key{Gin}{showname}[true]{}%
904 \define@key{Gin}{namefont}{}%
905 \@ifundefined{Gin@page}{\define@key{Gin}{page}{}}{}%
906 % \end{macrocode}
907 % \changes{v1.0o}{2005/03/12}{New code for ``notightpage''. (RN)}
908 % \changes{v1.1r}{2008/05/02}{Fixed values for \cmd{\PreviewBbAdjust}
909 % because \cmd{\paperwidth} is not allways defined (suggested by Will
910 % Robertson).}
911 % \begin{macrocode}
912 \if@ppf@tightpage\else
913 \def\PreviewBbAdjust{%
914 -600pt -600pt 600pt 600pt}%
915 \AtEndDocument{%
916 \PackageWarningNoLine{pst-pdf}{Picture container needs cropping.}}%
917 \fi
918 % \end{macrocode}
919 % \begin{environment}{postscript}
920 % \changes{v1.0e}{2005/02/03}{``trim'' option added. (RN)}
921 % \ifGERMAN
922 % Die Umgebung \env{postscript} wertet die trim-Option in derselben
923 % Weise wie \cmd{\includegraphics} aus (Angaben ohne Ma{\ss}einheit
924 % werden als bp interpretiert).
925 % \fi
926 % \ifENGLISH
927 % The \env{postscript} environment utilises the trim option in the same
928 % manner as does \cmd{\includegraphics} (any specification without dimension
929 % is interpreted as if given in bp).
930 % \fi
931 % \begin{macrocode}
932 \newenvironment{postscript}[1][]%
933 {%
934 \global\let\ppf@PreviewBbAdjust\PreviewBbAdjust
935 \if@ppf@tightpage
936 \begingroup
937 \setkeys{Gin}{#1}%
938 \xdef\PreviewBbAdjust{%
939 -\Gin@vllx bp -\Gin@vlly bp \Gin@vurx bp \Gin@vury bp}%
940 \endgroup
941 \fi
942 \ignorespaces
943 }%
944 {\aftergroup\ppf@RestoreBbAdjust}%
945 % \end{macrocode}
946 % \end{environment}
947 % \begin{macrocode}
948 \PreviewEnvironment{postscript}%
949 \AtBeginDocument{%
950 \@ifundefined{PSTricksLoaded}{}%
951 {%
952 % \end{macrocode}
953 % \begin{environment}{pspicture}
954 % \ifGERMAN
955 % Originaldefinition \pkgname{preview} bekannt machen.
956 % \fi
957 % \ifENGLISH
958 % Announce \pkgname{preview} original definition.
959 % \fi
960 % \begin{macrocode}
961 \PreviewEnvironment{pspicture}%
962 % \end{macrocode}
963 % \end{environment}
964 % \begin{environment}{psmatrix}
965 % \ifGERMAN
966 % Originaldefinition \pkgname{preview} bekannt machen.
967 % \fi
968 % \ifENGLISH
969 % Announce \pkgname{preview} original definition.
970 % \fi
971 % \begin{macrocode}
972 \@ifundefined{psmatrix}{}%
973 {%
974 \PreviewEnvironment{psmatrix}%
975 \newcommand*\ppf@set@mode{}%
976 \newcommand*\ppf@test@mmode{%
977 \ifmmode
978 \ifinner
979 \let\ppf@set@mode=$%
980 \else
981 \def\ppf@set@mode{$$}%
982 \fi
983 \else
984 \let\ppf@set@mode=\@empty
985 \fi
986 }%
987 \let\ppf@psmatrix=\psmatrix
988 \expandafter\let\expandafter\ppf@pr@psmatrix%
989 \expandafter=\csname pr@\string\psmatrix\endcsname
990 \let\ppf@endpsmatrix=\endpsmatrix
991 \def\psmatrix{\ppf@test@mmode\ppf@psmatrix}%
992 \expandafter\def\csname pr@\string\psmatrix\endcsname{%
993 \ppf@set@mode\ppf@pr@psmatrix}%
994 \def\endpsmatrix{\ppf@endpsmatrix\ppf@set@mode}%
995 }%
996 % \end{macrocode}
997 % \end{environment}
998 % \ifGERMAN
999 % Internes Makro \cmd{\pst@object} bekanntmachen, um manchen
1000 % PSTricks-Code au{\ss}erhalb von pspicture-Umgebungen ebenfalls
1001 % verwenden zu k\"onnen. Derzeit sind Aufrufe der folgenden Art
1002 % m\"oglich:
1003 % \begin{flushleft}
1004 % \cmd{\pst@object}%
1005 % \marg{m}\meta{\texttt{*}}\oarg{o}\marg{o}\marg{o}\parg{o}\parg{o}\parg{o} \\
1006 % \qquad (|m|\,$=$\,notwendig, |*|\,$=$\,optional, |o|\,$=$\,optional)
1007 % \end{flushleft}
1008 % Mehr als drei optionale Argumente am Ende des Aufrufs, wie
1009 % bei\-spiels\-wei\-se bei \cmd{\psline} denkbar, sind noch nicht m\"oglich.
1010 % \fi
1011 % \ifENGLISH
1012 % Announce internal macro \cmd{\pst@object} to enable the use of some
1013 % PSTricks code outside of \env{pspicture} environments. At the moment
1014 % invocations of the following kind are feasible:
1015 % \begin{flushleft}
1016 % \cmd{\pst@object}%
1017 % \marg{m}\meta{\texttt{*}}\oarg{o}\marg{o}\marg{o}\parg{o}\parg{o}\parg{o} \\
1018 % \qquad (|m|\,$=$\,necessary, |*|\,$=$\,optional, |o|\,$=$\,optional)
1019 % \end{flushleft}
1020 % More than three optional arguments at the call's end, as in
1021 % \cmd{\psline} possible, do not work yet.
1022 % \fi
1023 % \changes{v1.1a}{2005/04/07}{Support for the internal PSTricks macro
1024 % \cmd{\pst@object}. (HjG/RN)}
1025 % \begin{macrocode}
1026 \PreviewMacro[{{}*[]%
1027 ?\bgroup{#{#1}{{#1}}}{}%
1028 ?\bgroup{#{#1}{{#1}}}{}%
1029 ?({#{(#1)}{({#1})}}{}%
1030 ?({#{(#1)}{({#1})}}{}%
1031 ?({#{(#1)}{({#1})}}{}%
1032 }]{\pst@object}}%
1033 % \end{macrocode}
1034 % \ifGERMAN
1035 % Mehrfaches testweises Setzen von Tabelleninhalten durch ``tabularx''
1036 % verhindern.
1037 % \fi
1038 % \ifENGLISH
1039 % Prevent multiple test-wise setting of table contents by ``tabularx''.
1040 % \fi
1041 % \changes{v1.1c}{2005/04/17}{Special support for ``tabularx''. (RN)}
1042 % \changes{v1.1q}{2008/02/17}{Problem with ``tabularx'' and
1043 % ``threeparttabel'' solved. (RN)}
1044 % \begin{macrocode}
1045 \@ifundefined{tabularx}{}{%
1046 \newcolumntype{X}{c}%
1047 \expandafter\let\expandafter\tabularx\csname tabular*\endcsname
1048 \expandafter\let\expandafter\endtabularx\csname endtabular*\endcsname
1049 }%
1050 % \end{macrocode}
1051 % \changes{v1.1l}{2006/02/18}{Support for the package ``psfragx''. (RN)}
1052 % \ifGERMAN
1053 % Unterst\"utzung von \cmd{\includegraphicx} aus dem Paket \pkgname{psfragx}.
1054 % \fi
1055 % \ifENGLISH
1056 % Support of \cmd{\includegraphicx} from the package \pkgname{psfragx}.
1057 % \fi
1058 % \begin{macrocode}
1059 \@ifundefined{pfx@includegraphicx}{}{%
1060 \PreviewMacro[{{}{}}]{\pfx@includegraphicx}}%
1061 }%
1062 % \end{macrocode}
1063 % \begin{macro}{\Gscale@@box}
1064 % \ifGERMAN
1065 % Skalieren verhindern.
1066 % \fi
1067 % \ifENGLISH
1068 % Disable scaling.
1069 % \fi
1070 % \changes{v1.1o}{2006/08/31}{Disable scaling. (RN)}
1071 % \begin{macrocode}
1072 \def\Gscale@@box#1#2#3{%
1073 \toks@{\mbox}%
1074 }%
1075 % \end{macrocode}
1076 % \end{macro}
1077 % \begin{macro}{\Ginclude@graphics}
1078 % \ifGERMAN
1079 % Alle Grafiken mit bekanntem Format (z.\,B. EPS-Dateien) werden normal
1080 % verarbeitet, was in diesem Modus bedeutet, dass sie der
1081 % Preview-Funktionalit\"at unterliegen. Andere Grafiken (z.\,B. PDF-Dateien)
1082 % werden ignoriert.
1083 % \fi
1084 % \ifENGLISH
1085 % All graphics content of well known format (for instance EPS files) is
1086 % treated in a regular way, which in this mode denotes that it is subject
1087 % to \pkgname{preview} functions. Other graphics content (for instance PDF
1088 % files) is ignored.
1089 % \fi
1090 % \changes{v1.0k}{2005/02/23}{Prevent division by zero. (RN)}
1091 % \changes{v1.1h}{2005/06/26}{Check if inside of a PS-related
1092 % environment (correct graphic inclusion). (RN)}
1093 % \changes{v1.1i}{2005/06/29}{Correction of the inside check. (RN/HjG)}
1094 % \begin{macrocode}
1095 \def\Ginclude@graphics#1{%
1096 \ifpr@outer
1097 % \end{macrocode}
1098 % \ifGERMAN
1099 % Im allgemeinen Fall sollen pdf\TeX-Grafiken bevorzugt werden (Einf\"ugen
1100 % erst im pdf\TeX-Modus). Ist nur eine DVIPS-Graphik vorhanden, dann
1101 % wirkt wieder die Originaldefintion und Registrierung beim
1102 % preview-Paket muss erfolgen.
1103 % \fi
1104 % \ifENGLISH
1105 % Generally pdf\TeX\ supported graphics formats are intended to be preferred
1106 % (inclusion in final pdf\TeX\ run). If it's a \PS\ type graphics, then the
1107 % original definition is in function again and registration for the
1108 % \pkgname{preview} package is necessary in order to convert this \PS\ type
1109 % graphics into PDF.
1110 % \fi
1111 % \begin{macrocode}
1112 \ppf@is@pdfTeX@graphic{#1}{\ppf@other@extensions}{\Gin@extensions}%
1113 % \end{macrocode}
1114 % \ifGERMAN
1115 % Dummy-Box, um Division durch Null bei Skalierung/Rotation zu
1116 % vermeiden. Wird ansonsten ignoriert.
1117 % \fi
1118 % \ifENGLISH
1119 % Dummy box to prevent a division by zero while scaling or rotating.
1120 % Otherwise ignored.
1121 % \fi
1122 % \begin{macrocode}
1123 {\rule{10pt}{10pt}}%
1124 {\ppf@Ginclude@graphics{#1}}%
1125 \else
1126 % \end{macrocode}
1127 % \ifGERMAN
1128 % Innerhalb von PS-Umgebungen (\texttt{pspicture} usw.) muss sich
1129 % \cmd{\includegraphics} wie die Originaldefinition verhalten (nur die
1130 % DVIPS-Graphik-Typen sind g\"ultig).
1131 % \fi
1132 % \ifENGLISH
1133 % Inside a \PS\ environment (\env{pspicture} etc.) \cmd{\includegraphics} has
1134 % to behave as in its original definition (only DVIPS supported graphics
1135 % formats are allowed).
1136 % \fi
1137 % \begin{macrocode}
1138 \ppf@Ginclude@graphics{#1}%
1139 \fi
1140 }%
1141 % \end{macrocode}
1142 % \end{macro}
1143 % \begin{macrocode}
1144 \PreviewMacro[{{}}]{\ppf@Ginclude@graphics}%
1145 \let\pdfliteral\@gobble%
1146 \or
1147 % \end{macrocode}
1148 % \ifGERMAN
1149 % \subsection{pdf\LaTeX\ mode (pdf output)}
1150 % Ist die Datei \cmd{\PDFcontainer} (default: \meta{\cmd{\jobname}}|-pics.pdf|)
1151 % vorhanden, so wird der Inhalt der Umgebungen |pspicture| und
1152 % |postscript| ignoriert.
1153 % Stattdessen wird die zugeh\"orige Grafik aus der Datei \cmd{\PDFcontainer}
1154 % eingebunden.
1155 % \fi
1156 % \ifENGLISH
1157 % \subsection{pdf\LaTeX\ mode (PDF output)}
1158 % When the \cmd{\PDFcontainer} file (default:
1159 % \meta{\cmd{\jobname}}|-pics.pdf|) exists, the contents of the
1160 % environments \env{pspicture} and \env{postscript} is ignored. Instead the
1161 % corresponding graphics from the \cmd{\PDFcontainer} file is used.
1162 % \fi
1163 % \begin{macrocode}
1164 \PackageInfo{pst-pdf}{MODE: \ppf@TeX@mode\space (pdfTeX mode)}%
1165 % \end{macrocode}
1166 % \ifGERMAN
1167 % Verhindert pdf\TeX{}s Warnung \texttt{Non-PDF special ignored!}.
1168 % \fi
1169 % \ifENGLISH
1170 % Prevent pdf\TeX's message \texttt{Non-PDF special ignored!}.
1171 % \fi
1172 % \changes{v1.2d}{2017/06/22}{\cmd{\c@lor@to@ps} must not be undefined before
1173 % loading `PSTricks'}
1174 % \begin{macrocode}
1175 \if@ppf@PST@used
1176 \let\ppf@temp\AtBeginDvi\let\AtBeginDvi\@gobble
1177 \def\c@lor@to@ps#1 #2\@@{}%
1178 \RequirePackage{pstricks}\let\AtBeginDvi\ppf@temp
1179 \fi
1180 % \end{macrocode}
1181 % \begin{macrocode}
1182 \@temptokena{%
1183 \let\Gin@PS@file@header\@gobble\let\Gin@PS@literal@header\@gobble
1184 \let\Gin@PS@raw\@gobble\let\Gin@PS@restored\@gobble
1185 \@ifundefined{PSTricksLoaded}{}{%
1186 % \end{macrocode}
1187 % \ifGERMAN
1188 % F\"ur PSTricks $<$ 2.0 n\"otig.
1189 % \fi
1190 % \ifENGLISH
1191 % Necessary if PSTricks $<$ 2.0.
1192 % \fi
1193 % \begin{macrocode}
1194 \PSTricksOff%
1195 \def\c@lor@to@ps#1 #2\@@{}%
1196 }%
1197 }%
1198 % \end{macrocode}
1199 % \ifGERMAN
1200 % \PS-Ausgabe jetzt verhindern und sp\"ater noch einmal.
1201 % \fi
1202 % \ifENGLISH
1203 % \PS\ output is now inhibited and later once again.
1204 % \fi
1205 % \begin{macrocode}
1206 \the\@temptokena%
1207 \expandafter\AtBeginDocument\expandafter
1208 {\the\@temptokena\@temptokena{}}%
1209 \@ifundefined{PSTricksLoaded}{}{%
1210 % \end{macrocode}
1211 % \ifGERMAN
1212 % Zum Parsen der Argumente von PSTricks' \cmd{\pst@object} laden wir
1213 % \pkgname{preview} im active-Modus, restaurieren aber die
1214 % standardm\"a{\ss}igen Definitionen von \cmd{\output}
1215 % und \cmd{\shipout}. \cmd{\pr@startbox} und
1216 % \cmd{\pr@endbox} dienen hier nur dazu, um \cmd{\pst@object} wirkungslos
1217 % zu machen und stattdessen die zugeh\"orige Grafik aus der Containerdatei
1218 % einzuladen. Derzeit werden nur maximal 3 optionale Pa\-ra\-meter in runden
1219 % Klammern am Ende von \cmd{\pst@object} unterst\"utzt, was f\"ur viele,
1220 % aber nicht f\"ur alle F\"alle ausreichend ist.
1221 % \fi
1222 % \ifENGLISH
1223 % To parse the arguments of PSTricks' \cmd{\pst@object} we load
1224 % \pkgname{preview} in active mode, but restore the default definitions of
1225 % \cmd{\output} and \cmd{\shipout}. \cmd{\pr@startbox} and \cmd{\pr@endbox}
1226 % serve here only to disable \cmd{\pst@object} and to load the
1227 % corresponding graphics from the \cmd{\PDFcontainer} file. At present a
1228 % maximum of three optional parameters in round braces (parenthesis) at the
1229 % end of \cmd{\pst@object} is supported, which is sufficient, but not
1230 % always enough.
1231 % \fi
1232 % \changes{v1.1b}{2005/04/09}{Ignore the call of
1233 % \cmd{\nofiles} inside of \pkgname{preview}. (RN)}
1234 % \changes{v1.1p}{2007/07/27}{\cmd{\let}\cmd{\output}\cmd{\@gobble}
1235 % before loading of ``preview'' added. (RN)}
1236 % \changes{v1.1t}{2008/09/09}{Remove the line
1237 % ``\cmd{\let}\cmd{\output}\cmd{\@gobble}'' because of bad side
1238 % effects. (RN)}
1239 % \begin{macrocode}
1240 \newtoks\ppf@output
1241 \ppf@output\expandafter{\the\output}%
1242 \let\ppf@nofiles=\nofiles \let\nofiles=\relax
1243 \let\ppf@shipout=\shipout
1244 \RequirePackage[active]{preview}[2005/01/29]%
1245 \let\shipout=\ppf@shipout \let\ppf@shipout=\relax
1246 \let\nofiles=\ppf@nofiles \let\ppf@nofiles=\relax
1247 \output\expandafter{\the\ppf@output} \ppf@output{}%
1248 % \end{macrocode}
1249 % \ifGERMAN
1250 % \cmd{\pr@startbox}, \cmd{\pr@endbox}: Gegen\"uber Originaldefinition
1251 % vereinfacht.
1252 % \fi
1253 % \ifENGLISH
1254 % \cmd{\pr@startbox}, \cmd{\pr@endbox}: simpler over original definitions.
1255 % \fi
1256 % \begin{macrocode}
1257 \long\def\pr@startbox#1#2{%
1258 \ifpr@outer
1259 \toks@{#2}%
1260 \edef\pr@cleanup{\the\toks@}%
1261 \setbox\@tempboxa\vbox\bgroup
1262 \everydisplay{}%
1263 \pr@outerfalse%
1264 \expandafter\@firstofone
1265 \else
1266 \expandafter\@gobble
1267 \fi{#1}}%
1268 \def\pr@endbox{%
1269 \egroup
1270 \setbox\@tempboxa\box\voidb@x
1271 \ppf@@getpicture
1272 \pr@cleanup}%
1273 % \end{macrocode}
1274 % \ifGERMAN
1275 % (Siehe auch identische Definition im DVI-Modus.)
1276 % \fi
1277 % \ifENGLISH
1278 % (See also the identical definition in DVI mode.)
1279 % \fi
1280 % \begin{macrocode}
1281 \AtBeginDocument{%
1282 \@ifundefined{pst@object}{}%
1283 {%
1284 \PreviewMacro[{{}*[]%
1285 ?\bgroup{#{#1}{{#1}}}{}%
1286 ?\bgroup{#{#1}{{#1}}}{}%
1287 ?({#{(#1)}{({#1})}}{}%
1288 ?({#{(#1)}{({#1})}}{}%
1289 ?({#{(#1)}{({#1})}}{}%
1290 }]{\pst@object}}%
1291 }%
1292 }%
1293 % \end{macrocode}
1294 % \ifGERMAN
1295 % Es werden auch die im DVI-Modus erlaubten Endungen von Grafikdateien
1296 % ben\"otigt (Argument aus `dvips.def' -- 2017/06/20 -- kopiert).
1297 % \fi
1298 % \ifENGLISH
1299 % Too the supported file name extensions from DVI mode are needed.
1300 % (Argument copied from `dvips.def' -- 2017/06/20).
1301 % \fi
1302 % \changes{v1.2f}{2020/10/10}{No more loading of file `dvisps.def' (RN)}
1303 % \begin{macrocode}
1304 \def\ppf@other@extensions{.eps,.ps,.eps.gz,.ps.gz,.eps.Z,.mps}%
1305 % \end{macrocode}
1306 % \ifGERMAN
1307 % Dummy-Definition f\"ur die im DVI-Modus g\"ultigen Dateitypen.
1308 % \fi
1309 % \ifENGLISH
1310 % Dummy definition for in DVI mode supported file formats.
1311 % \fi
1312 % \begin{macrocode}
1313 \DeclareGraphicsRule{*}{eps}{*}{}%
1314 % \end{macrocode}
1315 % \begin{macrocode}
1316 \define@key{Gin}{innerframe}[true]{%
1317 \lowercase{\Gin@boolkey{#1}}{innerframe}}%
1318 \define@key{Gin}{frame}[true]{%
1319 \lowercase{\Gin@boolkey{#1}}{frame}}%
1320 \define@key{Gin}{ignore}[true]{%
1321 \lowercase{\Gin@boolkey{#1}}{ignore}}%
1322 \define@key{Gin}{frame@@}{%
1323 % \end{macrocode}
1324 % \ifGERMAN
1325 % (Nur intern zu benutzen!)
1326 % \fi
1327 % \ifENGLISH
1328 % (For internal use only!)
1329 % \fi
1330 % \begin{macrocode}
1331 \edef\@tempa{\toks@{\noexpand\frame{\the\toks@}}}%
1332 \ifcase#1\relax
1333 \ifGin@innerframe\else\let\@tempa\relax\fi
1334 \or
1335 \ifGin@frame\else\let\@tempa\relax\fi
1336 \fi
1337 \@tempa%
1338 }%
1339 \define@key{Gin}{showname}[true]{%
1340 \lowercase{\Gin@boolkey{#1}}{showname}}%
1341 \define@key{Gin}{namefont}{%
1342 \begingroup
1343 \@temptokena\expandafter{\ppf@namefont#1}%
1344 \edef\x{\endgroup\def\noexpand\ppf@namefont{\the\@temptokena}}%
1345 \x%
1346 }%
1347 \newcommand*\ppf@filename{}%
1348 \newcommand*\ppf@namefont{\tiny\ttfamily}%
1349 \newcommand*\ppf@Gin@keys{}%
1350 \let\ppf@Gin@setfile\Gin@setfile
1351 % \end{macrocode}
1352 % \begin{macro}{\Gin@setfile}
1353 % \ifGERMAN
1354 % Realen Dateinamen und ggf. Seitenzahl zur sp\"ateren Verwendung merken.
1355 % \fi
1356 % \ifENGLISH
1357 % Save real file name and, if applicable, page number for later use.
1358 % \fi
1359 % \changes{v1.0k}{2005/02/23}{Show also the pagenumber if exists. (RN)}
1360 % \begin{macrocode}
1361 \def\Gin@setfile#1#2#3{\ppf@Gin@setfile{#1}{#2}{#3}%
1362 \xdef\ppf@filename{%
1363 #3\ifx\Gin@page\@empty\else(\Gin@page)\fi}}%
1364 % \end{macrocode}
1365 % \end{macro}
1366 % \begin{macro}{\Gin@ii}
1367 % \ifGERMAN
1368 % Auswertung der Optionen ``frame'', ``ignore'' usw. sowie weiterer
1369 % Spezialf\"alle.
1370 % \fi
1371 % \ifENGLISH
1372 % Examine the options ``frame'', ``ignore'', etc. as soon as other
1373 % special cases.
1374 % \fi
1375 % \changes{v1.0s}{2005/03/28}{Rewritten. (RN)}
1376 % \begin{macrocode}
1377 \def\Gin@ii[#1]#2{%
1378 \begingroup
1379 % \end{macrocode}
1380 % \ifGERMAN
1381 % Der Wert \cmd{\ifGin@innerframe} muss bereits vor Zeichnen des
1382 % inneren Rahmens bekannt sein. Die Werte f\"ur \cmd{\ifGin@showname} und
1383 % \cmd{\ppf@namefont} m\"ussen auch nach Darstellung der Grafik verf\"ugbar
1384 % sein. Daher durch eine Gruppe gesch\"utzt vorher Auswertung der Optionen.
1385 % \fi
1386 % \ifENGLISH
1387 % The value of \cmd{\ifGin@innerframe} has to be known before the inner
1388 % frame is drawn. The values for \cmd{\ifGin@showname} and
1389 % \cmd{\ppf@namefont} need to be available after rendering the graphics
1390 % too. Thus beforehand and protected inside a group examine the options.
1391 % \fi
1392 % \begin{macrocode}
1393 \@temptokena{#1}\def\ppf@tempb{#2}%
1394 % \end{macrocode}
1395 % \ifGERMAN
1396 % Leerer Dateiname beim Aufruf von \cmd{\usepicture} aus.
1397 % \fi
1398 % \ifENGLISH
1399 % Finds empty file name when calling \cmd{\usepicture}.
1400 % \fi
1401 % \begin{macrocode}
1402 \ifx\ppf@tempb\@empty\else
1403 \ppf@is@pdfTeX@graphic{#2}{\Gin@extensions}{\ppf@other@extensions}%
1404 % \end{macrocode}
1405 % \ifGERMAN
1406 % Grafiken aus Containerdatei sind bereits skaliert usw. Nicht noch
1407 % einmal, daher optionalen Parameter ignorieren.
1408 % \fi
1409 % \ifENGLISH
1410 % Graphics out of \cmd{\PDFcontainer} are complete -- scaled, rotated, etc.
1411 % Don't apply these things again and therefore ignore the optional parameters.
1412 % \fi
1413 % \changes{v1.1v}{2008/10/09}{Key settings only for pdf graphics. (RN)}
1414 % \begin{macrocode}
1415 {%
1416 \setkeys{Gin}{#1}%
1417 \ifx\ppf@tempb\PDFcontainer
1418 \@temptokena{page=\Gin@page}%
1419 \fi
1420 }%
1421 {%
1422 \refstepcounter{pspicture}%
1423 \@temptokena{page=\the\c@pspicture}\def\ppf@tempb{\PDFcontainer}%
1424 }%
1425 \fi
1426 \ifGin@ignore\else
1427 % \end{macrocode}
1428 % \ifGERMAN
1429 % ``|frame@@=0|''\,$=$\,innerer Rahmen, ``|frame@@=1|''\,$=$\,\"au{\ss}erer
1430 % Rahmen.
1431 % \fi
1432 % \ifENGLISH
1433 % ``|frame@@=0|''\,$=$\,inner frame, ``|frame@@=1|''\,$=$\,outer frame.
1434 % \fi
1435 % \begin{macrocode}
1436 \edef\@tempa{\noexpand\ppf@Gin@ii[frame@@=0,\the\@temptokena,%
1437 frame@@=1]{\ppf@tempb}}%
1438 \@tempa%
1439 \ifGin@showname
1440 \ppf@namefont%
1441 \raisebox{-\ht\strutbox}[0pt][0pt]{\llap{\ppf@filename}}%
1442 \gdef\ppf@filename{}%
1443 \fi
1444 \fi
1445 \endgroup
1446 }%
1447 % \end{macrocode}
1448 % \end{macro}
1449 % \begin{macrocode}
1450 \IfFileExists{\PDFcontainer}%
1451 {%
1452 % \end{macrocode}
1453 % \begin{macro}{\ppf@container@max}
1454 % \ifGERMAN
1455 % Die Anzahl der in der Containerdatei enthaltenen Seiten.
1456 % \fi
1457 % \ifENGLISH
1458 % The number of pages as contained in \cmd{\PDFcontainer} file.
1459 % \fi
1460 % \begin{macrocode}
1461 \pdfximage{\PDFcontainer}%
1462 \edef\ppf@container@max{\the\pdflastximagepages}%
1463 % \end{macrocode}
1464 % \end{macro}
1465 % \begin{macrocode}
1466 \AtEndDocument{%
1467 \ifnum\c@pspicture>\z@
1468 % \end{macrocode}
1469 % \ifGERMAN
1470 % Warnung ist nur sinnvoll, wenn \"uberhaupt Grafiken ben\"otigt
1471 % wurden.
1472 % \fi
1473 % \ifENGLISH
1474 % A warning only makes sense when a graphics is needed at all.
1475 % \fi
1476 % \begin{macrocode}
1477 \ifnum\c@pspicture=\ppf@container@max\else
1478 \PackageWarningNoLine{pst-pdf}{%
1479 `\PDFcontainer' contains \ppf@container@max\space pages
1480 \MessageBreak but \the\c@pspicture\space pages are requested:
1481 \MessageBreak File `\PDFcontainer' is no more valid!
1482 \MessageBreak Recreate it
1483 }%
1484 \fi
1485 \fi
1486 }%
1487 }%
1488 {%
1489 \def\ppf@container@max{0}%
1490 \AtEndDocument{%
1491 \ifnum\c@pspicture>\z@
1492 \filename@parse{\PDFcontainer}%
1493 \PackageWarningNoLine{pst-pdf}{%
1494 File `\PDFcontainer' not found. \MessageBreak
1495 Use the following commands to create it: \MessageBreak
1496 ----------------------------------------------------
1497 \MessageBreak
1498 latex \jobname.tex\MessageBreak
1499 dvips -o \[email protected] \jobname.dvi\MessageBreak
1500 ps2pdf \[email protected]\MessageBreak
1501 ----------------------------------------------------
1502 }%
1503 \fi
1504 }%
1505 }%
1506 % \end{macrocode}
1507 % \begin{macro}{\ppf@isnum}
1508 % \ifGERMAN
1509 % Ist Parameter |#1| numerisch, werden Anweisungen in |#2|
1510 % sonst die in |#3| ausgef\"uhrt (siehe \pkgname{bibtopic.sty}).
1511 % \fi
1512 % \ifENGLISH
1513 % If parameter |#1| is numeric, the instructions in |#2|,
1514 % otherwise those in |#3| are executed (see \pkgname{bibtopic.sty}).
1515 % \fi
1516 % \begin{macrocode}
1517 \newcommand\ppf@isnum[1]{%
1518 \if!\ifnum9<1#1!\else_\fi\expandafter\@firstoftwo
1519 \else\expandafter\@secondoftwo\fi}%
1520 % \end{macrocode}
1521 % \end{macro}
1522 % \begin{environment}{psmatrix}
1523 % \changes{v1.0h}{2005/02/15}{Based no more on the comment environment
1524 % from the verbatim package. (RN)}
1525 % \begin{environment}{pspicture}
1526 % \changes{v1.1g}{2005/05/28}{pspicture environment
1527 % must still parse its arguments. (RN/HjG)}
1528 % \ifGERMAN
1529 % Beide Umgebungen ignorieren ihren Inhalt und laden stattdessen die
1530 % zugeh\"orige Grafik aus der Containerdatei. Auf den Wert des dabei
1531 % benutzten Z\"ahlers (|pspicture|)
1532 % kann per \cmd{\label}/\cmd{\ref} zugegriffen werden.
1533 % \fi
1534 % \ifENGLISH
1535 % Both environments ignore their contents and load instead the corresponding
1536 % graphics out of the \cmd{\PDFcontainer} file. The value of the herein used
1537 % |pspicture| counter's value can be used in \cmd{\label}/\cmd{\ref}.
1538 % \fi
1539 % \begin{environment}{postscript}
1540 % \changes{v1.1d}{2005/04/19}{Support for PSTricks environment
1541 % ``psmatrix''. (RN)}
1542 % \changes{v1.1g}{2005/05/28}{``psmatrix'' environment
1543 % (preserve math mode). (RN/HjG)}
1544 % \begin{macrocode}
1545 \newcommand*\ppf@set@mode{}%
1546 \newcommand*\ppf@test@mmode{%
1547 \ifmmode
1548 \ifinner
1549 \let\ppf@set@mode=$%
1550 \else
1551 \def\ppf@set@mode{$$}%
1552 \fi
1553 \else
1554 \let\ppf@set@mode=\@empty
1555 \fi
1556 }
1557 % \end{macrocode}
1558 % \changes{v1.1t}{2008/09/09}{Using \pkgname{environ} the environment
1559 % \env{postscript} is now simple and more robust. (RN)}
1560 % \begin{macrocode}
1561 \RequirePackage{environ}%
1562 \newenvironment{postscript}[1][]{%
1563 \def\@tempa{postscript}%
1564 \ifx\@tempa\@currenvir
1565 \def\ppf@Gin@keys{#1}%
1566 \else
1567 \def\ppf@Gin@keys{}%
1568 \fi
1569 \ppf@@getpicture%
1570 \Collect@Body\@gobble}{}%
1571 \AtBeginDocument{%
1572 \@ifundefined{PSTricksLoaded}{}{%
1573 \def\pst@@@picture[#1](#2,#3)(#4,#5){\postscript}%
1574 \def\endpspicture{\endpostscript\endgroup}%
1575 \@ifundefined{psmatrix}{}{%
1576 \let\psmatrix=\postscript
1577 \let\endpsmatrix=\endpostscript}%
1578 }%
1579 \@ifundefined{pfx@includegraphicx}{}{%
1580 % \end{macrocode}
1581 % \ifGERMAN
1582 % Die im pdf\TeX-Modus unn\"utze Umdefinition von
1583 % \cmd{\includegraphics} (Paket \pkgname{psfragx}) f\"uhrt zu zweifachem
1584 % Einf\"ugen des Ergebnisses, weshalb die Originaldefition wiederhergestellt
1585 % wird.
1586 % \fi
1587 % \ifENGLISH
1588 % The useless redefinition of \cmd{\includegraphics} in pdf\TeX\ mode
1589 % (package \pkgname{psfragx}) is leading to double insertion of the result.
1590 % We go back to the original meaning.
1591 % \fi
1592 % \begin{macrocode}
1593 \let\includegraphics=\pfx@includegraphics
1594 \def\pfx@includegraphicx#1#2{\ppf@@getpicture}%
1595 }%
1596 }%
1597 % \end{macrocode}
1598 % \end{environment}
1599 % \end{environment}
1600 % \end{environment}
1601 % \begin{macro}{\savepicture}
1602 % \changes{v1.0f}{2005/02/04}{New macro \cmd{\savepspicture}. (RN)}
1603 % \ifGERMAN
1604 % Speichert die Nummer der aktuellen Grafik in einem Makro mit Namen
1605 % \cmd{\ppf@@@}|#1|.
1606 % \fi
1607 % \ifENGLISH
1608 % Saves the recent graphics' number in a macro named \cmd{\ppf@@@}|#1|.
1609 % \fi
1610 % \begin{macrocode}
1611 \def\savepicture#1{%
1612 \expandafter\xdef\csname ppf@@@#1\endcsname{\the\pdflastximage}}%
1613 % \end{macrocode}
1614 % \end{macro}
1615 % \begin{macro}{\usepicture}
1616 % \changes{v1.0f}{2005/02/04}{New macro \cmd{\usepspicture}. Useful
1617 % for putting a PSTricks graphic in a box or something else. (RN)}
1618 % \changes{v1.0g}{2005/02/12}{Now \cmd{\usepspicture} does accept a
1619 % numerical parameter. (RN)}
1620 % \changes{v1.0q}{2005/03/20}{Now \cmd{\usepspicture} works for all
1621 % kind of graphics. (RN)}
1622 % \ifGERMAN
1623 % F\"ugt Grafik mit symbolischem Namen |#2| ein. Der Name
1624 % muss vorher mit \cmd{\savepicture}\marg{Name} vereinbart worden
1625 % sein. Statt des Namens kann auch eine Zahl angegeben werden, die dann
1626 % direkt eine Grafik aus der Containerdatei adressiert.
1627 % Der optionale Parameter |#1| entspricht dem bei \cmd{\includegraphics}.
1628 % \fi
1629 % \ifENGLISH
1630 % Inserts graphics with symbolic name |#2|. This name has to be declared
1631 % beforehand in \cmd{\savepicture}\marg{name}. Instead of a name a number
1632 % can be used too, which directly addresses a graphics in the
1633 % \cmd{\PDFcontainer} file. The optional parameter |#1| corresponds to the
1634 % one in \cmd{\includegraphics}.
1635 % \fi
1636 % \begin{macrocode}
1637 \renewcommand*\usepicture[2][]{%
1638 \@ifundefined{ppf@@@#2}%
1639 {%
1640 \ppf@isnum{#2}%
1641 {\ppf@getpicture{#1}{#2}}%
1642 {\@latex@error{picture `#2' undefined}\@ehc}%
1643 }%
1644 {%
1645 \begingroup
1646 \def\Ginclude@graphics##1{%
1647 \xdef\ppf@filename{#2}%
1648 \setbox\z@\hbox{\pdfrefximage\@nameuse{ppf@@@#2}}%
1649 \Gin@nat@height\ht\z@ \Gin@nat@width\wd\z@
1650 \def\Gin@llx{0}\let\Gin@lly\Gin@llx
1651 \Gin@defaultbp\Gin@urx{\Gin@nat@width}%
1652 \Gin@defaultbp\Gin@ury{\Gin@nat@height}%
1653 \Gin@bboxtrue\Gin@viewport@code%
1654 \Gin@nat@height\Gin@ury bp%
1655 \advance\Gin@nat@height-\Gin@lly bp%
1656 \Gin@nat@width\Gin@urx bp%
1657 \advance\Gin@nat@width-\Gin@llx bp%
1658 \Gin@req@sizes%
1659 \ht\z@\Gin@req@height \wd\z@\Gin@req@width
1660 \leavevmode\box\z@}%
1661 \define@key{Gin}{type}{}%
1662 \includegraphics[scale=1,#1]{}%
1663 \endgroup
1664 }}%
1665 % \end{macrocode}
1666 % \end{macro}
1667 % \begin{macro}{\ppf@getpicture}
1668 % \ifGERMAN
1669 % F\"ugt die Seite (Grafik) mit Nummer |#2| aus der Containerdatei
1670 % ein. Parameter |#1|: Optionen wie bei \cmd{\includegraphics}.
1671 % \fi
1672 % \ifENGLISH
1673 % Inserts the page (graphics) with number |#2| from the \cmd{\PDFcontainer}
1674 % file. Parameter |#1|: any option as in \cmd{\includegraphics}.
1675 % \fi
1676 % \begin{macrocode}
1677 \newcommand*\ppf@getpicture[2]{%
1678 \@tempcnta=#2\relax%
1679 \ifnum\@tempcnta>\ppf@container@max
1680 \PackageWarningNoLine{pst-pdf}{%
1681 pspicture No. \the\@tempcnta\space undefined}%
1682 \else
1683 \includegraphics[draft=\ppf@draft,#1,page=\the\@tempcnta]%
1684 {\PDFcontainer}%
1685 \fi
1686 \gdef\ppf@Gin@keys{}}%
1687 % \end{macrocode}
1688 % \end{macro}
1689 % \begin{macro}{\ppf@@getpicture}
1690 % \ifGERMAN
1691 % F\"ugt die n\"achste Seite (Grafik) aus der Containerdatei ein.
1692 % \fi
1693 % \ifENGLISH
1694 % Inserts next page (graphics) from the \cmd{\PDFcontainer} file.
1695 % \fi
1696 % \begin{macrocode}
1697 \newcommand*\ppf@@getpicture{%
1698 \ifpr@outer
1699 \refstepcounter{pspicture}%
1700 \expandafter\ppf@getpicture\expandafter{\ppf@Gin@keys}%
1701 {\the\c@pspicture}%
1702 \fi}%
1703 % \end{macrocode}
1704 % \end{macro}
1705 %
1706 % \begin{environment}{pst-pdf-defs}
1707 % \ifGERMAN
1708 % Umgebung, die keine eigene Gruppe aufmacht. Innerhalb der Umgebung
1709 % bekommt das Zeichen |&| den Kategoriecode "`other"'. Gedacht f\"ur
1710 % eigene Makrodefinitionen, die z.\,B.\ eine \env{psmatrix} enthalten.
1711 % \fi
1712 % \ifENGLISH
1713 % Environment without grouping. The character |&| has the catcode
1714 % ``other''. Useful for user-defined macro definitions with e.\,g.\ %
1715 % \env{psmatrix} inside.
1716 % \fi
1717 % \begin{macrocode}
1718 \renewenvironment*{pst-pdf-defs}%
1719 {%
1720 \endgroup
1721 % ??? \@currenvline
1722 \chardef\ppf@temp=\catcode`\&%
1723 \@makeother\&%
1724 }{%
1725 \catcode`\&=\ppf@temp
1726 \begingroup
1727 \def\@currenvir{pst-pdf-defs}%
1728 }
1729 % \end{macrocode}
1730 % \end{environment}
1731 %
1732 % \begin{macrocode}
1733 \else
1734 % \end{macrocode}
1735 % \ifGERMAN
1736 % \subsection{Inactiver Modus}
1737 % Es werden nur die Pakete \pkgname{pstricks} und \pkgname{graphicx} geladen
1738 % -- keine weitere Einflussnahme. Die Paketoption
1739 % "`|inactive|"' sowie der V\TeX-Compiler erzwingen diesen Modus.
1740 % \fi
1741 % \ifENGLISH
1742 % \subsection{Inactive Mode}
1743 % Only the packages \pkgname{pstricks} and \pkgname{graphicx} are loaded
1744 % -- no further exertion of influence. The package option
1745 % ``|inactive|'' as soon as the V\TeX compiler force this mode.
1746 % \fi
1747 % \begin{macrocode}
1748 \PackageInfo{pst-pdf}{MODE: \ppf@TeX@mode\space (inactive mode)}%
1749 \newenvironment{postscript}[1][]{\ignorespaces}{}%
1750 \let\ppf@is@pdfTeX@graphic\relax
1751 \fi
1752 % \end{macrocode}
1753 % \changes{v1.0f}{2005/02/04}{Config file loading added. (RN)}
1754 % \begin{macrocode}
1755 \InputIfFileExists{pst-pdf.cfg}{%
1756 \PackageInfo{pst-pdf}{Local config file pst-pdf.cfg used}}{}%
1757 %</package>
1758 % \end{macrocode}
1759 %
1760 % \Finale
1761 %\endinput
1762 %
1763 % And here comes the example documents ...
1764 %<*example>
1765 %% Process this file with the scripts `ps4pdf' or `ps4pdf.bat' or call
1766 %%
1767 %% latex pst-pdf-example.tex
1768 %% dvips -Ppdf -o pst-pdf-example-pics.ps pst-pdf-example.dvi
1769 %% ps2pdf -dAutoRotatePages=/None pst-pdf-example-pics.ps pst-pdf-example-pics.pdf
1770 %% pdflatex pst-pdf-example.tex
1771 %%
1772 \listfiles\errorcontextlines=100\relax
1773 \documentclass[12pt]{article}
1774
1775 %% before `psfrag'!
1776 \usepackage[displaymath,dvipsnames]{pst-pdf}
1777 %%\usepackage[displaymath,dvipsnames,notightpage]{pst-pdf}
1778
1779 \usepackage{pst-node,pst-tree}
1780
1781 \usepackage{psfrag,tabularx}
1782
1783 \pagestyle{empty}
1784
1785 \begin{pst-pdf-defs}%
1786
1787 %% This definition must be within the pst-pdf-defs environment!
1788 \newcommand*\mytree{%
1789 \begin{psmatrix}[rowsep=.2cm,colsep=2cm]
1790 & & E \\
1791 & A & \\
1792 & & F \\
1793 $\bullet$ & & \\
1794 & & G \\
1795 & B & \\
1796 & & H \\
1797 \scriptsize
1798 \psset{shortput=nab,arrows=->,labelsep=2pt,nodesep=2pt,nrot=:U}
1799
1800 \ncline{4,1}{2,2}\ncput*{$0,2$}
1801 \ncline{4,1}{6,2}\ncput*{$x$}
1802
1803 \ncline{2,2}{1,3}\ncput*{$0,3$}
1804 \ncline{2,2}{3,3}\ncput*{$y$}
1805
1806 \ncline{6,2}{5,3}\ncput*{$z$}
1807 \ncline{6,2}{7,3}\ncput*{$0,8$}
1808 \end{psmatrix}%
1809 }
1810
1811 \end{pst-pdf-defs}%
1812
1813 %% This works without the pst-pdf-defs environment!
1814 \newcommand*\mymatrix{%
1815 \begin{postscript}
1816 \[
1817 \begin{array}{rcl}
1818 a & b & c \\
1819 1 & 2 & 3 \\
1820 \end{array}
1821 \]
1822 \end{postscript}%
1823 }
1824
1825
1826 \begin{document}
1827
1828 \setkeys{Gin}{showname,frame}%
1829
1830 \psset{unit=0.0714\textwidth}% 1/14 * \textwidth
1831 \newpsobject{showgrid}{psgrid}{subgriddiv=1,griddots=10,gridlabels=6pt}
1832
1833 \newcommand*\BASEMARKER{\rule{.5em}{.4pt}}
1834
1835 \setlength\parindent{0pt}
1836
1837 \centering
1838
1839 \section*{\textsf{pst-pdf:}
1840 PSTricks and other PostScript code in pdf\LaTeX\ documents}
1841
1842 \vfill
1843
1844 \begin{pspicture}(-5.5,-5.25)(5.25,5.25)%
1845 %%\begin{pspicture}[trim=-.5 -.25 .25 .25,frame](-5,-5)(5,5)% PSTricks2
1846 \pscircle*[linecolor=Apricot]{5}
1847 \rput(0,0.5){\includegraphics[width=8\psxunit]{elephant}}
1848 \Huge\sffamily\bfseries
1849 \rput(-4.5,4.5){A} \rput(4.5,4.5){B}
1850 \rput(-4.5,-4.5){C}\rput(4.5,-4.5){D}
1851 \rmfamily
1852 \rput(0,-3.8){PSTricks}
1853 \rput(0,3.8){\LaTeX}
1854 \showgrid
1855 \end{pspicture}\savepicture{ps:A}
1856
1857 \vfill\null\newpage
1858
1859 \includegraphics[width=.475\textwidth]{insect1}
1860
1861 \vfill
1862
1863 \usepicture[width=.47\textwidth]{ps:A}
1864
1865 \includegraphics[width=.475\textwidth,frame=false,
1866 namefont={\Huge\itshape}]{knuth}
1867 \hfill
1868 \usepicture[angle=45,origin=bl,width=.475\textwidth,innerframe]{1}%
1869
1870 \vfill
1871
1872 \includegraphics[width=.47\textwidth]{psf-demo}
1873 \hfill
1874 \begin{psfrags}
1875 \psfragscanon
1876 \psfrag{x1}[br][ ]{\LaTeX} \psfrag{x2}[br][br]{\LaTeX}
1877 \psfrag{x3}[br][tl]{\LaTeX} \psfrag{x4}[br][Br]{\LaTeX}
1878 \psfrag{x5}[Br][ r][1.15][45]{\Huge\LaTeX}
1879 \psfrag{x6}[tl][ l][1.15][45]{\Huge\LaTeX}
1880 \includegraphics[width=.47\textwidth]{psf-demo}
1881 \end{psfrags}
1882
1883 \includegraphics[width=\textwidth,showname=false,frame=false]{insect15}
1884
1885 \bigskip
1886
1887 \Large
1888
1889 \begin{equation}
1890 \sigma(t)=\frac{1}{\sqrt{2\pi}}
1891 \int^t_0 e^{-x^2/2} dx
1892 \end{equation}
1893
1894 \clearpage
1895
1896 \setkeys{Gin}{showname=false,frame=false}%
1897
1898 { \Huge \renewcommand*\arraystretch{1.5}
1899
1900 \noindent
1901 \begin{tabularx}{\textwidth}{|@{}>{\centering}X@{}|} \hline
1902
1903 \psframebox*[fillcolor=green,framearc=.6]{HUGO}\BASEMARKER
1904 \fbox{\BASEMARKER GUSTAV} \tabularnewline
1905
1906 \begin{postscript}
1907 \psframebox*[fillcolor=green,framearc=.6]{HUGO}\BASEMARKER
1908 \fbox{\BASEMARKER GUSTAV}
1909 \end{postscript} \tabularnewline \hline
1910
1911 \end{tabularx}
1912
1913 }
1914
1915 \bigskip
1916
1917 \definecolor{pink}{rgb}{1, .75, .8}
1918 \renewcommand\psedge{\nccurve}
1919 \newcommand{\Female}[2][]{{\psset{linecolor=pink}\TR[#1]{\emph{#2}}}}
1920 \newcommand{\Male}[2][]{{\psset{linecolor=blue}\TR[#1]{#2}}}
1921
1922 \psset{nodesep=2pt,angleA=90,angleB=-90}
1923
1924 { \footnotesize
1925
1926 %% From: The \LaTeX\ Graphics Companion; first release.
1927 \pstree[treemode=U]{\Female{{\bfseries Matilde}}}{%
1928 \pstree{\Male{Sebastian}}{%
1929 \pstree{\Male[name=P]{Philip}}{\Male{Frederick}\Female{Ethel}}
1930 \pstree{\Female[name=W]{Mary}}{\Male{Lionel}\Female{Agnes}}}
1931 \pstree{\Female{Leonor}}{%
1932 \pstree{\Male[name=R]{Ra\'ul}}{\Male{Joaquim}\Female{J\'ulia}}
1933 \pstree{\Female[name=A]{Am\'elia}}{\Male{\'Alvaro}\Female{Augusta}}}
1934 }
1935
1936 \iffalse % --> Cannot work outside of a special environment!
1937 \psset{linecolor=green,doubleline=true,linestyle=dotted}
1938 \ncline{P}{W}\nbput{1940}
1939 \ncline{R}{A}\nbput{1954}
1940 \fi
1941 }
1942
1943 \bigskip
1944
1945 \psset{arrows=->,fillcolor=white,fillstyle=solid}
1946
1947 \footnotesize
1948
1949 \newcommand{\Show}[1]{\psshadowbox{#1}}
1950
1951 \begin{psmatrix}[mnode=r,ref=t,unit=.3]
1952 \psframebox[linestyle=none,framesep=.75]{%
1953 \begin{psmatrix}[name=A,ref=c]
1954 \Show{Stakeholder}
1955 \end{psmatrix}} &
1956 \psframebox[fillstyle=solid,fillcolor=pink,framesep=.95]{%
1957 \rule{1cm}{0pt}
1958 \begin{psmatrix}[ref=c]
1959 [name=B]\Show{Goal} & \Show{Criteria}\\
1960 \Show{Sub-goal} & \Show{Justification}
1961 \ncline{1,1}{1,2}
1962 \ncline{1,1}{2,2}
1963 \ncline{1,1}{2,1}\tlput{Strategy}
1964 \ncline{2,1}{2,2}
1965 \end{psmatrix}}
1966 \ncline[angleB=180]{A}{B}\naput[npos=.7]{Model}
1967 \end{psmatrix}
1968
1969 \begin{postscript}[angle=90,height=\textheight,frame=false]
1970
1971 \pstree[treemode=U]{\Female{{\bfseries Matilde}}}{%
1972 \pstree{\Male{Sebastian}}{%
1973 \pstree{\Male[name=P]{Philip}}{\Male{Frederick}\Female{Ethel}}
1974 \pstree{\Female[name=W]{Mary}}{\Male{Lionel}\Female{Agnes}}}
1975 \pstree{\Female{Leonor}}{
1976 \pstree{\Male[name=R]{Ra\'ul}}{\Male{Joaquim}\Female{J\'ulia}}
1977 \pstree{\Female[name=A]{Am\'elia}}{\Male{\'Alvaro}\Female{Augusta}}}
1978 }
1979
1980 \psset{linecolor=green,doubleline=true,linestyle=dotted}
1981 \ncline{P}{W}\nbput{1940}
1982 \ncline{R}{A}\nbput{1954}
1983
1984 \end{postscript}
1985
1986 \bigskip
1987
1988 \psset{arrows=-}
1989
1990 \begin{displaymath}
1991 \bordermatrix{%
1992 & A & B & C\cr
1993 & \rnode{D}{D} & E & \rnode{F}{F}\cr
1994 & G & H & I\cr
1995 & \rnode{J}{J} & K & M
1996 }
1997 \ncline[nodesep=-1em,linecolor=red]{D}{F}
1998 \ncline[nodesep=-1em,linecolor=red]{D}{J}
1999 \end{displaymath}
2000
2001 \bigskip
2002
2003 \mytree
2004
2005 \bigskip
2006
2007 \mymatrix
2008
2009 \end{document}
2010 %</example>