Diagrams – Easy Ways to Create Geometric Pictures in TeX

diagrams

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?

Best Answer

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

ftp://tug.org/tex-archive/macros/latex/contrib/tkz/ you need to install tkz-base and tkz-euclide. These packages work only with pgf 2.1

\documentclass{article}
\usepackage[upright]{fourier} 
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{tkz-euclide} 
\usetkzobj{all} 
\definecolor{fondpaille}{cmyk}{0,0,0.1,0}
\pagecolor{fondpaille}   
\color{Maroon}  
\tkzSetUpColors[background=fondpaille,text=Maroon]
\thispagestyle{empty}  
                        
\begin{document}
 
 \begin{tikzpicture}
\tkzDefPoint(0,0){A}\tkzDefPoint(6,0){B}
\tkzDefPoint(6,4){C}\tkzDefPoint(0,4){D}
\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)
\tkzDrawPoints(A,B,C,D,I)  

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

Image from code sample

Best regards

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