将大水平括号与表格的列对齐?

将大水平括号与表格的列对齐?

如同这个问题,但括号应该跨多列,而不是多行。例如:

      animal               plant
 -------/\--------   -------/\----------
/                 \ /                   \
+--------+---------+---------+-----------+
|chicken | dog     | oak     |   maple   |
+--------+---------+---------+-----------+

答案1

像这样吗?

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{tikzmark,decorations.pathreplacing}
\tikzstyle{curly} = [decorate,decoration={brace,amplitude=10pt}]
\begin{document}
    \Huge\centering
    \begin{tabular}{cccc}
        \tikzmark{a}chicken & dog\tikzmark{b} & \tikzmark{c}oak & maple\tikzmark{d}
    \end{tabular}
    \begin{tikzpicture}[yshift=.7\baselineskip,overlay,remember picture]
        \draw[curly] (pic cs:a) -- (pic cs:b) node[midway,above=5] {animal};
        \draw[curly] (pic cs:c) -- (pic cs:d) node[midway,above=5] {plant};
    \end{tikzpicture}
\end{document}

截屏

相关内容