
2 つのノードの右側に中括弧を作成したいのですが、中括弧をノードに接続するのではなく、余分なスペースを確保したいのです。開始位置については私のソリューションはうまく機能しているようですが、何らかの理由で終了位置は影響を受けません。何が間違っているのでしょうか。また、どうすればよいでしょうか。
\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}
答え1
シフトやそれらの計算は必要ありません。代わりに、raise=<length>
ブレース オプションを追加するだけです。
出力
コード
\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}