# Modifications for labeling a triangle

I have a diagram that needs some modifications. The mark for the right angle and the label of $\theta$ are not in the right places. The arc indicating $\angle ACB$ is not in the place. The lengths $x$ and $y$ for $\overline{PC}$ and $\overline{PB}$, respectively, are not in the right places. The line indicating the length of $\overline{BC}$ is shifted rightward from its correct position.

I would like $a + x$ to be typeset in the same direction as the line.

\documentclass[10pt]{amsart}
\usepackage{tikz}
\usetikzlibrary{calc,angles,positioning,intersections,quotes,decorations.markings}
\usepackage{tkz-euclide}
\usetkzobj{all}

\begin{document}

\begin{tikzpicture}
\path (60:2.5) coordinate (A) (10:6) coordinate (B) (0:0) coordinate (C);
\draw (A)
-- (B) node [at start, above left]{$A$} node [midway, above]{$c$}
-- (C) node [at start, right]{$B$}
-- (A) node [at start, below]{$C$} node [midway, left]{$b$} -- cycle;
\coordinate (P) at ($(B)!(A)!(C)$);
\draw [dashed] (A) -- (P) node [below]{$P$} node [midway, right]{$h$} -- (C);
C -- node [midway, below]{$x$} -- P -- node [midway, below]{$y$} B;
\draw pic[draw, angle radius=2mm,"$\theta$",angle eccentricity=2] {angle = B--C--A};
\tkzMarkRightAngle(A,P,B);
\draw[|<->|] ($(B)!7mm!90:(C)$)--node[fill=white] {$x + y$} ($(C)!7mm!-90:(B)$);
\end{tikzpicture}

\end{document}

• Mistake is in this line C -- node [midway, below]{$x$} -- P -- node [midway, below]{$y$} B;. You missed \draw at the start and all nodes should be (C) (note parenthesis), (P) and (B).
– user11232
Aug 30, 2014 at 22:54

Try this:

\documentclass[10pt]{amsart}
\usepackage{tikz}
\usetikzlibrary{calc,angles,positioning,intersections,quotes,decorations.markings}
\usepackage{tkz-euclide}

\begin{document}

\begin{tikzpicture}
\path (60:2.5) coordinate (A) (10:6) coordinate (B) (0:0) coordinate (C);
\draw (A)
-- (B) node [at start, above]{$A$} node [midway, above]{$c$}
-- (C) node [at start, right]{$B$}
-- (A) node [at start, left]{$C$} node [midway, left]{$b$} -- cycle;
\coordinate (P) at ($(B)!(A)!(C)$);
\draw [dashed] (A) --node [midway, right]{$h$}(P)node [below]{$P$}-- (C);
\draw (C) -- node [midway, below]{$x$}(P) -- node [midway, below]{$y$} (B);
\draw pic[draw, angle radius=5mm,"$\theta$",angle eccentricity=1.5] {angle = B--C--A};
\tkzMarkRightAngle(A,P,B);
\draw[|<->|] ($(B)!7mm!90:(C)$)--node[fill=white,sloped] {$x + y$} ($(C)!7mm!-90:(B)$);
\end{tikzpicture}

\end{document}
`

The output now: • This is exactly the diagram that I wanted! Aug 31, 2014 at 18:08