Beamer:表格周围的 Tcolorbox,背景颜色大小/宽度增加

Beamer:表格周围的 Tcolorbox,背景颜色大小/宽度增加

在我的 MWE 中,我有不同类型的框架,在附录中,我在幻灯片的右侧有一个目录。现在我有一张幻灯片,其中包含一个表格,我想在其周围设置灰色背景。目前我有:


\documentclass{beamer}
\usetheme{Goettingen}
\usepackage{hyperref}
\usepackage{appendixnumberbeamer}
\usepackage{tcolorbox}
\usepackage{german}
\usepackage{makecell}

\renewcommand\theadalign{bc}
\renewcommand\theadfont{\bfseries}
\renewcommand\theadgape{\Gape[4pt]}
\renewcommand\cellgape{\Gape[4pt]}


\setbeamertemplate{itemize/enumerate body begin}{\Large}
\setbeamertemplate{itemize/enumerate subbody begin}{\large}
\hypersetup{pdfpagemode=FullScreen}

\setbeamerfont{page number in head/foot}{size=\large}
\setbeamertemplate{footline}[frame number]



\newenvironment{specialframe}
{
    \begingroup
    \advance\textwidth2cm % see beamerthemeGoettingen.sty for the number
    \hsize\textwidth
    \columnwidth\textwidth
    \begin{frame}[plain]
}
{
    \end{frame}
    \endgroup
}

\begin{document}

\setbeamertemplate{navigation symbols}{}


\title[My study]{Test text\\ Text Text Text TextvTextTextTextTextText Text Text}
\author[J. Doe]{\textbf{My name\\ \vspace{0.2cm}Test test \\Test test TEst Test Test TeTs}}
\titlegraphic{\includegraphics[width=4cm]{myLogo}}
\date{Place, 11 March 2020}

{
\setbeamercolor{page number in head/foot}{fg=structure.fg!10}
\begin{frame}[noframenumbering]
\titlepage
\end{frame}
}


\section{Introduction}
\frame[label=Einf]{
\frametitle{Test \hyperlink{details}{\beamergotobutton{Test}}}
\vspace{0.05cm}
\begin{itemize}
\item Test
\begin{itemize}
\item Test
\end{itemize}
\end{itemize}
}

\section{Test2}
\frame{
\frametitle{Test}
Test
}


\begin{specialframe}

\begin{tcolorbox}[colback=gray!20, colframe=gray!20]
\begin{tabular}{ l | c | r | c | c }

  \footnotesize $\bar{X}_T-\bar{X}_V$ & \makecell{\footnotesize Std Text \\$s_{\bar{X}_T-\bar{X}_V}$}& \makecell{\footnotesize Std Text DE \\$SE_{\bar{X}_T-\bar{X}_V}$}& \makecell{\footnotesize T Wert \\\footnotesize $1-\alpha=2,5\%$\\\footnotesize $df=398$}&\makecell{\footnotesize Text te \\Text\\ \footnotesize KI Test Test Test } \\
  \hline    
   -0.33 & 5 & 6& 6 & 6 \\
  7 & 8 & 9 & 6 & 6\\
  \hline  
\end{tabular}
\end{tcolorbox}

\end{specialframe}


\appendix
\setbeamercolor{page number in head/foot}{fg=structure.fg!10}
\section{End}
\frame[label=End]{
\frametitle{Test \hyperlink{details}{\beamergotobutton{Test}}}
\vspace{0.05cm}
\begin{itemize}
\item Test
\begin{itemize}
\item Test
\end{itemize}
\end{itemize}
}

\section[Sources]{references}
\begin{frame}\frametitle{Test \& Test}

