記事ドキュメントクラスに含まれる表の水平線が、Beamer では表示されない

記事ドキュメントクラスに含まれる表の水平線が、Beamer では表示されない

次の表(hhline によって表に現れる余分な黒い線を削除する方法) はドキュメント クラスでは正常に動作していますarticleが、テーブルの水平線はbeamerクラスでは表示されません。

\documentclass{article}
 \usepackage{hhline}
  \usepackage[table, svgnames]{xcolor}

  \usepackage{multirow}
 \usepackage{booktabs}

 \definecolor{Aliceblue}{rgb}{0.94, 0.97, 1.0}
\definecolor{aliceblue}{rgb}{0.94, 0.97, 1.0}

\definecolor{babyblue}{rgb}{0.54, 0.81, 0.94}

 \begin{document}

  \begin{table}[ht]
\centering
\setlength\arrayrulewidth{1.3pt}
\footnotesize\setlength{\tabcolsep}{2.7 pt}
\renewcommand{\arraystretch}{1.4}
\begin{tabular}{|c|c|c|c|c|c|c|}
    \hline
    \cellcolor{aliceblue}  & \multicolumn{2}{c|}{\cellcolor{babyblue}ISE} & \multicolumn{2}{c|}{\cellcolor{babyblue}IAE} & \multicolumn{2}{c|}{\cellcolor{babyblue}ITAE} \\ 
    \hhline{|>{\arrayrulecolor{aliceblue}}->{\arrayrulecolor{black}}|-|-|-|-|-|-|} % <==========================================
    \multirow{-2}{*}{\cellcolor{aliceblue}Methods}
    & \cellcolor{aliceblue}-20\%       & \cellcolor{aliceblue}+20\%     & \cellcolor{aliceblue}-20\%        & \cellcolor{aliceblue}+20\%      & \cellcolor{aliceblue}-20\%       & \cellcolor{aliceblue}+20\%        \\ \hhline{-|*6-}
    \rowcolor{babyblue}ABC                                                           & 0.5645      & 0.63     & 1.8       & 1.8      & 6.1       & 6.6       \\ \hhline{-|*6-}
    \rowcolor{aliceblue}XYZ                                                            & 2.1       & 2.3      & 0.881       & 9.82      & 9.2       & 28.9       \\ \hhline{-|*6-}
    \rowcolor{babyblue}MNO                                                                & 0.68      & 0.97     & 1.62       & 1.61      & 8.9       & 8.2       \\ \hhline{-|*6-}
    \rowcolor{aliceblue} PQR                                                                 & 0.65       & 0.753     & 2.064       & 2.231      & 28.04       & 28.56       \\ \hhline{-|*6-}
\end{tabular}
\end{table}
\end{document} 

beamer環境でも水平線が表示されるようにするにはどうすればよいでしょうか?

答え1

重複の可能性があるこれしたがって、賛成票を投じないでください:

完全なソリューション:

\documentclass[xcolor=table]{beamer}
 \usepackage{hhline}
\makeatletter
\let\zz\reset@color
\def\reset@color{\kern\z@\zz}
\makeatother

  \usepackage{multirow}
 \usepackage{booktabs}

 \definecolor{Aliceblue}{rgb}{0.94, 0.97, 1.0}
\definecolor{aliceblue}{rgb}{0.94, 0.97, 1.0}

\definecolor{babyblue}{rgb}{0.54, 0.81, 0.94}

 \begin{document}
\begin{frame}
  \begin{table}[ht]
\centering
\setlength\arrayrulewidth{1.3pt}
\footnotesize\setlength{\tabcolsep}{2.7 pt}
\renewcommand{\arraystretch}{1.4}
\begin{tabular}{|c|c|c|c|c|c|c|}
    \hline
    \cellcolor{aliceblue}  & \multicolumn{2}{c|}{\cellcolor{babyblue}ISE} & \multicolumn{2}{c|}{\cellcolor{babyblue}IAE} & \multicolumn{2}{c|}{\cellcolor{babyblue}ITAE} \\ 
    \hhline{|>{\arrayrulecolor{aliceblue}}->{\arrayrulecolor{black}}|-|-|-|-|-|-|} % <==========================================
    \multirow{-2}{*}{\cellcolor{aliceblue}Methods}
    & \cellcolor{aliceblue}-20\%       & \cellcolor{aliceblue}+20\%     & \cellcolor{aliceblue}-20\%        & \cellcolor{aliceblue}+20\%      & \cellcolor{aliceblue}-20\%       & \cellcolor{aliceblue}+20\%        \\ \hhline{-|*6-}
    \rowcolor{babyblue}ABC                                                           & 0.5645      & 0.63     & 1.8       & 1.8      & 6.1       & 6.6       \\ \hhline{-|*6-}
    \rowcolor{aliceblue}XYZ                                                            & 2.1       & 2.3      & 0.881       & 9.82      & 9.2       & 28.9       \\ \hhline{-|*6-}
    \rowcolor{babyblue}MNO                                                                & 0.68      & 0.97     & 1.62       & 1.61      & 8.9       & 8.2       \\ \hhline{-|*6-}
    \rowcolor{aliceblue} PQR                                                                 & 0.65       & 0.753     & 2.064       & 2.231      & 28.04       & 28.56       \\ \hhline{-|*6-}
\end{tabular}
\end{table}
\end{frame}
\end{document} 

ここに画像の説明を入力してください

答え2

{NiceTabular}of を使用すると、その表を簡単に作成できますnicematrix

\documentclass[xcolor]{beamer}
\usepackage{nicematrix}


\definecolor{aliceblue}{rgb}{0.94, 0.97, 1.0}
\definecolor{babyblue}{rgb}{0.54, 0.81, 0.94}

\begin{document}
\begin{frame}
\begin{table}[ht]
\centering
\setlength{\arrayrulewidth}{1.3pt}
\footnotesize
\setlength{\tabcolsep}{2.7 pt}
\renewcommand{\arraystretch}{1.4}
\begin{NiceTabular}{ccccccc}[hvlines]
\CodeBefore
  \rowcolors{1}{babyblue}{aliceblue}
\Body
  \Block[fill=aliceblue]{2-1}{Methods} & \Block{1-2}{ISE} && \Block{1-2}{IAE} && \Block{1-2}{ITAE} \\ 
      &$-$20\%   & +20\%  & $-$20\%  & +20\% & $-$20\% & +20\%  \\
  ABC & 0.5645 & 0.63   & 1.8    & 1.8   & 6.1   & 6.6    \\ 
  XYZ & 2.1    & 2.3    & 0.881  & 9.82  & 9.2   & 28.9   \\ 
  MNO & 0.68   & 0.97   & 1.62   & 1.61  & 8.9   & 8.2    \\ 
  PQR & 0.65   & 0.753  & 2.064  & 2.231 & 28.04 & 28.56  \\ 
\end{NiceTabular}
\end{table}
\end{frame}
\end{document} 

複数のコンパイルが必要です (nicematrix内部で PGF/Tikz ノードが使用されるため)。

上記コードの出力

関連情報