我想像图中所示那样圈出单元格。如何在投影仪框架内执行此操作?
我跟着这个类似的问题但不知道如何使圆圈变粗并呈红色。
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{fit,shapes.geometric}
\begin{document}
\begin{frame}{}
\begin{table}
\begin{tabular}{l | c | c | c | c }
Competitor Name & Swim & Cycle & Run & Total \\
\hline \hline
John T & 13:04 & 24:15 & 18:34 & 55:53 \\
Norman P & 8:00 & 22:45 & 23:02 & 53:47\\
Alex K & 14:00 & 28:00 & n/a & n/a\\
Sarah H & 9:22 & 21:10 & 24:03 & 54:35
\end{tabular}
\caption{Triathlon results}
\end{table}
\end{frame}
\end{document}
答案1
tikz
按照说明使用这个答案是“如何在方程和矩阵中添加箭头?”:
\tikznode
在序言中定义。- 为想要用来装饰的文本分配一个标签
\tikznode
。 - 添加
tikzpicture
带有装饰的环境(使用上一步中的标签)。 - 不要忘记至少运行两次 LaTeX 以确保位置正确。
\documentclass{beamer}
\usepackage{tikz}
\newcommand\tikznode[3][]{%
\tikz[remember picture,baseline=(#2.base)]
\node[minimum size=0pt,inner sep=0pt,#1](#2){#3};%
}
\begin{document}
\begin{frame}
\begin{tabular}{l | c | c | c | c }
Competitor Name & Swim & Cycle & Run & Total \\
\hline\hline
John T & 13:04 & 24:15 & 18:34 & 55:53 \\
Norman P & 8:00 & 22:45 & 23:02 & 53:47\\
Alex K & 14:00 & \tikznode{alex}{28:00} & n/a & n/a\\
Sarah H & 9:22 & 21:10 & 24:03 & 54:35
\end{tabular}
\begin{tikzpicture}[remember picture,overlay]
\draw[red,very thick] (alex) circle[x radius=8mm,y radius=4mm];
\end{tikzpicture}
\end{frame}
\end{document}
答案2
通过使用tikzmark
图书馆。基于突出显示单元格:
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{fit,
tikzmark, % <---
shapes.geometric}
\tikzset{FIT/.style = {%
ellipse, draw=red, thick, inner xsep=0pt, fit=#1}
}
\usepackage{hhline}
\begin{document}
\begin{frame}
\frametitle{Use of \texttt{tikzmark} library}
\begin{table}
\centering
\begin{tabular}{l | c | c | c | c }
Competitor Name
& Swim & Cycle & Run & Total \\
\hhline{=:=:=:=:=}
John T & 13:04 & 24:15 & 18:34 & 55:53 \\
Norman P & 8:00 & 22:45 & 23:02 & 53:47 \\
Alex K & 14:00 & \tikzmarknode{a}{28:00} & n/a & n/a \\
Sarah H & 9:22 & 21:10 & 24:03 & 54:35
\end{tabular}
\begin{tikzpicture}[overlay,remember picture]
\node[FIT=(a)] {};
\end{tikzpicture}
\caption{Table}
\end{table}
\end{frame}
\end{document}
答案3
使用{NiceTabular}
和nicematrix
TikZ 来绘制省略号。
\documentclass{beamer}
\usepackage{nicematrix}
\usepackage{tikz}
\usetikzlibrary{fit,shapes.geometric}
\tikzset{FIT/.style = {ellipse, draw=red, thick, inner xsep=0pt, fit=#1} }
\begin{document}
\begin{frame}
\frametitle{Use of the \texttt{nicematrix}}
\begin{table}
\centering
\begin{NiceTabular}{l | c | c | c | c }
Competitor Name
& Swim & Cycle & Run & Total \\
\Hline\Hline
John T & 13:04 & 24:15 & 18:34 & 55:53 \\
Norman P & 8:00 & 22:45 & 23:02 & 53:47 \\
Alex K & 14:00 & 28:00 & n/a & n/a \\
Sarah H & 9:22 & 21:10 & 24:03 & 54:35 \\
\CodeAfter
\tikz \node[FIT=(4-3)] {} ;
\end{NiceTabular}
\caption{Table}
\end{table}
\end{frame}
\end{document}
答案4
因为我不知道\h
命令是什么,所以我用几个\hline
s 替换了它。你可以用包圈出单元格内容circledsteps
:
\documentclass[svgnames]{beamer}
\usepackage{circledsteps}
\begin{document}
\begin{frame}{title}
\begin{table}
\color{NavyBlue}
\begin{tabular}{l | c | c | c | c }
Competitor Name & Swim & Cycle & Run & Total \\
\hline\hline
John T & 13:04 & 24:15 & 18:34 & 55:53 \\
Norman P & \phantom{0}8:00 & 22:45 & 23:02 & 53:47\\
Alex K & 14:00 & \Circled[outer color=IndianRed, inner ysep=8pt]{28:00} & n/a & n/a\\
Sarah H & \phantom{0}9:22 & 21:10 & 24:03 & 54:35
\end{tabular}
\caption{Triathlon results}
\end{table}
\end{frame}
\end{document}