我怎样才能在 tikz 中制作“underbrace”

我怎样才能在 tikz 中制作“underbrace”

我需要像图片中那样的 tikz 中的 \underbrace,我该如何制作它。在此处输入图片描述

答案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}

在此处输入图片描述

相关内容