How can I draw only parts of a rectangle? I want to omit a small part of the rectangle to put some text in. As I'm using various complex rectangles, I do not want to construct own "open rectangles".
Is there a way to do this? Maybe similarly to using an arc?
Currently, I'm using
\begin{tikzpicture}
\draw[rounded corners=3pt] (-5,-5) rectangle (5,5);
\node at (0,5) {text with line in the middle from rectangle};
\end{tikzpicture}
I have already tried
to clip the rectangle using an arc or leaving out some part of the rectangle using How can I invert a 'clip' selection within TikZ?, but both got too complex, fragile and did not work. There must be an easy way!?
Update:
Since there are other drawings beneath, using filling color beneath the text is no solution. The following example is a simple one, in other pictures there is even more "lively a background" behind the text...




(label) -| (-5,-5) -| (5,5) -- (label);would suffice for input labor. But I think the idea is to have a nonclosed rectangle as arc to a circle though I think best is to make a node shape. – percusse Sep 04 '12 at 21:10fillfor the rectangle. the text will be partially covered; I think the OP wants some easy equivalent for something like the following code produces `\documentclass{article} \usepackage{tikz}\begin{document} \begin{tikzpicture} \node (label) at (0,5) {\phantom{text with line in the middle from rectangle}}; \draw[rounded corners=3pt,fill=red!20] (label) -| (-5,-5) -| (5,5) -- (label); \node at (0,5) {text with line in the middle from rectangle}; \end{tikzpicture} \end{document}`
– Gonzalo Medina Sep 04 '12 at 21:26