Debian Codegraph @

texmf-dist/doc/latex/pst-pdf/pst-pdf-example.tex

raw
1 %%
2 %% This is file `pst-pdf-example.tex',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% pst-pdf.dtx (with options: `example')
8 %%
9 %% This is a generated file.
10 %%
11 %% Copyright (C) 2004--2008 by Rolf Niepraschk <[email protected]>
12 %% and Hubert Gaesslein
13 %% 2008-- Rolf Niepraschk <[email protected]>
14 %%
15 %% This file may be distributed and/or modified under the conditions of
16 %% the LaTeX Project Public License, either version 1.2 of this license
17 %% or (at your option) any later version. The latest version of this
18 %% license is in:
19 %%
20 %% http://www.latex-project.org/lppl.txt
21 %%
22 %% and version 1.2 or later is part of all distributions of LaTeX version
23 %% 1999/12/01 or later.
24 %%
25 %% Process this file with the scripts `ps4pdf' or `ps4pdf.bat' or call
26 %%
27 %% latex pst-pdf-example.tex
28 %% dvips -Ppdf -o pst-pdf-example-pics.ps pst-pdf-example.dvi
29 %% ps2pdf -dAutoRotatePages=/None pst-pdf-example-pics.ps pst-pdf-example-pics.pdf
30 %% pdflatex pst-pdf-example.tex
31 %%
32 \listfiles\errorcontextlines=100\relax
33 \documentclass[12pt]{article}
34
35 %% before `psfrag'!
36 \usepackage[displaymath,dvipsnames]{pst-pdf}
37 %%\usepackage[displaymath,dvipsnames,notightpage]{pst-pdf}
38
39 \usepackage{pst-node,pst-tree}
40
41 \usepackage{psfrag,tabularx}
42
43 \pagestyle{empty}
44
45 \begin{pst-pdf-defs}%
46
47 %% This definition must be within the pst-pdf-defs environment!
48 \newcommand*\mytree{%
49 \begin{psmatrix}[rowsep=.2cm,colsep=2cm]
50 & & E \\
51 & A & \\
52 & & F \\
53 $\bullet$ & & \\
54 & & G \\
55 & B & \\
56 & & H \\
57 \scriptsize
58 \psset{shortput=nab,arrows=->,labelsep=2pt,nodesep=2pt,nrot=:U}
59
60 \ncline{4,1}{2,2}\ncput*{$0,2$}
61 \ncline{4,1}{6,2}\ncput*{$x$}
62
63 \ncline{2,2}{1,3}\ncput*{$0,3$}
64 \ncline{2,2}{3,3}\ncput*{$y$}
65
66 \ncline{6,2}{5,3}\ncput*{$z$}
67 \ncline{6,2}{7,3}\ncput*{$0,8$}
68 \end{psmatrix}%
69 }
70
71 \end{pst-pdf-defs}%
72
73 %% This works without the pst-pdf-defs environment!
74 \newcommand*\mymatrix{%
75 \begin{postscript}
76 \[
77 \begin{array}{rcl}
78 a & b & c \\
79 1 & 2 & 3 \\
80 \end{array}
81 \]
82 \end{postscript}%
83 }
84
85 \begin{document}
86
87 \setkeys{Gin}{showname,frame}%
88
89 \psset{unit=0.0714\textwidth}% 1/14 * \textwidth
90 \newpsobject{showgrid}{psgrid}{subgriddiv=1,griddots=10,gridlabels=6pt}
91
92 \newcommand*\BASEMARKER{\rule{.5em}{.4pt}}
93
94 \setlength\parindent{0pt}
95
96 \centering
97
98 \section*{\textsf{pst-pdf:}
99 PSTricks and other PostScript code in pdf\LaTeX\ documents}
100
101 \vfill
102
103 \begin{pspicture}(-5.5,-5.25)(5.25,5.25)%
104 %%\begin{pspicture}[trim=-.5 -.25 .25 .25,frame](-5,-5)(5,5)% PSTricks2
105 \pscircle*[linecolor=Apricot]{5}
106 \rput(0,0.5){\includegraphics[width=8\psxunit]{elephant}}
107 \Huge\sffamily\bfseries
108 \rput(-4.5,4.5){A} \rput(4.5,4.5){B}
109 \rput(-4.5,-4.5){C}\rput(4.5,-4.5){D}
110 \rmfamily
111 \rput(0,-3.8){PSTricks}
112 \rput(0,3.8){\LaTeX}
113 \showgrid
114 \end{pspicture}\savepicture{ps:A}
115
116 \vfill\null\newpage
117
118 \includegraphics[width=.475\textwidth]{insect1}
119
120 \vfill
121
122 \usepicture[width=.47\textwidth]{ps:A}
123
124 \includegraphics[width=.475\textwidth,frame=false,
125 namefont={\Huge\itshape}]{knuth}
126 \hfill
127 \usepicture[angle=45,origin=bl,width=.475\textwidth,innerframe]{1}%
128
129 \vfill
130
131 \includegraphics[width=.47\textwidth]{psf-demo}
132 \hfill
133 \begin{psfrags}
134 \psfragscanon
135 \psfrag{x1}[br][ ]{\LaTeX} \psfrag{x2}[br][br]{\LaTeX}
136 \psfrag{x3}[br][tl]{\LaTeX} \psfrag{x4}[br][Br]{\LaTeX}
137 \psfrag{x5}[Br][ r][1.15][45]{\Huge\LaTeX}
138 \psfrag{x6}[tl][ l][1.15][45]{\Huge\LaTeX}
139 \includegraphics[width=.47\textwidth]{psf-demo}
140 \end{psfrags}
141
142 \includegraphics[width=\textwidth,showname=false,frame=false]{insect15}
143
144 \bigskip
145
146 \Large
147
148 \begin{equation}
149 \sigma(t)=\frac{1}{\sqrt{2\pi}}
150 \int^t_0 e^{-x^2/2} dx
151 \end{equation}
152
153 \clearpage
154
155 \setkeys{Gin}{showname=false,frame=false}%
156
157 { \Huge \renewcommand*\arraystretch{1.5}
158
159 \noindent
160 \begin{tabularx}{\textwidth}{|@{}>{\centering}X@{}|} \hline
161
162 \psframebox*[fillcolor=green,framearc=.6]{HUGO}\BASEMARKER
163 \fbox{\BASEMARKER GUSTAV} \tabularnewline
164
165 \begin{postscript}
166 \psframebox*[fillcolor=green,framearc=.6]{HUGO}\BASEMARKER
167 \fbox{\BASEMARKER GUSTAV}
168 \end{postscript} \tabularnewline \hline
169
170 \end{tabularx}
171
172 }
173
174 \bigskip
175
176 \definecolor{pink}{rgb}{1, .75, .8}
177 \renewcommand\psedge{\nccurve}
178 \newcommand{\Female}[2][]{{\psset{linecolor=pink}\TR[#1]{\emph{#2}}}}
179 \newcommand{\Male}[2][]{{\psset{linecolor=blue}\TR[#1]{#2}}}
180
181 \psset{nodesep=2pt,angleA=90,angleB=-90}
182
183 { \footnotesize
184
185 %% From: The \LaTeX\ Graphics Companion; first release.
186 \pstree[treemode=U]{\Female{{\bfseries Matilde}}}{%
187 \pstree{\Male{Sebastian}}{%
188 \pstree{\Male[name=P]{Philip}}{\Male{Frederick}\Female{Ethel}}
189 \pstree{\Female[name=W]{Mary}}{\Male{Lionel}\Female{Agnes}}}
190 \pstree{\Female{Leonor}}{%
191 \pstree{\Male[name=R]{Ra\'ul}}{\Male{Joaquim}\Female{J\'ulia}}
192 \pstree{\Female[name=A]{Am\'elia}}{\Male{\'Alvaro}\Female{Augusta}}}
193 }
194
195 \iffalse % --> Cannot work outside of a special environment!
196 \psset{linecolor=green,doubleline=true,linestyle=dotted}
197 \ncline{P}{W}\nbput{1940}
198 \ncline{R}{A}\nbput{1954}
199 \fi
200 }
201
202 \bigskip
203
204 \psset{arrows=->,fillcolor=white,fillstyle=solid}
205
206 \footnotesize
207
208 \newcommand{\Show}[1]{\psshadowbox{#1}}
209
210 \begin{psmatrix}[mnode=r,ref=t,unit=.3]
211 \psframebox[linestyle=none,framesep=.75]{%
212 \begin{psmatrix}[name=A,ref=c]
213 \Show{Stakeholder}
214 \end{psmatrix}} &
215 \psframebox[fillstyle=solid,fillcolor=pink,framesep=.95]{%
216 \rule{1cm}{0pt}
217 \begin{psmatrix}[ref=c]
218 [name=B]\Show{Goal} & \Show{Criteria}\\
219 \Show{Sub-goal} & \Show{Justification}
220 \ncline{1,1}{1,2}
221 \ncline{1,1}{2,2}
222 \ncline{1,1}{2,1}\tlput{Strategy}
223 \ncline{2,1}{2,2}
224 \end{psmatrix}}
225 \ncline[angleB=180]{A}{B}\naput[npos=.7]{Model}
226 \end{psmatrix}
227
228 \begin{postscript}[angle=90,height=\textheight,frame=false]
229
230 \pstree[treemode=U]{\Female{{\bfseries Matilde}}}{%
231 \pstree{\Male{Sebastian}}{%
232 \pstree{\Male[name=P]{Philip}}{\Male{Frederick}\Female{Ethel}}
233 \pstree{\Female[name=W]{Mary}}{\Male{Lionel}\Female{Agnes}}}
234 \pstree{\Female{Leonor}}{
235 \pstree{\Male[name=R]{Ra\'ul}}{\Male{Joaquim}\Female{J\'ulia}}
236 \pstree{\Female[name=A]{Am\'elia}}{\Male{\'Alvaro}\Female{Augusta}}}
237 }
238
239 \psset{linecolor=green,doubleline=true,linestyle=dotted}
240 \ncline{P}{W}\nbput{1940}
241 \ncline{R}{A}\nbput{1954}
242
243 \end{postscript}
244
245 \bigskip
246
247 \psset{arrows=-}
248
249 \begin{displaymath}
250 \bordermatrix{%
251 & A & B & C\cr
252 & \rnode{D}{D} & E & \rnode{F}{F}\cr
253 & G & H & I\cr
254 & \rnode{J}{J} & K & M
255 }
256 \ncline[nodesep=-1em,linecolor=red]{D}{F}
257 \ncline[nodesep=-1em,linecolor=red]{D}{J}
258 \end{displaymath}
259
260 \bigskip
261
262 \mytree
263
264 \bigskip
265
266 \mymatrix
267
268 \end{document}
269 \endinput
270 %%
271 %% End of file `pst-pdf-example.tex'.