summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-06-18 15:59:17 +0000
committerKarl Berry <karl@freefriends.org>2010-06-18 15:59:17 +0000
commitf27ac35b0c41cde9fef228af89c141d3d0a272d4 (patch)
tree26cf7bab16cc69a7774e728e13a1c872bb665c15 /Master/texmf-dist/tex
parente7c3e209e8f797c9f89a7e454e260716220ce832 (diff)
new pstricks package pst-electricfield (17jun10)
git-svn-id: svn://tug.org/texlive/trunk@19037 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/generic/pst-electricfield/pst-electricfield.tex115
-rw-r--r--Master/texmf-dist/tex/latex/pst-electricfield/pst-electricfield.sty11
2 files changed, 126 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/generic/pst-electricfield/pst-electricfield.tex b/Master/texmf-dist/tex/generic/pst-electricfield/pst-electricfield.tex
new file mode 100644
index 00000000000..d4fae4a2202
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pst-electricfield/pst-electricfield.tex
@@ -0,0 +1,115 @@
+%% Package `pst-electricfield.tex'
+%%
+%% Manuel Luque
+%% Jürgen Gilg
+%% Patrice Megret
+%% Herbert Voß
+%%
+%% 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.
+%%
+%% A PSTricks related package to draw electric field lines
+%% It uses the method from Euler
+%%
+\csname PSTElectricFieldLoaded\endcsname
+\let\PSTElectricFieldLoaded\endinput
+%
+% Requires some packages
+\ifx\PSTricksLoaded\endinput\else \input pstricks \fi
+\ifx\MultidoLoaded\endinput\else \input multido.tex\fi
+\ifx\PSTXKeyLoaded\endinput\else \input pst-xkey \fi
+%
+\def\fileversion{0.13}
+\def\filedate{2010/06/09}
+\message{`pst-electricfield' v\fileversion, \filedate\space (ml,jg,hv)}
+%
+\edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax
+%
+\SpecialCoor
+\pst@addfams{pst-electricfield}
+
+%% prologue for postcript
+\pstheader{pst-electricfield.pro}%
+
+%% [q1 x1 y1 N1 plotCharge] [q2 x2 y2 N2 plotCharge] [...] etc
+%% [charge, coordonnees, nombre de lignes, plotCircle]
+%% number of lines and boolean for the circle are optional
+\define@key[psset]{pst-electricfield}{Q}[{[1 -2 0 10][1 1 0][1 0 1 15]}]{\def\psk@electricfieldQ{#1}}
+\psset[pst-electricfield]{Q=[1 -2 0 10][1 1 0][1 0 1 15]}
+\define@key[psset]{pst-electricfield}{N}[17]{\def\psk@electricfieldN{#1 }} %% par defaut 16 lignes
+\psset[pst-electricfield]{N=17}
+%% nombre de points du trace
+\define@key[psset]{pst-electricfield}{points}[400]{\def\psk@electricfieldpoints{#1 }}
+\psset[pst-electricfield]{points=400}
+%% pas du trace
+\define@key[psset]{pst-electricfield}{Pas}[0.025]{\def\psk@electricfieldPas{#1 }}
+\psset[pst-electricfield]{Pas=0.025}
+\define@key[psset]{pst-electricfield}{posArrow}{\def\psk@ElectricFieldposArrow{#1 }}
+\psset[pst-electricfield]{posArrow=0.25}
+%
+\def\tx@EFieldDict{ tx@EFieldDict begin }
+%
+\def\psElectricfield{\pst@object{psElectricfield}}
+\def\psElectricfield@i{%
+ \pst@killglue%
+ \addbefore@par{radius=1mm}%
+ \begin@OpenObj%
+ \pssetlength\pst@dimb\psk@radius
+ \addto@pscode{%
+ \tx@EFieldDict
+ /QXYN [\psk@electricfieldQ] def
+ /ChargeRadius \pst@number\pst@dimb def
+ /N \psk@electricfieldN def
+ /NbrePoints \psk@electricfieldpoints def
+ /Pas \psk@electricfieldPas def
+ /posArrow \psk@ElectricFieldposArrow def
+ /xUnit \pst@number\psxunit def
+ /yUnit \pst@number\psyunit def
+ Electricfield
+ end
+ }%
+ \end@OpenObj%
+ \ignorespaces}
+
+\define@key[psset]{pst-electricfield}{Vmax}[10]{\def\psk@electricfieldVmax{#1 }}
+\psset[pst-electricfield]{Vmax=10}
+\define@key[psset]{pst-electricfield}{Vmin}[-10]{\def\psk@electricfieldVmin{#1 }}
+\psset[pst-electricfield]{Vmin=-10}
+\define@key[psset]{pst-electricfield}{stepV}[2]{\def\psk@electricfieldStepV{#1 }}
+\psset[pst-electricfield]{stepV=2}
+\define@key[psset]{pst-electricfield}{stepFactor}[0.67]{\def\psk@electricfieldStepFactor{#1 }}
+\psset[pst-electricfield]{stepFactor=0.67}
+%
+\def\psEquipotential{\pst@object{psEquipotential}}
+\def\psEquipotential@i(#1,#2)(#3,#4){%
+ \pst@killglue%
+ \addbefore@par{radius=1mm}%
+ \begin@OpenObj%
+ \pssetlength\pst@dimb\psk@radius
+ \addto@pscode{%
+ \tx@EFieldDict
+ /QXYN [\psk@electricfieldQ] def
+ /ChargeRadius \pst@number\pst@dimb def
+ /N \psk@electricfieldN def
+ /NbrePoints \psk@electricfieldpoints def
+ /Vmax \psk@electricfieldVmax def
+ /Vmin \psk@electricfieldVmin def
+ /StepV \psk@electricfieldStepV def
+ /StepFactor \psk@electricfieldStepFactor def
+ /posArrow \psk@ElectricFieldposArrow def
+ /xUnit \pst@number\psxunit def
+ /yUnit \pst@number\psyunit def
+ /LW \pst@number\pslinewidth def
+ /xMin #1 def
+ /xMax #3 def
+ /yMin #2 def
+ /yMax #4 def
+ Equipotential
+ end
+ }%
+\end@OpenObj%
+ \ignorespaces}
+\catcode`\@=\PstAtCode\relax
+%% END
+\endinput
diff --git a/Master/texmf-dist/tex/latex/pst-electricfield/pst-electricfield.sty b/Master/texmf-dist/tex/latex/pst-electricfield/pst-electricfield.sty
new file mode 100644
index 00000000000..ebfe4b8fa6b
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/pst-electricfield/pst-electricfield.sty
@@ -0,0 +1,11 @@
+\RequirePackage{pstricks}
+\ProvidesPackage{pst-electricfield}[2010/05/15 package wrapper for
+ pst-electricfield.tex]
+\input{pst-electricfield.tex}
+\IfFileExists{pst-electricfield.pro}{%
+ \ProvidesFile{pst-electricfield.pro}
+ [2010/06/08 v. 0.04, PostScript prologue file (hv)]
+ \@addtofilelist{pst-electricfield.pro}}{}%
+\ProvidesFile{pst-electricfield.tex}
+ [\filedate\space v\fileversion\space `pst-electricfield' (ml&jg&pm&hv)]
+\endinput