tags:

views:

32

answers:

1

I am working on attempting to draw some geometrical shapes using PSTricks in LaTeX. I'm pretty new to PSTricks, but I've done a few projects with LaTeX. I've discovered the package pst-eucl which has been quite helpful. It has some useful macros for dealing with triangles and such.

However, I can't figure out how to draw small arrows onto a line to mark two lines as parallel. There are some macros in pst-eucl that will draw hash marks on lines to mark equal length segments, but nothing to mark parallel lines. Has anyone used PSTricks to draw simple geometry diagrams like this? There must be a simple way to do this.

And if there are any suggestions on my style, or ways to simplify what I'm doing, please let me know.

Here is the PSTricks markup for the picture so far:

\begin{pspicture}(-6,0)(8,8)
    % use dots to represent points
    \psset{PointSymbol=*}
    % draw original triangle in black
    \pstTriangle[](1,3){A}(6,0){B}(0,0){C}
    % draw points E and F
    \pstGeonode[PosAngle={180,0}](-5,0){E}(8,6.5){F}
    % create invisible point A' that extends the segment BA
    \pstGeonode[PointName=none,PointSymbol=none](-4,6){A'}
    % draw dashed line from A to A'
    \pstLineAB[linestyle=dashed]{A}{A'}
    % draw line the bisects angle A'AC - this isn't exact
    \pstLineAB[linecolor=red]{A}{E}
    % draw line CE
    \pstLineAB[linecolor=red]{C}{E}
    % draw line BF parallel to AC
    \pstLineAB[linecolor=blue]{B}{F}
    % draw line AF
    \pstLineAB[linecolor=blue]{A}{F}
    % mark two line segments of equal length - not exact
    \pstSegmentMark[]{A}{B}
    \pstSegmentMark[linecolor=blue]{F}{B}
    % mark four angles alpha of equal measure
    \pstMarkAngle[]{E}{A}{C}{$\alpha$}
    \pstMarkAngle[]{A'}{A}{E}{$\alpha$}
    \pstMarkAngle[]{B}{A}{F}{$\alpha$}
    \pstMarkAngle[]{A}{F}{B}{$\alpha$}
    % mark two more angles Beta with equal length
    \pstMarkAngle[]{A}{C}{E}{$\beta$}
    \pstMarkAngle[]{F}{B}{C}{$\beta$}
    % only thing missing is some way to mark parallel segments AC and FB
\end{pspicture}
A: 

I know its not really an answer to your question, but TikZ can do much of what PSTricks can do and many things things that it can't. Also since you are not an old hand at PSTricks, TikZ really is the successor to it. It can compile to pdf or dvi and is actively being developed. If you are learning one you should consider TikZ rather than PSTricks. Here is an example of two parallel lines ...

\documentclass{article}

\usepackage{amsmath,amssymb}

\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
  \draw (0,0) -- (2,0) node [midway] {$\diagdown$};
  \draw (0,2) -- (2,2) node [midway] {$\diagdown$};
\end{tikzpicture}

\end{document}

And there would be cuter ways of doing that, this was just a quick one.

Joel
Thanks for this. I will definitely give TikZ a try for my next project. PSTricks worked ok for that last small project, but I never did figure out a good way to draw the parallel line marks. And there were a couple other things in PSTricks I couldn't figure out how to do, but TikZ seems to be able to do everything I need.
MrException