Article View: comp.text.tex
Article #1006Re: drawing lines with PostScript
From: Timothy Van Zandt
Date: Fri, 10 Apr 1992 14:39
Date: Fri, 10 Apr 1992 14:39
49 lines
2653 bytes
2653 bytes
In article <1992Apr9.155715.10826@news.cs.indiana.edu> edrbtsn@iuvax.cs.indiana.edu (Ed Robertson) writes:
>I am looking for TeX macros which would generate PostScript,
>using \special, to draw lines. I know that this makes it machine
>specific, but since all of the printers in our department are
>PostScript printers, I feel pretty safe.
>
>From the TeX side, I would expect a macro something like
> \linene(x,y)
>that would create a box with dimension x X y with a line drawn
>from the SW to the NE corner. A similar macro \linenw would
>draw lines with negative slope. Of course they could be
>fancier, but this is about the simplest thing I could think of.
I have a PostScript package in development that does that and
much more. Get the file pstricks.tar.Z from the /pub director
at Princeton.EDU. It is still unstable, both because the features
and interface may change some, and because it is still being
debugged. However, it is pretty complete and just about
everything works.
The command
\psline(x,y) draws a line from the current point to the coordinate
(x,y). It does not create a box; for that you can put it in a
picture environment. I find that there is little point in putting
every graphics object in its own box.
By specifying a few parameter changes, you can do much more. E.g.,
\psline[linestyle=dotted,linecolor=gray,linearc=.1in]{<-|}
(2,3)(6,7)(4,-2)(0,1)
draws a gray, dotted line through the coordinates and with the
corners "bent" to a .1in radius. The {<-|} argument means that
the line starts with an arrowhead, and ends with a T-bar. Since
the unit was not specified for the coordinates, the value of
a dimension register \psunit is used as the unit.
The package contains oodles of graphics objects with a similar
interface, as well as support for color, a picture environment,
a special loop macro, something called a \dbox, overlays,
rotation macros that let you get nested material right side
up, etc.
Tim
--
Timothy Van Zandt (609)258-4050 tvz@Princeton.EDU (NeXTMail)
Dept. of Economics, Princeton University, Princeton, NJ 08544
Technical Details
Message-ID:
<1992Apr10.143944.26457@Princeton.EDU>Path:
arc1-ca.pugleaf.net!sparky!news.UU.NET!haven.umd.edu!darwin.sura.net!jvnc.net!princeton!zandtwerk.Princeton.EDU!tvzReferences:
<1992Apr9.155715.10826@news.cs.indiana.edu>Show Full Headers
Complete Article Headers
Newsgroups: comp.text.tex Path: arc1-ca.pugleaf.net!sparky!news.UU.NET!haven.umd.edu!darwin.sura.net!jvnc.net!princeton!zandtwerk.Princeton.EDU!tvz From: tvz@zandtwerk.Princeton.EDU (Timothy Van Zandt) Subject: Re: drawing lines with PostScript Message-ID: <1992Apr10.143944.26457@Princeton.EDU> Sender: news@Princeton.EDU (USENET News System) Nntp-Posting-Host: zandtwerk.princeton.edu Organization: Princeton University References: <1992Apr9.155715.10826@news.cs.indiana.edu> Date: Fri, 10 Apr 1992 14:39:44 GMT Lines: 49