Wie korrigiere ich die Tikz-Position „\draw“ manuell?

Wie korrigiere ich die Tikz-Position „\draw“ manuell?

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}

Bildbeschreibung hier eingeben

Antwort1

Sie benötigen weder eine Verschiebung noch derartige Berechnungen, sondern können raise=<length>die Klammeroptionen einfach ergänzen.

Ausgabe

Abbildung 1

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}

verwandte Informationen