summaryrefslogtreecommitdiff
path: root/graphics/pstricks/contrib/pst-dart
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /graphics/pstricks/contrib/pst-dart
Initial commit
Diffstat (limited to 'graphics/pstricks/contrib/pst-dart')
-rw-r--r--graphics/pstricks/contrib/pst-dart/Changes10
-rw-r--r--graphics/pstricks/contrib/pst-dart/README.md23
-rw-r--r--graphics/pstricks/contrib/pst-dart/doc/pst-dart-doc.bib78
-rw-r--r--graphics/pstricks/contrib/pst-dart/doc/pst-dart-doc.pdfbin0 -> 408049 bytes
-rw-r--r--graphics/pstricks/contrib/pst-dart/doc/pst-dart-doc.tex166
-rw-r--r--graphics/pstricks/contrib/pst-dart/latex/pst-dart.sty13
-rw-r--r--graphics/pstricks/contrib/pst-dart/tex/pst-dart.tex115
7 files changed, 405 insertions, 0 deletions
diff --git a/graphics/pstricks/contrib/pst-dart/Changes b/graphics/pstricks/contrib/pst-dart/Changes
new file mode 100644
index 0000000000..09f94ce443
--- /dev/null
+++ b/graphics/pstricks/contrib/pst-dart/Changes
@@ -0,0 +1,10 @@
+..... pst-dart.tex
+0.02 2018-02-09 - add \psDart for darts
+ - rename borad to \psDartBoard
+0.01 2018-01-27 first version
+
+
+..... pst-dart.sty
+ 2018-01-27 first version
+
+
diff --git a/graphics/pstricks/contrib/pst-dart/README.md b/graphics/pstricks/contrib/pst-dart/README.md
new file mode 100644
index 0000000000..6dc2e0f983
--- /dev/null
+++ b/graphics/pstricks/contrib/pst-dart/README.md
@@ -0,0 +1,23 @@
+# pst-dart: plotting a Dart Board
+
+%% This program can be redistributed and/or modified under the terms
+%% of the LaTeX Project Public License Distributed from CTAN archives
+%% in directory macros/latex/base/lppl.txt.
+
+Save the files pst-dart.sty|pro|tex in a directory, which is part of your
+local TeX tree. The pro file should go into $TEXMF/dvips/pstricks/
+Then do not forget to run texhash to update this tree.
+For more information see the documentation of your TeX distribution
+on installing packages into your local TeX system or read the
+TeX Frequently Asked Questions:
+(http://www.tex.ac.uk/cgi-bin/texfaq2html?label=instpackages).
+
+pst-dart needs pstricks, which should already
+be part of your local TeX installation, otherwise get it from a
+CTAN server, http://mirror.ctan.org
+
+PSTricks is PostScript Tricks, the documentation cannot be run
+with pdftex, use the sequence latex->dvips->ps2pdf or
+pdflatex with package auto-pst-pdf or xelatex.
+
+%% $Id: README.md 713 2018-01-28 19:31:56Z herbert $
diff --git a/graphics/pstricks/contrib/pst-dart/doc/pst-dart-doc.bib b/graphics/pstricks/contrib/pst-dart/doc/pst-dart-doc.bib
new file mode 100644
index 0000000000..36f1388ee1
--- /dev/null
+++ b/graphics/pstricks/contrib/pst-dart/doc/pst-dart-doc.bib
@@ -0,0 +1,78 @@
+@STRING{tugboat = {TUGboat} }
+@STRING{beiprogramm = {{\TeX}-Beiprogramm} }
+@STRING{bretter = {Bretter, die die Welt bedeuten} }
+@STRING{dtk = {{D}ie {\TeX}nische {K}om{\"o}die} }
+@STRING{editorial = {Editorial} }
+@STRING{fremdebuehne = {Von fremden B{\"u}hnen} }
+@STRING{fundus = {Aus dem Fundus} }
+@STRING{hinterbuehne = {Hinter der B{\"u}hne} }
+@STRING{leserbrief = {Leserbrief(e)} }
+@STRING{magazin = {Magazin} }
+@STRING{rezension = {Rezensionen} }
+@STRING{schonimmer = {Was Sie schon immer {\"u}ber {\TeX} wissen wollten \dots} }
+@STRING{theaterkasse = {Von der Theaterkasse} }
+@STRING{theatertage = {{\TeX}-Theatertage} }
+
+@Book{tlgc2,
+ author = {Michel Goosens and Frank Mittelbach and Sebastian Rahtz and Denis Roegel and Herbert Voß},
+ title = {The {\LaTeX} {G}raphics {C}ompanion},
+ publisher = {{Addison-Wesley Publishing Company}},
+ edition = 2,
+ year = {2007},
+ address = {Reading, Mass.}
+}
+
+
+@Article{girou:01:,
+ author = {Denis Girou},
+ title = {Pr\'esentation de {PST}ricks},
+ journal = {Cahier {GUT}enberg},
+ year = 1994,
+ volume = {16},
+ month = apr,
+ pages = {21-70}
+}
+
+@Article{girou:02:,
+ author = {{Timothy van} Zandt and Denis Girou},
+ title = {Inside {PST}ricks},
+ journal = TUGboat,
+ year = 1994,
+ volume = {15},
+ month = sep,
+ pages = {239-246}
+}
+
+@online{pstricks,
+ Title = {PSTricks - {\PS} macros for generic {\TeX}},
+ Author = {{Timothy van} Zandt},
+ Organization = {},
+ url = {http://www.tug.org/application/PSTricks},
+ year = 1993
+}
+
+@ctan{multido,
+ Title = {\texttt{multido.tex} - a loop macro, that supports fixed-point addition},
+ Author = {{Timothy van} Zandt},
+ url = {/graphics/pstricks/generic/multido.tex},
+ Note = {},
+ year = 1997
+}
+
+@Book{PSTricks2,
+ author = {Herbert Voß},
+ title = {\texttt{PSTricks} -- {G}rafik f\"ur \TeX{} und \LaTeX},
+ edition = {7},
+ publisher = {DANTE -- Lehmanns},
+ year = {2016},
+ publisher = {Heidelberg and Berlin}
+}
+
+@Book{PSTricks2-UIT,
+ author = {Herbert Voß},
+ title = {PSTricks -- Graphics for \TeX\ and \LaTeX},
+ publisher = {UIT},
+ year = {2011},
+ address = {Cambridge}
+}
+
diff --git a/graphics/pstricks/contrib/pst-dart/doc/pst-dart-doc.pdf b/graphics/pstricks/contrib/pst-dart/doc/pst-dart-doc.pdf
new file mode 100644
index 0000000000..89f8519e2b
--- /dev/null
+++ b/graphics/pstricks/contrib/pst-dart/doc/pst-dart-doc.pdf
Binary files differ
diff --git a/graphics/pstricks/contrib/pst-dart/doc/pst-dart-doc.tex b/graphics/pstricks/contrib/pst-dart/doc/pst-dart-doc.tex
new file mode 100644
index 0000000000..ad125eebf2
--- /dev/null
+++ b/graphics/pstricks/contrib/pst-dart/doc/pst-dart-doc.tex
@@ -0,0 +1,166 @@
+%% $Id: pst-dart-doc.tex 728 2018-02-09 19:29:41Z herbert $
+\documentclass[fontsize=11pt,english,BCOR=10mm,DIV=12,bibliography=totoc,parskip=false,
+ headings=small, headinclude=false,footinclude=false,oneside]{pst-doc}
+\usepackage[utf8]{inputenc}
+\usepackage{dtk-logos}
+\usepackage{pst-dart}
+\let\pstDartFV\fileversion
+\renewcommand\bgImage{\psDartBoard[unit=2,fontsize=15pt]}
+
+\addbibresource{pst-dart-doc.bib}
+
+
+\lstset{language=PSTricks,
+ morekeywords={psDart},basicstyle=\footnotesize\ttfamily,
+ literate=%
+ {Ö}{{\"O}}1
+ {Ä}{{\"A}}1
+ {Ü}{{\"U}}1
+ {ß}{{\ss}}1
+ {ü}{{\"u}}1
+ {ä}{{\"a}}1
+ {ö}{{\"o}}1
+ {~}{{\textasciitilde}}1
+}
+%
+\begin{document}
+
+\title{\texttt{pst-dart}}
+\subtitle{Plotting a Dart ; v.\pstDartFV}
+\author{Thomas Söll\\Herbert Voß}
+\docauthor{}
+\date{\today}
+\maketitle
+
+\tableofcontents
+
+
+\clearpage
+
+%\begin{abstract}
+%\noindent
+%\LPack{pst-func} loads by default the following packages: \LPack{pst-plot},
+%\LPack{pstricks-add}, \LPack{pst-math}, \LPack{pst-xkey}, and, of course \LPack{pstricks}.
+%All should be already part of your local \TeX\ installation. If not, or in case
+%of having older versions, go to \url{http://www.CTAN.org/} and load the newest version.
+
+%\vfill\noindent
+%Thanks to \\
+% Michael Zedler,
+%and last but not least
+% \url{http://mathworld.wolfram.com}.
+
+%\end{abstract}
+
+\section{Syntax of \Lcs{psDart}}
+
+
+\begin{BDef}
+\Lcs{psDartBoard}\OptArgs\OptArg*{$(x_0,y_0)$}
+\end{BDef}
+
+\section{Examples}
+\subsection{The default size}
+
+\begin{LTXexample}
+\begin{pspicture}[showgrid](-3,-3)(9,3)
+\psDartBoard % The default Dartboard (radius=2.1cm)
+\psDartBoard[fontsize=7pt](6cm,0)
+\end{pspicture}
+\end{LTXexample}
+
+
+\subsection{Scaling}
+
+\begin{LTXexample}[pos=r,width=0.58\linewidth]
+\begin{pspicture}[showgrid](-5,-5)(5,5)
+\psDartBoard[unit=2]
+\end{pspicture}
+\end{LTXexample}
+
+\begin{LTXexample}[pos=r,width=0.58\linewidth]
+\begin{pspicture}[showgrid](-5,-5)(5,5)
+\psDartBoard[fontsize=15pt,unit=2]
+\end{pspicture}
+\end{LTXexample}
+
+
+\subsection{Space}
+
+\Lcs{psDartBoard} itself uses internally already an environment \Lenv{pspicture} which
+reserves the space. But an internal \Lcs{rput} command places the dartboard without specifying
+coordinates at the origin which is the reason why one has to reserve space with an additional
+environment \Lenv{pspicture} as can be seen in the above examples..
+
+%\psset{unit=1cm}
+
+
+\section{Darts}
+
+\begin{pspicture}[showgrid](0,-1)(\linewidth,8)
+\psDart(4,2)
+\psDart[dartcolor=green,rot=22.50](4,2)
+\psDart[dartcolor=blue,rot=45](4,2)
+\psDart[rot=-90,unit=0.75](2,8)
+\end{pspicture}
+
+\begin{lstlisting}
+\begin{pspicture}[showgrid](0,-1)(\linewidth,8)
+\psDart(4,2)
+\psDart[dartcolor=green,rot=22.50](4,2)
+\psDart[dartcolor=blue,rot=45](4,2)
+\psDart[rot=-90,unit=0.75](2,8)
+\end{pspicture}
+\end{lstlisting}
+
+
+\section{Board and Darts}
+
+\begin{LTXexample}[pos=t]
+\begin{pspicture}(-5,-5)(5,5)
+\psDartBoard[fontsize=15pt,unit=2]
+\psDart[rot=45,unit=0.5](0,0)
+\psDart[rot=30,unit=0.5,dartcolor=blue](0,0)
+\psDart[rot=80,unit=0.5,dartcolor=green](-2,2)
+\end{pspicture}
+\end{LTXexample}
+
+
+%\begin{LTXexample}[pos=r,width=0.6\linewidth]
+%foo\psDart bar
+%\end{LTXexample}
+
+\section{Changing the viewpoint}
+
+You can change the viewpoint with the two optional arguments \Lkeyword{preCode}\footnote{There is also a \Lkeyword{postCode},
+which is not of real interest here.}
+which allow to change the transformation matrix of PostScript. However, it does \emph{not} work
+with \XeLaTeX, you have to choose the Sequenz \texttt{latex}$\rightarrow$\texttt{dvips}$\rightarrow$\texttt{ps2pdf}.
+
+
+
+\begin{LTXexample}[pos=t]
+\begin{pspicture}(-4.5,-4.5)(4.5,4.5)
+\psDartBoard[preCode={[1 0.2 0.5 1 0 0 ] concat },fontsize=18pt,unit=1.5]
+\psDart[unit=0.5,rot=45](1,-1)
+\end{pspicture}
+\end{LTXexample}
+
+
+
+
+\clearpage
+\section{List of all optional arguments for \texttt{pst-dart}}
+\xkvview{family=pst-dart,columns={key,type,default}}
+
+\bgroup
+\RaggedRight
+\nocite{*}
+\printbibliography
+\egroup
+
+\printindex
+
+\end{document}
+
+
diff --git a/graphics/pstricks/contrib/pst-dart/latex/pst-dart.sty b/graphics/pstricks/contrib/pst-dart/latex/pst-dart.sty
new file mode 100644
index 0000000000..83758903b9
--- /dev/null
+++ b/graphics/pstricks/contrib/pst-dart/latex/pst-dart.sty
@@ -0,0 +1,13 @@
+\RequirePackage{pstricks}
+\ProvidesPackage{pst-dart}[2017/08/17 package wrapper for pst-dart.tex (hv)]
+\RequirePackage{multido}
+\RequirePackage{pst-xkey}
+%
+\input{pst-dart.tex}
+\ProvidesFile{pst-dart.tex}
+ [\filedate\space v\fileversion\space `PST-dart' (hv)]
+\IfFileExists{pst-dart.pro}{%
+ \ProvidesFile{pst-dart.pro}[2014/05/07 v. 0.16, PostScript prologue file (hv)]
+\@addtofilelist{pst-dart.pro}}{}%
+\endinput
+%% $Id: pst-dart.sty 713 2018-01-28 19:31:56Z herbert $
diff --git a/graphics/pstricks/contrib/pst-dart/tex/pst-dart.tex b/graphics/pstricks/contrib/pst-dart/tex/pst-dart.tex
new file mode 100644
index 0000000000..064a309e7f
--- /dev/null
+++ b/graphics/pstricks/contrib/pst-dart/tex/pst-dart.tex
@@ -0,0 +1,115 @@
+%% $Id: pst-dart.tex 728 2018-02-09 19:29:41Z herbert $
+%%
+%% This is file `pst-dart.tex',
+%%
+%% IMPORTANT NOTICE:
+%%
+%% Package `pst-dart.tex'
+%%
+%% Thomas Söll <Thomas.Soell@onlinehome.de>
+%% Herbert Voss <hvoss@tug.org>
+%%
+%% This program can be redistributed and/or modified under the terms
+%% of the LaTeX Project Public License Distributed from CTAN archives
+%% in directory macros/latex/base/lppl.txt.
+%%
+%% DESCRIPTION:
+%% `pst-dart' is a PSTricks package to plot dart boards
+%%
+\csname PSTdartLoaded\endcsname
+\let\PSTfuncLoaded\endinput
+% Requires some PSTricks packages
+\ifx\PSTricksLoaded\endinput\else \input pstricks.tex\fi
+\ifx\PSTXKeyLoaded\endinput\else \input pst-xkey.tex \fi
+\ifx\GradientLoaded\endinput\else \input pst-grad.tex \fi
+%
+\edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax
+% interface to the `xkeyval' package
+\pst@addfams{pst-dart}
+%
+\def\fileversion{0.02}
+\def\filedate{2018/02/09}
+\message{`PST-dart' v\fileversion, \filedate\space (ts,hv)}
+%
+\define@key[psset]{pst-dart}{preCode}[]{\def\psk@dart@preCode{#1}}
+\define@key[psset]{pst-dart}{postCode}[]{\def\psk@dart@postCode{#1}}
+\define@key[psset]{pst-dart}{fontsize}[10pt]{\def\psk@dart@fontsize{\fontsize{#1}{#1}}}
+\psset[pst-dart]{fontsize=10pt,preCode=,postCode=}
+
+\newcmykcolor{Red}{0 1 1 0}
+\newcmykcolor{Green}{1 0 1 0}
+
+\def\psDartBoard{\pst@object{psDartBoard}}%
+\def\psDartBoard@i{\@ifnextchar(\psDartBoard@ii{\psDartBoard@ii(0,0)}}%
+\def\psDartBoard@ii(#1){%
+ \begingroup
+ \addbefore@par{unit=0.1mm}%
+ \use@par
+ \degrees[20]%
+ \rput(#1){%
+ \begin{pspicture}(-210,-210)(210,210)%
+ \pstVerb{gsave \psk@dart@preCode }%
+ \pscircle*(0,0){210}
+ % Gerader Part.
+ \psset{linewidth=0.5pt}%
+ \multido{\rA=-0.5+2.0,\rB=0.5+2.0}{10}{%
+ \pswedge*[linecolor=white]{170}{\rA}{!\rA\space 1 add}
+ \psarc[linecolor=Green,linewidth=8](0,0){166}{\rA}{!\rA\space 1 add}
+ \psarc[linecolor=Red,linewidth=8](0,0){166}{\rB}{!\rB\space 1 add}
+ \psarc[linecolor=Green,linewidth=8](0,0){103}{\rA}{!\rA\space 1 add}
+ \psarc[linecolor=Red,linewidth=8](0,0){103}{\rB}{!\rB\space 1 add}
+ \psline[linecolor=gray!30,dimen=inner,linewidth=0.5pt](170;\rA)(0,0)(170;\rB)
+ }%
+ \pscircle[linecolor=gray!30,dimen=inner,linewidth=0.5pt]{170}%
+ \pscircle[linecolor=gray!30,dimen=inner,linewidth=0.5pt]{162}%
+ \pscircle[linecolor=gray!30,dimen=inner,linewidth=0.5pt]{107}
+ \pscircle[linecolor=gray!30,dimen=inner,linewidth=0.5pt]{99}
+ \pscircle[fillstyle=solid,fillcolor=Green,linecolor=gray!30,linewidth=0.5pt,linecolor=white]{15.9}
+ \pscircle[fillstyle=solid,fillcolor=Red,linecolor=gray!30,linewidth=0.5pt,linecolor=white]{6.35}
+ \psforeach{\iA}{6,13,4,18,1,20,5,12,9,14,11,8,16,7,19,3,17,2,15,10}{%
+ \rput(190;\the\psLoopIndex){\psk@dart@fontsize\selectfont\white\iA}}
+ \pstVerb{ \psk@dart@postCode grestore }%
+ \end{pspicture}}%
+ \endgroup
+ \ignorespaces
+}
+%
+\colorlet{gold}{orange!50!yellow}
+
+\define@key[psset]{pst-dart}{dartcolor}[red]{\def\psdartcolor{#1}}
+\psset{dartcolor}
+
+\def\psDart{\pst@object{psDart}}
+\def\psDart@i(#1){%
+ \begingroup
+ \addbefore@par{rot=0,linestyle=none,fillstyle=gradient}%
+ \use@par
+ \rput(#1){%
+% \pstVerb{gsave \psk@dart@preCode }%
+ % tip
+ \pspolygon[gradangle=90,gradbegin=black!30,gradend=black!60](0,0)(1,0.04)(1,-0.04)
+ % golden mass
+ \pspolygon[gradangle=90,gradbegin=gold,gradend=gold!60!black](0,0)(0.99,0)(1.19,0.2)(1.69,0.2)(1.69,-0.2)(1.19,-0.2)(0.99,0)
+ % wings
+ \pscurve[gradbegin=\psdartcolor!20!white,gradend=\psdartcolor!10!black,gradmidpoint=1](4.5,0)(7.6,1)(7.3,0)
+ \pscurve[gradbegin=\psdartcolor!20!black,gradend=\psdartcolor,gradmidpoint=1](4.5,0)(7.6,-1)(7.3,0)
+ % body
+ \pscustom[gradbegin=\psdartcolor!50,gradend=\psdartcolor!100!-\psdartcolor!90,gradangle=45,gradmidpoint=0]{%
+ \pscurve(1.7,0.2)(2,0.24)(6,0.2)(7.6,0)
+ \pscurve(6,-0.2)(2,-0.24)(1.7,-0.2)
+ }%
+ \pscustom[gradbegin=\psdartcolor!80!white,gradend=black!50,gradangle=90,gradmidpoint=0.5]{%
+ \pscurve(4.5,0)(5.5,0.05)(7.6,0)
+ \pscurve(5.5,-0.05)(4.5,0)
+ }
+% \pstVerb{ \psk@dart@postCode grestore }%
+ }%
+ \endgroup\ignorespaces
+}
+%
+\catcode`\@=\PstAtCode\relax
+%
+%% END: pst-dart.tex
+\endinput
+%
+