summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pst-infixplot/pst-infixplot.tex
blob: 403ee0113aa49672dda4adecca0a1a3cab84ffb1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
%%
%% This is file `pst-infixplot.tex',
%%
%% IMPORTANT NOTICE:
%%
%% Package `pst-infixplot'
%%
%% Jean-Côme Charpentier <jean-come.charpentier@wanadoo.fr>
%% Christophe Jorssen <christophe.jorssen@libre.fr.invalid>
%% `libre' is the french word for `free' :-)
%%
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN archives
%% in directory CTAN:/macros/latex/base/lppl.txt.
%%
%% DESCRIPTION:
%%   `pst-infixplot' is a PSTricks package to plot infix expressions
%%
\def\RCS$#1: #2 ${\expandafter\def\csname RCS#1\endcsname{#2}}
\RCS$Revision: 1.0 $ \RCS$Date: 2004-07-14 15:29:02+02 $

\def\fileversion{0.1}

\csname PSTInfixplotLoaded\endcsname
\let\PSTPlotLoaded\endinput
\message{`pst-infixplot' v\fileversion\space (Rev \RCSRevision, \RCSDate),
J.-C.Charpentier/C.Jorssen}

% Require pst-plot and infix-RPN

\ifx\PSTplotLoaded\endinput\else\input pst-plot.tex\fi
\ifx\infixRPNLoaded\endinput\else\input infix-RPN.tex\fi

\edef\PstAtCode{\the\catcode`\@}
\catcode`\@=11\relax

\def\psPlot{%
  \begingroup
  \catcode`\_=11\relax
  \@ifnextchar[{\psPlot@i}{\psPlot@i[]}}

\def\psPlot@i[#1]#2#3#4{%
  \infixtoRPN{#4}
  \psplot[#1]{#2}{#3}{\RPN}\endgroup}

\def\parametricPlot{%
  \begingroup
  \catcode`\_=11\relax
  \@ifnextchar[{\parametricPlot@i}{\parametricPlot@i[]}}

\def\parametricPlot@i[#1]#2#3#4#5{%
  \infixtoRPN{#4}
  \edef\pst@parametric@Plot@x{\RPN}%
  \infixtoRPN{#5}
  \edef\pst@parametric@Plot@y{\RPN}%
  \parametricplot[#1]{#2}{#3}{\pst@parametric@Plot@x\space \pst@parametric@Plot@y}\endgroup}

\catcode`\@=\PstAtCode\relax

\endinput