# How to draw over an picture in TikZ?

My code:

\documentclass{scrartcl}
\usepackage{stanli}
\begin{document}

\begin{tikzpicture}
%the points
\point{above}{0}{5};
\point{above_middle}{0}{4};
\point{below_middle}{0}{1};
\point{below}{0}{0};
%the rod
\beam{2}{above}{above_middle};
\beam{2}{below}{below_middle};
%the support
\support{1}{above}[180];
\hinge{1}{above};
%the mass
\node at (below) [circle, draw] {$m$};
%the free body diagram (for the rod)
%S
\point{S}{0}{3};
\notation{1}{S}{$S$};
%-S
\point{-S}{0}{2};
\notation{1}{-S}{$S$}[below right];
\end{tikzpicture}

\end{document}


The result:

The ball is behind the rod. I don't know why. It should be in front of the rod. How can one manipulate the layers of the pictures? A completely different solution is welcome too.

Thank you for your help and effort in advance!

If you're talking about the circle with the m in it, it is not behind the rod, but it isn't filled either -- it consists of a black circle with the letter m in it. Add fill=white to the node settings.

\documentclass{scrartcl}
\usepackage{stanli}
\begin{document}

\begin{tikzpicture}
%the points
\point{above}{0}{5};
\point{above_middle}{0}{4};
\point{below_middle}{0}{1};
\point{below}{0}{0};
%the rod
\beam{2}{above}{above_middle};
\beam{2}{below}{below_middle};
%the support
\support{1}{above}[180];
\hinge{1}{above};
%the mass
\node at (below) [circle, draw,fill=white] {$m$}; % <----- added fill=white
%the free body diagram (for the rod)
%S
\point{S}{0}{3};
\notation{1}{S}{$S$};
%-S
\point{-S}{0}{2};
\notation{1}{-S}{$S$}[below right];
\end{tikzpicture}

• What does stanli do? I've never heard of it. Presumably, a TikZ-based package for something?
– cfr
Dec 2, 2017 at 21:21
• @cfr texdoc stanli -> "TikZ library for structural analysis". Dec 2, 2017 at 21:22

A PSTricks solution.

\documentclass[pstricks]{standalone}
\usepackage{pst-node}

\begin{document}
\begin{pspicture}(-1,.2)(1,-4.4)
% top part
\psframe[fillstyle=vlines,hatchsep=1pt,linestyle=none](-1,.2)(1,0)
\psline(-1,0)(1,0)
\pnode(-.5,0){L}
\pnode(.5,0){R}
\pnode(0,-2){S}
\naput[npos=1]{$S$}
\rput(0,-4){\Circlenode[radius=10pt]{m}{$m$}}
\ncline{->}{m}{S'}\nbput[npos=1]{$S$}

• hatchangle can be used to change the hatching direction. Dec 2, 2017 at 22:05