TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Say I want to include geometry graphics such as the following in a document: enter image description here

I don't merely want to import preexisting figures, I want to be able to draw my own corresponding to a solution I may write up. Is there a package or something that allows one to do this relatively easily?

share|improve this question
up vote 29 down vote accepted

tkz-euclide arrives on the ctan servers. You can get it with ftp from dante.de

ftp://ftp.dante.de:21//pub/tex/macros/latex/contrib/tkz you need to install tkz-base and tkz-euclide. These packages work only with pgf 2.1



\tkzInterLL(A,C)(B,D)  \tkzGetPoint{I}  

\tkzDrawPolygon (A,B,C,D)
\tkzDrawSegments(A,C B,D)
\tkzMarkRightAngles[fill=Maroon!20,size=.3,opacity=.5](D,A,B A,B,C B,C,D C,D,A)

\tkzMarkSegments[mark=s||](I,A I,B I,C I,D)
\tkzLabelPoints(A,B) \tkzLabelPoints[above=6pt](I)   
\tkzLabelPoints[above right](C,D)  

Image from code sample

Best regards

Alain Matthes (author of tkz-euclide) There are a lot of examples on my site altermundus.fr

share|improve this answer
@Alain the user manual is a work of art! Thanks! – Yiannis Lazarides Jan 26 '11 at 16:02

Run it with xelatex




enter image description here

share|improve this answer
Thanks Herbert, this seems like a easy thing to implement. May I ask what PosAngle={180,0,0,180}] means? What do the arguments specify? Why is it not PosAngle={90,90,90,90}]? – yunone Jan 25 '11 at 19:43
@yunone: makes the setting of the labels easier. It is the angle where the A,B,C,and D are printed. With all set to 90 you'll get the A and B half inside the frame. A -90 -90 90 90 would make sense – Herbert Jan 25 '11 at 19:50
Instructions for LyX users: 1. Download and install pst-eucl from here: ctan.org/tex-archive/graphics/pstricks/contrib/pst-eucl . 2. go to Document->Settings->Document Preamble, insert "\usepackage{pst-eucl}". 3. Click Ctrl+L, add the tex code from "\begin{pspicture}(8,5)" to "\end{pspicture}". 4. Click Ctrl+T to convert to PS. You should see a nice rectangle. – Erel Segal-Halevi Jul 5 '13 at 6:14

There are at least two packages that I know of, one based on pstricks: the pst-eucl package (which should be part of your TeX distribution) and one based on TikZ: the tkz-euclide package available here: tkz-euclide (or on CTAN). Unfortunately for the latter, the documentation is only in French, but there are plenty of examples so this may not be too much of a problem.

share|improve this answer
Thanks for the answer, Alan. I'm not too familiar with pstricks. Can I simply say \usepackage{pst-eucl} in my preamble after installing it, or do I have to do something with pstricks first? – yunone Jan 25 '11 at 5:41
@yunone For some of the examples in the documentation you may have to load the pst-plot package. But the simple examples should work just with loading pst-eucl. You need to compile your documents with latex+dvips instead of pdflatex. – Alan Munn Jan 25 '11 at 6:07
@yunone: Yes, \usepackage{pst-eucl} is ok, then you can run xelatex to get a pdf, which should be available on all TeX distributions. alternatively run pdflatex -shell-escape <file> with \usepackage{auto-pst-pdf}. There is no need for running latex+dvips – Herbert Jan 25 '11 at 7:43

Geogebra and asymptote are further tools which could be used in this regard.

share|improve this answer
It's worth pointing out that GeoGebra exports TikZ code. – Matthew Leingang May 3 '11 at 17:17
It's also worth pointing out that GeoGebra exports PSTricks codes. – xport Jun 3 '11 at 9:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.