首頁>LaTeX>source

下表(如何删除由於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中可见   環境也是如此?

最新回復
  • 2019-12-5
    1 #

    可能重複這个,所以,不要upvote:

    完整解決方案:

    \documentclass[xcolor=table]{beamer}
     \usepackage{hhline}
    \makeatletter
    \let\zz\[email protected]
    \def\[email protected]{\kern\[email protected]\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}
    

  • LaTeX tikz pgf:全域性pgfplotset搞亂錯誤欄
  • \ multirow中的頂部垂直對齐方式