1

I am using tkz-euclide to draw a line inside the triangle, which I would like to label with (say) M (but I only know how to label points). How can I do this?

This is what I have so far:

enter image description here

\documentclass[11pt,a4paper]{article}
\usepackage{tkz-euclide}
\usetkzobj{all}

\begin{document}
\begin{tikzpicture}
\tkzInit[xmin=-2,xmax=3,ymin=-2,ymax=3]
\tkzAxeXY

\tkzDefPoint[label=below:{$A$}](-1,-1){A}
\tkzDefPoint[label=right:{$B$}](3,1){B}
\tkzDefPoint[label=above:{$C$}](1,2){C}
\tkzDrawSegments(A,B B,C C,A)
\tkzDefPointBy[projection=onto A--C](B)

\tkzDefPoint[label=right:{$bc$}](2,1.5){BC}

\tkzDrawSegments(A,BC)

\end{tikzpicture}
\end{document}
2

You can do it with \tkzLabelSegment.

I took the liberty to adjust also the bc label:

\documentclass[11pt,a4paper]{article}
\usepackage{tkz-euclide}
\usetkzobj{all}

\begin{document}
    \begin{tikzpicture}
    \tkzInit[xmin=-2,xmax=3,ymin=-2,ymax=3]
    \tkzAxeXY

    \tkzDefPoint[label=below:{$A$}](-1,-1){A}
    \tkzDefPoint[label=right:{$B$}](3,1){B}
    \tkzDefPoint[label=above:{$C$}](1,2){C}
    \tkzDrawSegments(A,B B,C C,A)
    \tkzDefPointBy[projection=onto A--C](B)

    \tkzDefPoint(2,1.5){BC}
    \tkzLabelSegment[above right=-2pt and -2pt](B,C){$bc$}  
    \tkzDrawSegments(A,BC)
    \tkzLabelSegment[above=1pt](A,BC){$M$}  

    \end{tikzpicture}
\end{document}

enter image description here

  • @StudentType You're welcome, thank you for accepting my answer! – CarLaTeX Jun 25 '17 at 7:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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