I have a display of similar triangles - one inscribed in another. 2.5mm below one line segment, the labels C and C_1 are positioned. Actually, 2.5mm below the line segment, the centers of the nodes for C and C_1 are positioned. The subscript on C_1 is preventing them from being equidistant from the line segment. How do I make them equidistant?
\documentclass{amsart}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{tikz}
\usetikzlibrary{calc,angles,positioning,intersections,quotes,decorations.markings}
\usepackage{pgfplots}
\pgfplotsset{compat=1.11}
\begin{document}
\begin{tikzpicture}
\coordinate (A) at (0,0);
\coordinate (B') at (50:7.5);
\path[name path=ray_k] (A) -- (B');
\coordinate (C') at (15:7.5);
\path[name path=ray_ell] (A) -- (C');
%This command labels a point "B" 3.75cm from A on ray $k$.
\coordinate (B) at (50:{15/4});
\draw (A) -- (B);
%These commands label the projection of AB onto \ell "C." A line segment is drawn between
%B and C, and a right-angle mark is placed at C.
\coordinate (C) at ($(A)!(B)!(C')$);
\draw (B) -- (C);
%These commands draw a right-angle mark at C.
\coordinate (U) at ($(C)!3mm!-45:(A)$);
\draw (U) -- ($(C)!(U)!(A)$);
\draw (U) -- ($(C)!(U)!(B)$);
%These commands draw an invisible line segment perpendicular to ray k from B to
%ray $\ell$. The intersection is labeled C_1.
\path[name path=perpendicular_line_segment_from_B] (B) -- ($(B)!3.5cm!90:(A)$);
\coordinate[name intersections={of=perpendicular_line_segment_from_B and ray_ell, by={C_1}}];
%The following commands define B_1 as the intersection of k and a line segment
%perpendicular to $\ell$ through C_1. A line segment is drawn between
%B_1 and C_1, and a right-angle mark is placed at C_1.
\path[name path=perpendicular_line_segment_from_C_1] (C_1) -- ($(C_1)!4cm!90:(C')$);
\coordinate[name intersections={of=perpendicular_line_segment_from_C_1 and ray_k, by={B_1}}];
\draw (C_1) -- (B_1);
%These commands draw a right-angle mark at C_1.
\coordinate (U_1) at ($(C_1)!3mm!-45:(A)$);
\draw (U_1) -- ($(C_1)!(U_1)!(A)$);
\draw (U_1) -- ($(C_1)!(U_1)!(B_1)$);
%This command draws the two sides of the triangle with a common vertex A.
\draw (A) -- (B_1);
\draw (A) -- (C_1);
%These commands draw an invisible line segment 2.5mm below AD for labels C and C_1.
\coordinate (A_shift_for_labels) at ($(A)!2.5mm!-90:(C_1)$);
\coordinate (C_1_shift_for_labels) at ($(C_1)!2.5mm!90:(A)$);
\path[name path=path_for_labels_C_and_C_1] (A_shift_for_labels) -- (C_1_shift_for_labels);
\coordinate (C_below) at ($(C)!-0.75cm!(B)$);
\path[name path=path_from_B_to_C_below] (B) -- (C_below);
\coordinate (C_1_below) at ($(C_1)!-0.75cm!(B_1)$);
\path[name path=path_from_B_1_to_C_1_below] (B_1) -- (C_1_below);
\coordinate[name intersections={of=path_for_labels_C_and_C_1 and path_from_B_to_C_below, by={C_label}}];
\coordinate[name intersections={of=path_for_labels_C_and_C_1 and path_from_B_1_to_C_1_below, by={C_1_label}}];
\node[green] at (C_label){$C$};
\node[green] at (C_1_label){$C_{1}$};
\end{tikzpicture}
\end{document}
$\strut C$– percusse Jun 27 '15 at 16:45\node[green] at (C_label){$C_{\phantom{1}}$};– Ignasi Jun 27 '15 at 16:49[anchor=base]or[anchor=mid]or[anchor=north]or whichever you prefer... – cfr Jun 27 '15 at 20:48$\strut C$? – user74973 Jun 27 '15 at 21:31$C\smash{_{1}}$can be used. – Kpym Jun 28 '15 at 06:18\smashcommand does ignore the vertical space, and bothCandC_1are typeset equidistant from the ray. It does not ignore the horizontal space, and the "C" inC_1is displaced leftward. How do I getTikZto ignore the area the subscript occupies when positioningC_1? – user74973 Jun 28 '15 at 15:01$C\mathrlap{\smash{_{1}}}$. To be able to use\mathrlapyou have to replaceamsmathwithmathtools. Probably this is not the best way to do it, but it works for me. – Kpym Jun 28 '15 at 18:21amsmath. I tried using anmbox[0pt]to getTikZto ignore the subscript in the following command:\node[green] at (C_1_label){$C\smash{\makebox[0pt]{${}_{1}$}}$};. The subscript is typeset flush against theC, though. – user74973 Jun 29 '15 at 00:59amsmathby replacing it withmathtools, who is an extension ofamsmathAND loads it. You can ckeck this question. – Kpym Jun 29 '15 at 04:53\newlength\myshiftand\settowidth{\myshift}{$_1$}before thetikzpictureenvironment, and he put\node[blue, xshift=.5\myshift] at (B_1_label){$B_{1}$};and\node[blue, xshift=.5\myshift] at (C_1_label){$C\smash{_{1}}$};in the code. I like what he did. The code does typeset, for example, theCinC_1at the position calledC_1_labeljust as it would typesetCatC_1_label. – user74973 Jun 29 '15 at 14:49\myshiftoccupies the same width as the subscript1. How doesxshift=.5\myshift"cancel" the width occupied by1? – user74973 Jun 29 '15 at 14:49