Debian Codegraph @

texmf-dist/doc/generic/pst-turtle/pst-turtle-doc.tex

raw
1 %% $Id: pst-turtle-doc.tex 1093 2019-10-02 11:28:36Z herbert $
2 \documentclass[fontsize=11pt,english,BCOR=10mm,DIV=12,bibliography=totoc,parskip=false,
3 headings=small, headinclude=false,footinclude=false,oneside]{pst-doc}
4 \usepackage{pst-turtle}
5 \let\pstTurtleFV\fileversion
6 \renewcommand\bgImage{}
7
8 %\usepackage[style=dtk]{biblatex}
9 \addbibresource{pst-turtle-doc.bib}
10
11 \begin{document}
12
13 \title{\texttt{pst-turtle}}
14 \subtitle{Turtle graphics; v.\pstTurtleFV}
15 \author{Herbert Vo\ss}
16 \docauthor{}
17 \date{\today}
18 \maketitle
19
20 \tableofcontents
21
22 \clearpage
23
24 \begin{abstract}
25 \noindent
26 \LPack{pst-turtle} loads by default the following packages: \LPack{pstricks},
27 and \LPack{pst-xkey}.
28 All should be already part of your local \TeX\ installation. If not, or in case
29 of having older versions, go to \url{http://www.CTAN.org/} and load the newest version.
30
31 \vfill\noindent
32 Thanks to \\
33
34 \end{abstract}
35
36
37 \section{Usage}
38
39 \begin{BDef}
40 \Lcs{psTurtle}\OptArgs\Largr{$x_0,y_0$}\Largb{Turtle code}
41 \end{BDef}
42
43 The turle commands must be in PostScript notation, where you can use the
44 short or long version of the commands:
45
46 \begin{verbatim}
47 /bk { back } bind def
48 /fd { forward } bind def
49 /lt { left } bind def
50 /pd { pendown } bind def
51 /pu { penup } bind def
52 /rt { right } bind def
53 \end{verbatim}
54
55 The default unit is cm.
56
57 \bigskip
58 \begin{LTXexample}[width=4cm,pos=l]
59 \begin{pspicture}[showgrid](3,3)
60 \psTurtle[linewidth=2pt,arrows=->](0,0){ 3 forward }
61 \end{pspicture}
62 \end{LTXexample}
63
64 \bigskip
65 \begin{LTXexample}[width=4cm,pos=l]
66 \begin{pspicture}[showgrid](3,3)
67 \psTurtle[linewidth=2pt,arrows=->](0,0){
68 3 fd
69 90 left 3 fd }
70 \end{pspicture}
71 \end{LTXexample}
72
73 \bigskip
74 \begin{LTXexample}[width=4cm,pos=l]
75 \begin{pspicture}[showgrid](3,3)
76 \psTurtle[linewidth=2pt,arrows=->](0,0){
77 3 fd
78 90 left 3 fd
79 90 left 3 fd
80 135 left 18 sqrt fd}
81 \end{pspicture}
82 \end{LTXexample}
83
84
85 \bigskip
86 \begin{LTXexample}[width=5cm,pos=l]
87 \begin{pspicture}[showgrid](4,4)
88 \psTurtle[linewidth=2pt](0.8,0){
89 5 { 2.5 fd 72 left } repeat
90 }
91 \end{pspicture}
92 \end{LTXexample}
93
94 \bigskip
95 \begin{LTXexample}[width=5cm,pos=l]
96 \begin{pspicture}[showgrid](4,4)
97 \psTurtle[linewidth=2pt](2,1){
98 5 { 72 left 1 fd 72 right 1 fd 72 left} repeat
99 }
100 \end{pspicture}
101 \end{LTXexample}
102
103 \bigskip
104 \begin{LTXexample}[width=5cm,pos=l]
105 \begin{pspicture}[showgrid](4,4)
106 \psTurtle[linewidth=2pt](2,0){
107 /Angle { 360 7 div } bind def
108 7 { Angle left 1 fd Angle right 1 fd Angle left} repeat
109 }
110 \end{pspicture}
111 \end{LTXexample}
112
113 \bigskip
114 \begin{LTXexample}[width=5cm,pos=l]
115 \begin{pspicture}[showgrid](4,4)
116 \psTurtle[linewidth=2pt](2,2){
117 /Angle { 360 7 div } bind def
118 7 { Angle left 1 fd Angle 3 mul right 1 fd Angle left} repeat
119 }
120 \end{pspicture}
121 \end{LTXexample}
122
123
124 \bigskip
125 \begin{LTXexample}[width=5cm,pos=l]
126 \begin{pspicture}[showgrid](4,4)
127 \psTurtle[linewidth=2pt](2,1){
128 /Angle 40 def
129 75 { 0.25 fd Angle left /Angle Angle 0.5 sub def } repeat
130 }
131 \end{pspicture}
132 \end{LTXexample}
133
134 \bigskip
135 \begin{LTXexample}[width=5cm,pos=l]
136 \begin{pspicture}[showgrid](4,4)
137 \psTurtle[linewidth=2pt](0,3.5){
138 5 { 3 fd 144 right } repeat
139 }
140 \end{pspicture}
141 \end{LTXexample}
142
143
144 \bigskip
145 \begin{LTXexample}[width=6cm,pos=l]
146 \begin{pspicture}[showgrid](5,5)
147 \psTurtle[linewidth=0.2pt](1,1.75){
148 75 { 3.5 fd 123 left } repeat
149 }
150 \end{pspicture}
151 \end{LTXexample}
152
153
154 \bigskip
155 \begin{LTXexample}[width=11cm,pos=l]
156 \begin{pspicture}[showgrid](10,10)
157 \psTurtle[linewidth=0.5pt](5,5){
158 /L 1 def
159 150 { L fd 120 left L fd 120 left L fd /L L 0.03 add def 1.25 rotate } repeat
160 }
161 \end{pspicture}
162 \end{LTXexample}
163
164
165
166
167 \iffalse
168 \def\a{3 }
169 \begin{pspicture}[showgrid](12,6)
170 \psset{linecolor=red,linewidth=1.5pt,unit=1cm}
171 \psTurtle(0,0){
172 90 left \a 1.5 mul fd 159 rt \a fd 120 lt \a fd 120 lt \a fd
173 pu \a bk pd -125 rt \a fd 90 lt \a fd 90 lt \a fd 90 lt \a fd
174 pu 90 lt \a fd 90 lt \a fd pd
175 -37 lt \a fd 4 { 72 lt \a fd } repeat
176 pu 2 { 72 lt \a fd } repeat pd
177 -152 lt \a fd
178 }
179 %\psdot[dotscale=3](! Turtle8)
180 \end{pspicture}
181 \fi
182
183
184
185
186
187 %\clearpage
188 %\section{List of all optional arguments for \texttt{pst-turtle}}
189 %\xkvview{family=pst-turtle,columns={key,type,default}}
190
191 \bgroup
192 \RaggedRight
193 \nocite{*}
194 %\bibliographystyle{plain}
195 \printbibliography{pst-turtle-doc}
196 \egroup
197
198 \printindex
199
200 \end{document}