![我怎样才能在 tikz 中制作“underbrace”](https://linux22.com/image/428245/%E6%88%91%E6%80%8E%E6%A0%B7%E6%89%8D%E8%83%BD%E5%9C%A8%20tikz%20%E4%B8%AD%E5%88%B6%E4%BD%9C%E2%80%9Cunderbrace%E2%80%9D.png)
答案1
好吧,让我来阐述一下我对答案的评论。书法风格括号的示例:
\documentclass[margin=3mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing,
calligraphy}% had to be loaded after decorations.pathreplacing library
\tikzset{
B/.style = {decorate,
decoration={calligraphic brace, amplitude=4pt,
raise=1pt, mirror},% for mirroring of brace
very thick,
pen colour=black},
dot/.style = {circle, fill, inner sep=2pt, outer sep=0pt}
}
\begin{document}
\begin{tikzpicture}
\foreach \i in {0,1,...,5}
\node (n\i) [dot] at (\i,0) {};
%
\draw (n0) to [bend left=60] (n2)
(n1) to [bend left=45] (n4)
(n3) to [bend left=60] (n5);
%
\draw[B] (0,0) -- node[below=2mm] {A} (3,0);
\end{tikzpicture}
\end{document}
答案2
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing}
\begin{document}
\begin{tikzpicture}
\draw [decorate,decoration={brace,amplitude=10pt},xshift=0pt,yshift=0pt]
(0,0) -- (-5,0) node [black,midway,xshift=0cm,yshift=-0.5cm]
{\footnotesize A};
\draw [decorate,decoration={brace,amplitude=10pt},xshift=0pt,yshift=0pt]
(3,0) -- (0.5,0) node [black,midway,xshift=0cm,yshift=-0.5cm]
{\footnotesize B};
\end{tikzpicture}
\end{document}