13

This is the triangle I want to draw. I have used GeoGebra to draw this, so in LaTeX I do not want to draw these: "=45°",and the points.

I want to draw a triangle (with the package TikZ). I don't know how to draw the line, which links the BC points. I know I have to use these commands: +(a,b), ++(a,b), (a:b|-c,d). Unfortunately I cannot use any of these commands, so please explain, how to use these commands and what do they mean.

Please, introduce the commands in detail. And also, I need the line, which links the points AB. I do not need the points and the "=45°" in my LaTeX document.

5
  • 2
    Here you can find a very good user guide with facilities. ctan.org/pkg/tkz-euclide See Sections 14.2.1 triangle de Pythagore and 14.12.1 Colorier un polygone.
    – Sigur
    May 11, 2015 at 17:14
  • I'm assuming that @Sigur knows you can read French...
    – cfr
    May 11, 2015 at 20:24
  • @cfr, I don't, know. But I informed the section number. It is easy to see the code.
    – Sigur
    May 12, 2015 at 4:56
  • Why isn't the answer accepted? Jun 5, 2020 at 16:10
  • What is given to this construction? alpha, gamma (?) and (?)... ?
    – cis
    Oct 1, 2020 at 12:38

2 Answers 2

26

I probably do not know tikz more than you (being a MetaPost user), but out of curiosity I've just consulted the quite elegant tutorial at the beginning its documentation (p. 28-93), and I've come to this result:

\documentclass[12pt, border=5mm]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw (0,0) node[anchor=north]{$A$}
  -- (4,0) node[anchor=north]{$C$}
  -- (4,4) node[anchor=south]{$B$}
  -- cycle;
\end{tikzpicture}
\end{document}

enter image description here

This tutorial has probably the answers to most of your questions: a must-read.

9

After five years ...

  • For starting point is used @Franck Pastor nice answer (+1)
  • instead nodes are employed coordinates with labels
  • added is angle value (using siunitx)
\documentclass[12pt, tikz, border=5mm]{standalone}
\usetikzlibrary{angles,
                quotes}
\usepackage{siunitx}

\begin{document}
\begin{tikzpicture}[
my angle/.style = {draw, fill=teal!30,
                   angle radius=7mm, 
                   angle eccentricity=1.1, 
                   right, inner sep=1pt,
                   font=\footnotesize} 
                   ]
\draw   (0,0) coordinate[label=below:$A$] (a) --
        (4,0) coordinate[label=below:$C$] (c) --
        (4,4) coordinate[label=above:$B$] (b) -- cycle;
\pic[my angle, "$\alpha=\SI{45}{\degree}$"] {angle = c--a--b};
    \end{tikzpicture}
\end{document}

enter image description here

2
  • Hey how do you size those lines? Are them in cm or inches? Oct 1, 2020 at 4:16
  • @SebastianLazalde, default units at drawing are cm. If you like to use other units, than you need to declare them explicitly, for example: \draw (0pt,opt) -- (111pt,222pt);
    – Zarko
    Oct 1, 2020 at 6:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .