Arek Kuźniewski
2008-08-18 13:44:59 UTC
I need to define function (in pstricks mode) for drawing lines. Function
should work like this:
------------
\def\newhline(#1,#2){#3}{\psline(#1,#2)(#1+#3,#2)
------------
Of course this function doesn't work.
How can I define this function? If I needed only integer values of #1
and #3, I would do it by counters, for example:
------------
\newcounter{nhlc}
\def\newhline(#1,#2){#3}{\setcounter{nhlc}{#1}\stepcounter{nhlc}{#3}
\psline(#1,#2)(\thenhlc,#2)}
-------------
But the problem is, that I need #1 and #3 in real (e.g. #1=1.2 and #3=4.3).
The second definition doesn't work for it.
Is some way to define function for calculation #1+#3?
should work like this:
------------
\def\newhline(#1,#2){#3}{\psline(#1,#2)(#1+#3,#2)
------------
Of course this function doesn't work.
How can I define this function? If I needed only integer values of #1
and #3, I would do it by counters, for example:
------------
\newcounter{nhlc}
\def\newhline(#1,#2){#3}{\setcounter{nhlc}{#1}\stepcounter{nhlc}{#3}
\psline(#1,#2)(\thenhlc,#2)}
-------------
But the problem is, that I need #1 and #3 in real (e.g. #1=1.2 and #3=4.3).
The second definition doesn't work for it.
Is some way to define function for calculation #1+#3?
--
Arek
In darkness there can be light.
In misery there can be beauty.
In death there can be life.
Arek
In darkness there can be light.
In misery there can be beauty.
In death there can be life.