intersecting-lines-5.tex 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. \documentclass{article}
  2. \usepackage[pdftex,active,tightpage]{preview}
  3. \setlength\PreviewBorder{0mm}
  4. \usepackage{tkz-fct}
  5. \usetikzlibrary{arrows, decorations.pathreplacing}
  6. \usetikzlibrary{shapes.misc}
  7. \tikzset{
  8. line/.style={
  9. thick,
  10. black,
  11. to path={% works only with "to" and not "--"
  12. -- (\tikztotarget) node[at start,point] {} node [at end,point] {} \tikztonodes
  13. }
  14. },
  15. line2/.style={
  16. ultra thick,
  17. black,
  18. to path={% works only with "to" and not "--"
  19. -- (\tikztotarget) node[at start,point] {} node [at end,point] {} \tikztonodes
  20. }
  21. },
  22. point/.style={
  23. ultra thick,
  24. draw=gray,
  25. cross out,
  26. inner sep=0pt,
  27. minimum width=4pt,
  28. minimum height=4pt,
  29. },
  30. }
  31. \begin{document}
  32. \begin{preview}
  33. \begin{tikzpicture}
  34. \draw[white,fill=white] (-0.5,-0.5) rectangle (5.2,5.2); % background
  35. \tkzInit [xmin=0,xmax=4.5,ymin=0,ymax=4.5]
  36. \begin{scriptsize}
  37. \tkzGrid[color = gray!30!white]
  38. \tkzAxeXY
  39. \end{scriptsize}
  40. \draw[line2,red] (2,2) to (4,4);
  41. \draw[line,blue] (1,1) to (3,3);
  42. \end{tikzpicture}
  43. \end{preview}
  44. \end{document}