如何从 beamer 中的标题中删除表格名称?

如何从 beamer 中的标题中删除表格名称?

代码

\documentclass[xcolor={x11names,table}]{beamer}
% http://tex.stackexchange.com/a/303060/13173
% http://tex.stackexchange.com/a/303091/13173
% http://tex.stackexchange.com/a/196808/13173
% http://tex.stackexchange.com/a/303021/13173

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage[TS1,T1]{fontenc}
\usefonttheme{professionalfonts}% otherwise fourier's font configuration will be partially overridden
\usepackage{fourier, heuristica}
\usepackage{array, booktabs}

\usepackage{caption}

\newcommand{\foo}{%
   \color{LightSteelBlue3}%
   \makebox[0pt]{\textbullet}%
   \hskip-0.5pt\vrule width 1pt%
   \hspace{\labelsep}%
}

\newlength{\CVbreakdotsep}% length to change spacing between dots
\setlength{\CVbreakdotsep}{0.6mm}

\newcommand{\CVbreakdot}{% command for smaller dots
   \scalebox{0.6}{\textbullet}%
}

\newcommand{\CVbreak}{% command for the break itself
   \multicolumn{2}{l}{%
      \hspace*{8.715mm}% <--- align dots with vertical line
      \rotatebox[origin=c]{-90}{%
         \color{LightSteelBlue3}%
         \hspace{2mm}% <--- extra vertical space
         \CVbreakdot\kern\CVbreakdotsep\CVbreakdot\kern\CVbreakdotsep\CVbreakdot
         \hspace{2mm}% <--- extra vertical space
      }%
   } \\%
}

\begin{document}

\begin{frame}
\begin{table}
   \renewcommand\arraystretch{1.4}
   \caption{Timeline, really?}\vskip -1.5ex
   \arrayrulecolor{LightSteelBlue3}
   \begin{tabular}{@{\,}r <{\hskip 2pt} !{\foo} >{\raggedright\arraybackslash}p{5cm}}
      \toprule
      \addlinespace[1.5ex]
      1969 & Lassa virus. \\
      \CVbreak
      1989 & Guanarito virus, Venezuela. \\
   \end{tabular}
\end{table}
\end{frame}

\end{document} 

Nunkulla 的测试代码

在前面加上下面一行\caption{...}

\captionsetup{labelformat=empty}

我在装有 MacTeX 2015 的 OS X 10.11.4 系统中运行了 Nunkulla 的代码,没有看到 Nunkulla 所看到的效果,而且我确实\captionsetup{...}在一个实例中激活了它

在此处输入图片描述

解决方案:运行TeX Live Utility并更新软件包。和 ... 是在 MacTeX 2015 发布后发行的,因此未包含在软件包中。输出与现在接受的答案相同。


你怎么能没有桌子在 Beamer's Cut 中?

答案1

该答案遵循了@egreg 在此处发布的答案中的建议:表格标题不包含“表格”一词,使用caption包和captionsetup该包中的选项。包手册第 3.2 节给出了此实例中标题设置的正确用法caption。由于期望结果是在特定表环境中隐藏标签,因此\captionsetup{labelformat=empty}必须将命令放置在否则将生成标签的环境中。

以下代码演示了这一点,在第一个垂直时间轴中,使用 隐藏了“Table” captionsetup{labelformat=empty}。在后续示例中,该示例复制了第一个示例中的标题和表格,但这次隐藏了captionsetup{labelformat=empty}命令,生成了标签“Table”。

\documentclass[xcolor={x11names,table}]{beamer}
% https://tex.stackexchange.com/a/303060/13173
% https://tex.stackexchange.com/a/303091/13173
% https://tex.stackexchange.com/a/196808/13173
% https://tex.stackexchange.com/a/303021/13173

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage[TS1,T1]{fontenc}
\usefonttheme{professionalfonts}% otherwise fourier's font configuration will be partially overridden
\usepackage{fourier, heuristica}
\usepackage{array, booktabs}
\usepackage{caption}


