使用 hf-tikz 突出显示单元格并使用覆盖列时出现问题

使用 hf-tikz 突出显示单元格并使用覆盖列时出现问题

我希望第 6 列(标记为 F)中的红色框逐个出现。此外,在所有框突出显示后,希望最后一列(标记为 G)出现,单元格逐个出现。目前的外观完全是杂乱无章的。所有框都同时出现。

\documentclass[11pt, aspectratio=169]{beamer}
\usepackage{pgfpages}
\usepackage{helvet}
\usepackage[default]{lato}
\usepackage{array}
\usepackage{tikz}
\usepackage{multirow,makecell}
\usepackage{verbatim}
\usepackage[font=scriptsize]{caption}
\usetikzlibrary{positioning}
\usetikzlibrary{calc}
\usetikzlibrary{arrows}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{shapes.misc}
\usetikzlibrary{matrix,shapes,arrows,fit,tikzmark}
\usepackage{amsmath}
\usepackage{mathpazo}
\usepackage{hyperref}
\usepackage{lipsum}
\usepackage{multimedia}
\usepackage{graphicx}
\usepackage{multirow}
\usepackage[space]{grffile}
\usepackage{booktabs}
\usepackage{soul}
\usepackage[beamer,customcolors]{hf-tikz}
\hfsetfillcolor{bg}
\hfsetbordercolor{red}
\setbeamercolor{frametitle}{fg=red!80!black} %only for title

\begin{document}


\begin{frame}{Computing Slack Time \dots}
    \begin{table}
        \centering
        \resizebox{0.4\linewidth}{!}{
            \begin{tabular}{ c | c | c | c | c | c | >{\onslide<7->}c }
                \toprule
            A & B & C & D & E& F &G\\
                \midrule
                A &  $0$ & $2$&  $0$ & $2$  &  \tikzmarkin<2->{a}$0$\tikzmarkend{a} & \uncover<+->{Yes}\\
                \midrule
                B &  $0$ & $3$&  $1$ & $4$  &  \tikzmarkin<0>{b}$1$\tikzmarkend{b} & \uncover<+->{No} \\
                \midrule
                C &  $2$ & $4$&  $2$ & $4$  & \tikzmarkin<3->{c}$0$\tikzmarkend{c}& \uncover<+->{Yes} \\
                \midrule
                D & $3$ & $7$&  $4$ & $8$  &  \tikzmarkin<0>{d}$1$\tikzmarkend{d}& \uncover<+->{No} \\
                \midrule
                E &  $4$ & $8$&  $4$ & $8$  &  \tikzmarkin<4->{e}$0$\tikzmarkend{e} & \uncover<+->{Yes} \\
                \midrule
                F & $4$ & $7$&  $10$ & $13$  &  \tikzmarkin<0>{f}$6$\tikzmarkend{f} & \uncover<+->{No} \\
                \midrule
                G & $8$ & $13$&  $8$ & $13$  &  \tikzmarkin<5->{g}$0$\tikzmarkend{g} & \uncover<+->{Yes} \\
                \midrule
                H & $13$ & $15$&  $13$ & $15$  & \tikzmarkin<6->{h}$0$\tikzmarkend{h} & \uncover<+->{Yes} \\
                \bottomrule
            \end{tabular}
        }
        \caption*{Schedule and Slack Times}
    \end{table} 
\end{frame}
\end{document}

答案1

我不会在这里使用相对覆盖,因为您的单元格在代码中的顺序与您想要发现的顺序不同。

\documentclass[11pt, aspectratio=169]{beamer}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\usepackage{booktabs}
\usepackage[beamer,customcolors]{hf-tikz}
\hfsetfillcolor{bg}
\hfsetbordercolor{red}
\setbeamercolor{frametitle}{fg=red!80!black} %only for title

\begin{document}

\begin{frame}
    \frametitle{Computing Slack Time \dots}
    \begin{table}
        \centering
            \begin{tabular}{ c | c | c | c | c | c | c }
                \toprule
            A & B & C & D & E& F &\uncover<7->{G}\\
                \midrule
                A &  $0$ & $2$&  $0$ & $2$  &  \tikzmarkin<2->{a}$0$\tikzmarkend{a} & \uncover<7->{Yes}\\
                \midrule
                B &  $0$ & $3$&  $1$ & $4$  &  \tikzmarkin<0>{b}$1$\tikzmarkend{b} & \uncover<8->{No} \\
                \midrule
                C &  $2$ & $4$&  $2$ & $4$  & \tikzmarkin<3->{c}$0$\tikzmarkend{c}& \uncover<9->{Yes} \\
                \midrule
                D & $3$ & $7$&  $4$ & $8$  &  \tikzmarkin<0>{d}$1$\tikzmarkend{d}& \uncover<10->{No} \\
                \midrule
                E &  $4$ & $8$&  $4$ & $8$  &  \tikzmarkin<4->{e}$0$\tikzmarkend{e} & \uncover<11->{Yes} \\
                \midrule
                F & $4$ & $7$&  $10$ & $13$  &  \tikzmarkin<0>{f}$6$\tikzmarkend{f} & \uncover<12->{No} \\
                \midrule
                G & $8$ & $13$&  $8$ & $13$  &  \tikzmarkin<5->{g}$0$\tikzmarkend{g} & \uncover<13->{Yes} \\
                \midrule
                H & $13$ & $15$&  $13$ & $15$  & \tikzmarkin<6->{h}$0$\tikzmarkend{h} & \uncover<14->{Yes} \\
                \bottomrule
            \end{tabular}
        \caption{Schedule and Slack Times}
    \end{table} 
\end{frame}
\end{document}

在此处输入图片描述

相关内容