
Ich möchte rechts von zwei Knoten eine Klammer machen, aber ich möchte nicht, dass sie befestigt wird, sondern etwas zusätzlichen Platz. Für den Startort scheint meine Lösung gut zu funktionieren, aber aus irgendeinem Grund ist die Endposition davon nicht betroffen. Was mache ich falsch und wie soll ich es machen?
\documentclass{memoir}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric, positioning, arrows.meta, decorations.pathreplacing}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
\node (foo) [draw, minimum width=6 em]
{Foo};
\node (bar) [draw, minimum width=6 em, below=of foo]
{Bar};
\draw [thick, decorate, decoration={brace, amplitude=6pt}] (foo.north east) + (1ex,1ex) -- (bar.south east) + (1ex, -1ex) node(foobar) [midway, xshift=3em] {FooBar};
\end{tikzpicture}
\end{document}
Antwort1
Sie benötigen weder eine Verschiebung noch derartige Berechnungen, sondern können raise=<length>
die Klammeroptionen einfach ergänzen.
Ausgabe
Code
\documentclass{memoir}
\usepackage{tikz}
\usetikzlibrary{calc, shapes.geometric, positioning, arrows.meta, decorations.pathreplacing}
\begin{document}
\begin{tikzpicture}
\node (foo) [draw, minimum width=6 em]
{Foo};
\node (bar) [draw, minimum width=6 em, below=of foo]
{Bar};
\draw [thick, decorate, decoration={brace, amplitude=6pt, raise=5pt}] (foo.north east) -- (bar.south east) node(foobar) [midway, xshift=3em] {FooBar};
\end{tikzpicture}
\end{document}