\newcommand{\foo}{%
   \color{LightSteelBlue3}%
   \makebox[0pt]{\textbullet}%
   \hskip-0.5pt\vrule width 1pt%
   \hspace{\labelsep}%
}

\newlength{\CVbreakdotsep}% length to change spacing between dots
\setlength{\CVbreakdotsep}{0.6mm}

\newcommand{\CVbreakdot}{% command for smaller dots
   \scalebox{0.6}{\textbullet}%
}

\newcommand{\CVbreak}{% command for the break itself
   \multicolumn{2}{l}{%
      \hspace*{8.715mm}% <--- align dots with vertical line
      \rotatebox[origin=c]{-90}{%
         \color{LightSteelBlue3}%
         \hspace{2mm}% <--- extra vertical space
         \CVbreakdot\kern\CVbreakdotsep\CVbreakdot\kern\CVbreakdotsep\CVbreakdot
         \hspace{2mm}% <--- extra vertical space
      }%
   } \\%
}

\begin{document}

\begin{frame}
\begin{table}
   \renewcommand\arraystretch{1.4}
   \captionsetup{labelformat=empty}   % suppress label ``Table''
   \caption{Timeline, really?}\vskip -1.5ex
   \arrayrulecolor{LightSteelBlue3}
   \begin{tabular}{@{\,}r <{\hskip 2pt} !{\foo} >{\raggedright\arraybackslash}p{5cm}}
      \toprule
      \addlinespace[1.5ex]
      1969 & Lassa virus. \\
      \CVbreak
      1989 & Guanarito virus, Venezuela. \\
   \end{tabular}
\end{table}

\begin{table}
    \renewcommand\arraystretch{1.4}
%   \captionsetup{labelformat=empty} % Label ``Table'' is not suppressed
    \caption{Timeline, really?}\vskip -1.5ex
    \arrayrulecolor{LightSteelBlue3}
    \begin{tabular}{@{\,}r <{\hskip 2pt} !{\foo} >{\raggedright\arraybackslash}p{5cm}}
        \toprule
        \addlinespace[1.5ex]
        1969 & Lassa virus. \\
        \CVbreak
        1989 & Guanarito virus, Venezuela. \\
    \end{tabular}
\end{table}
\end{frame}

\end{document} 

在此处输入图片描述

答案2

不想要标题?不要使用标题!

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

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage[TS1,T1]{fontenc}
\usefonttheme{professionalfonts}% otherwise fourier's font configuration will be partially overridden
\usepackage{fourier, heuristica}
\usepackage{array, booktabs}

\newcommand{\foo}{%
    \color{LightSteelBlue3}%
    \makebox[0pt]{\textbullet}%
    \hskip-0.5pt\vrule width 1pt%
    \hspace{\labelsep}%
}

\newlength{\CVbreakdotsep}% length to change spacing between dots
\setlength{\CVbreakdotsep}{0.6mm}

\newcommand{\CVbreakdot}{% command for smaller dots
    \scalebox{0.6}{\textbullet}%
}

\newcommand{\CVbreak}{% command for the break itself
    \multicolumn{2}{l}{%
        \hspace*{8.715mm}% <--- align dots with vertical line
        \rotatebox[origin=c]{-90}{%
            \color{LightSteelBlue3}%
            \hspace{2mm}% <--- extra vertical space
            \CVbreakdot\kern\CVbreakdotsep\CVbreakdot\kern\CVbreakdotsep\CVbreakdot
            \hspace{2mm}% <--- extra vertical space
        }%
    } \\%
}

\begin{document}

    \begin{frame}
        \begin{table}
            \renewcommand\arraystretch{1.4}
            Timeline, really?\linebreak
            \arrayrulecolor{LightSteelBlue3}
            \begin{tabular}{@{\,}r <{\hskip 2pt} !{\foo} >{\raggedright\arraybackslash}p{5cm}}
                \toprule
                \addlinespace[1.5ex]
                1969 & Lassa virus. \\
                \CVbreak
                1989 & Guanarito virus, Venezuela. \\
            \end{tabular}
        \end{table}
    \end{frame}

\end{document} 

在此处输入图片描述

相关内容