hf-tikz 및 xcolor 관련 문제

hf-tikz 및 xcolor 관련 문제

\rowscolors(of xcolor)와 \tikzmarkin(of hf-tikz)는 호환되지 않는 것 같습니다 . 다음은 문제를 설명하는 최소한의 예입니다.

\documentclass[xcolor={table,dvipsnames}]{beamer}
\usepackage[customcolors,beamer]{hf-tikz}

\usetheme{Copenhagen}

\begin{document}

\begin{frame}{}

\begin{table}
\centering 
\rowcolors{2}{gray!20}{white}
\begin{tabular}{lccc}
A & B & C & D \\ 
00 & 100\% & 100\% & 0\% \\ 
\tikzmarkin<1>{a} 05  &  58 & 181  & 50 \tikzmarkend{a} \\ 
\tikzmarkin<2>{b} 10 & 87 & 112 & 1.6 \tikzmarkend{b} \\ 
20 & 92 & 115 & 1.6 \\ 
30 & 87 & 117 & 1.6 \\ 
40 & 81 & 121 & 1.6 \\ 
\end{tabular}
\end{table}%

\end{frame}

\end{document}

에 의해 생성된 주석은 hf-tikz행의 첫 번째 셀 위에만 표시되지만 전체 행을 덮어야 합니다. 다음 그림은 위 예제의 출력을 보여줍니다.

여기에 이미지 설명을 입력하세요

또한 행의 첫 번째 셀이 더 이상 왼쪽 맞춤이 아닌 것 같습니다. 이 문제를 해결하는 방법에 대한 힌트가 있습니까?

답변1

해결 방법으로 를 사용하지 말고 hf-tikz직접 강조 표시하십시오.

\documentclass[xcolor={table,dvipsnames}]{beamer}

\usetheme{Copenhagen}

% from https://tex.stackexchange.com/a/315248/36296
\usepackage{tikz}
\usetikzlibrary{matrix,shapes,arrows,fit,tikzmark}

% Some options common to all the nodes and paths
\tikzset{   
    every picture/.style={remember picture,baseline},
    every node/.style={anchor=base,align=center,outer sep=1.5pt},
    every path/.style={thick},
}

\newcommand\marktopleft[1]{%
    \tikz[overlay,remember picture] 
    \node (marker-#1-a) at (.1em,.3em) {};%
}
\newcommand\markbottomright[1]{%
    \tikz[overlay,remember picture] 
    \node (marker-#1-b) at (.1em,.3em) {};%
    \tikz[overlay,remember picture,inner sep=1pt]
    \node[draw=red,rounded corners,fit=(marker-#1-a.north west) (marker-#1-b.south east)] {};%
}

\begin{document}

\begin{frame}{}

\begin{table}
\centering 
\rowcolors{2}{gray!20}{white}
\begin{tabular}{lccc}
A & B & C & D \\ 
00 & 100\% & 100\% & 0\% \\ 
\only<1>{\marktopleft{a}}05 & 58 & 181 & 50\only<1>{\markbottomright{a}}\\ 
\only<2>{\marktopleft{b}}10 & 87 & 112 & 1.6\only<2>{\markbottomright{b}}\\ 
20 & 92 & 115 & 1.6 \\ 
30 & 87 & 117 & 1.6 \\ 
40 & 81 & 121 & 1.6 \\ 
\end{tabular}
\end{table}%

\end{frame}

\end{document}

여기에 이미지 설명을 입력하세요

관련 정보