我已经为 beamer 中的表格编写了以下代码。
\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage{eso-pic}
\usepackage{lmodern} % for bold italic
\usecolortheme{default}
\begin{document}
\begin{frame}
\setlength{\unitlength}{0.20mm}
\begin{picture}(400,250)
\put(50,0){\line(1,0){525}}
\put(50,50){\line(1,0){525}}
\put(50,100){\line(1,0){525}}
\put(50,0){\line(0,1){100}}
\put(200,0){\line(0,1){100}}
\put(250,0){\line(0,1){100}}
\put(375,0){\line(0,1){100}}
\put(425,0){\line(0,1){100}}
\put(575,0){\line(0,1){100}}
\put(90,25){\color{black} Users }
\put(215,25){\color{black} 10 }
\put(260,25){\color{black} 1234500 }
\put(390,25){\color{black} 450}
\put(460,25){\color{black} Users }
\put(70,75){\color{blue} First Section }
\put(215,75){\color{black} AA }
\put(260,75){\color{magenta} BB }
\put(390,75){\color{black} ZZ }
\put(440,75){\color{blue} Last Section }
\end{picture}
\end{frame}
\end{document}
我想从 AA 单元格的左边缘到 ZZ 单元格的右边缘绘制一个上部支撑。我该怎么做?我还想在上部支撑上方写一些文字。
答案1
我不明白为什么需要picture
环境来制作表格。我建议使用一个简单的tabular
环境,并使用pstricks
带有一些文本的 overbracket(在我看来,它看起来比 overbrace 好看):
\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage{eso-pic}
\usepackage{lmodern} % for bold italic
\usepackage{pst-node, auto-pst-pdf}
\usepackage{makecell}
\setcellgapes{10pt}
\usecolortheme{default}
\begin{document}
\begin{frame}
\centering\makegapedcells%\renewcommand\arraystretch{2}
\begin{postscript}
\begin{tabular}{| *{5}{c|}}
\hline
\color{blue} First Section & \pnode(0,20pt){A}AA & \color{magenta} BB & ZZ\pnode(0,20pt){Z} & \color{blue} Last Section \\
\hline
Users & 10 & 1234500 & 450 & Users \\
\hline
\end{tabular}
\ncbar[angle=90, linewidth=0.4pt, arm=1ex]{A}{Z}\naput{some text}
\end{postscript}
\end{frame}
\end{document}