1

I have this snippet, which works fine:

\coordinate(foo) at (start |- something.south);

However, I want to add some value onto the y of something.south prior to calculating the |-. I've tried every combination of syntax I could think of, including this one I thought should work:

\coordinate(foo) at (start |- something.south+(0,1mm));

However, this gives an error:

Package tikz Error: Giving up on this path. Did you forget a semicolon?.

How can I adjust a point prior to applying the |- operator?

2

These are three ways to accomplish this, only the last one requires the calc library. This list is not exhaustive.

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
  \begin{scope}[x=0.5mm,local bounding box=L]%
    \coordinate(start) at (0,0);
    \coordinate(end) at (230, 0);
    \node (something) at (50,3) {something};
    \coordinate(foo) at ([yshift=1mm]something.south-|start); 
    \draw[thick,->] (start) -- (foo);
  \end{scope}
  \node[above] at (L.north){with \texttt{yshift}};
  \begin{scope}[xshift=6cm,x=0.5mm,local bounding box=M]%
    \coordinate(start) at (0,0);
    \coordinate(end) at (230, 0);
    \node (something) at (50,3) {something};
    \path (something.south-|start) + (0,1mm) coordinate(foo); 
    \draw[thick,->] (start) -- (foo);
  \end{scope}
  \node[above] at (M.north){with \texttt{path}};
  \begin{scope}[xshift=12cm,x=0.5mm,local bounding box=R]%
    \coordinate(start) at (0,0);
    \coordinate(end) at (230, 0);
    \node (something) at (50,3) {something};
    \coordinate(foo) at ($(something.south-|start)+(0,1mm)$); 
    \draw[thick,->] (start) -- (foo);
  \end{scope}
  \node[above] at (R.north){with \texttt{calc}};
\end{tikzpicture}
\end{document}

enter image description here

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.