\begin{thebibliography}{9}
\bibitem[Beamerpaket]{paket} \emph{Beamer Paket} \\
\text{http://latex-beamer.sourceforge.net/}

\end{thebibliography}


\end{frame}



\end{document}

我的 tcolorbox 的灰色背景应该更大一些,以便最后一列也被完全覆盖。

s

但只要足够就行。如我画的虚线所示。所以取决于里面的文字。我试过超大尺寸,但没什么用。我仍然想让左边保持原样。使用超大尺寸时,我遇到的问题是左边的整个区域都是灰色的,没有空白/边距了。

答案1

这就是你的意思。

\documentclass{beamer}
\usetheme{Goettingen}

\usepackage[skins,theorems]{tcolorbox}

\usepackage{makecell}

\newenvironment{specialframe}
{
    \begingroup
    \advance\textwidth2cm % see beamerthemeGoettingen.sty for the number
    \hsize\textwidth
    \columnwidth\textwidth
    \begin{frame}[plain]
}
{
    \end{frame}
    \endgroup
}

\begin{document}


\begin{specialframe}
\newtcbox{\ahmadi}{enhanced, left=0mm,right=0mm,top=0mm,bottom=0mm,boxsep=0mm,ignore nobreak,boxrule=0pt,arc=1pt,
colback=gray!20, colframe=gray!20}

\begin{tcolorbox}[enhanced,title=Name Table]
\resizebox{\textwidth}{!}{%
\ahmadi{%
\begin{tabular}{ l | c | r | c | c }
  \footnotesize $\bar{X}_T-\bar{X}_V$ & \makecell{\footnotesize Std Text \\$s_{\bar{X}_T-\bar{X}_V}$}& \makecell{\footnotesize Std Text DE \\$SE_{\bar{X}_T-\bar{X}_V}$}& \makecell{\footnotesize T Wert \\\footnotesize $1-\alpha=2,5\%$\\\footnotesize $df=398$}&\makecell{\footnotesize Text te \\Text\\ \footnotesize KI Test Test Test } \\
  \hline    
   -0.33 & 5 & 6& 6 & 6 \\
  7 & 8 & 9 & 6 & 6\\
  \hline  
\end{tabular}}}
\end{tcolorbox}

\end{specialframe}
%------------------------------------------------------
\begin{specialframe}
\newtcbox{\ahmadi}{colback=gray!20, colframe=gray!20}
\ahmadi{%
\begin{tabular}{ l | c | r | c | c }
  \footnotesize $\bar{X}_T-\bar{X}_V$ & \makecell{\footnotesize Std Text \\$s_{\bar{X}_T-\bar{X}_V}$}& \makecell{\footnotesize Std Text DE \\$SE_{\bar{X}_T-\bar{X}_V}$}& \makecell{\footnotesize T Wert \\\footnotesize $1-\alpha=2,5\%$\\\footnotesize $df=398$}&\makecell{\footnotesize Text te \\Text\\ \footnotesize KI Test Test Test } \\
  \hline    
   -0.33 & 5 & 6& 6 & 6 \\
  7 & 8 & 9 & 6 & 6\\
  \hline  
\end{tabular}}
%++++++++++++++++++++++++++
\newtcbox{\ahmadii}{left=0mm,right=0mm,top=0mm,bottom=0mm,boxsep=0mm,ignore nobreak,boxrule=0pt,colback=gray!20, colframe=gray!20}
\ahmadii{%
\begin{tabular}{ l | c | r | c | c }
  \footnotesize $\bar{X}_T-\bar{X}_V$ & \makecell{\footnotesize Std Text \\$s_{\bar{X}_T-\bar{X}_V}$}& \makecell{\footnotesize Std Text DE \\$SE_{\bar{X}_T-\bar{X}_V}$}& \makecell{\footnotesize T Wert \\\footnotesize $1-\alpha=2,5\%$\\\footnotesize $df=398$}&\makecell{\footnotesize Text te \\Text\\ \footnotesize KI Test Test Test } \\
  \hline    
   -0.33 & 5 & 6& 6 & 6 \\
  7 & 8 & 9 & 6 & 6\\
  \hline  
\end{tabular}}
\end{specialframe}

\end{document}

输出: 在此处输入图片描述在此处输入图片描述

编辑:您的代码。

\documentclass{beamer}
\usetheme{Goettingen}

\usepackage{appendixnumberbeamer}

\usepackage[skins,theorems]{tcolorbox}

\usepackage{german}
\usepackage{makecell}

\renewcommand\theadalign{bc}
\renewcommand\theadfont{\bfseries}
\renewcommand\theadgape{\Gape[4pt]}
\renewcommand\cellgape{\Gape[4pt]}

\setbeamertemplate{itemize/enumerate body begin}{\Large}
\setbeamertemplate{itemize/enumerate subbody begin}{\large}
\hypersetup{pdfpagemode=FullScreen}

\setbeamerfont{page number in head/foot}{size=\large}
\setbeamertemplate{footline}[frame number]



\newenvironment{specialframe}
{
    \begingroup
    \advance\textwidth2cm % see beamerthemeGoettingen.sty for the number
    \hsize\textwidth
    \columnwidth\textwidth
    \begin{frame}[plain]
}
{
    \end{frame}
    \endgroup
}

\begin{document}

\setbeamertemplate{navigation symbols}{}

\title[My study]{Test text\\ Text Text Text TextvTextTextTextTextText Text Text}
\author[J. Doe]{\textbf{My name\\ \vspace{0.2cm}Test test \\Test test TEst Test Test TeTs}}
%\titlegraphic{\includegraphics[width=4cm]{myLogo}}
\date{Place, 11 March 2020}

{
\setbeamercolor{page number in head/foot}{fg=structure.fg!10}
\begin{frame}[noframenumbering]
\titlepage
\end{frame}
}

\section{Introduction}
\frame[label=Einf]{
\frametitle{Test \hyperlink{details}{\beamergotobutton{Test}}}
\vspace{0.05cm}
\begin{itemize}
\item Test
\begin{itemize}
\item Test
\end{itemize}
\end{itemize}
}

\section{Test2}
\frame{
\frametitle{Test}
Test
}

\begin{specialframe}

\newtcbox{\ahmadi}{colback=gray!20, colframe=gray!20}
\ahmadi{%
\begin{tabular}{l|c|r|c|c}
  \footnotesize $\bar{X}_T-\bar{X}_V$ & \makecell{\footnotesize Std Text \\$s_{\bar{X}_T-\bar{X}_V}$}& \makecell{\footnotesize Std Text DE \\$SE_{\bar{X}_T-\bar{X}_V}$}& \makecell{\footnotesize T Wert \\\footnotesize $1-\alpha=2,5\%$\\\footnotesize $df=398$}&\makecell{\footnotesize Text te \\Text\\ \footnotesize KI Test Test Test } \\
  \hline    
   -0.33 & 5 & 6& 6 & 6 \\
  7 & 8 & 9 & 6 & 6\\
  \hline  
\end{tabular}}

\end{specialframe}

\appendix
\setbeamercolor{page number in head/foot}{fg=structure.fg!10}
\section{End}
\frame[label=End]{
\frametitle{Test \hyperlink{details}{\beamergotobutton{Test}}}
\vspace{0.05cm}
\begin{itemize}
\item Test
\begin{itemize}
\item Test
\end{itemize}
\end{itemize}
}

\section[Sources]{references}
\begin{frame}\frametitle{Test \& Test}

\begin{thebibliography}{9}
\bibitem[Beamerpaket]{paket} \emph{Beamer Paket} \\
\text{http://latex-beamer.sourceforge.net/}

\end{thebibliography}

\end{frame}

\end{document}

输出:

在此处输入图片描述

相关内容