删除顶部栏和块中的颜色

删除顶部栏和块中的颜色

我想只删除第一张幻灯片中的顶部水平深蓝色条,并在同一张第一张幻灯片的块中使用带有白色字母的深蓝色。代码如下:

\documentclass[10pt,xcolor={dvipsnames}]{beamer}

\mode<article> % only for the article version
{
  \usepackage{fullpage}
  \usepackage{hyperref}
}

\mode<presentation>
{
  \setbeamertemplate{background canvas}[vertical shading][bottom=red!10,top=blue!10]

  \usetheme{JuanLesPins}
  \setbeamercovered{transparent}
  \usefonttheme{serif}
}

\usepackage{pgf,pgfarrows,pgfnodes,pgfautomata,pgfheaps,pgfshade}
\usepackage[latin1]{inputenc}
\usepackage{colortbl}
\usepackage[english]{babel}

\setbeamercovered{dynamic}

\setbeamertemplate{items}[circle]

\setbeamertemplate{headline}
{%
  \leavevmode%
  \begin{beamercolorbox}[wd=\paperwidth,ht=3.1ex,dp=2ex]{section in head/foot}%
     \hspace*{10.5pt}\usebeamerfont{section in head/foot}\insertsection
  \end{beamercolorbox}%
}

\makeatletter
\newenvironment{noheadline}{
    \setbeamertemplate{headline}{
    {%
    \leavevmode%
    \begin{beamercolorbox}[wd=\paperwidth,ht=3.1ex,dp=2ex]{section in head/foot}%
    \hspace*{10.5pt}\usebeamerfont{section in head/foot}
    \end{beamercolorbox}%
}
    }
    \def\beamer@entrycode{\vspace*{-\headheight}}
}{}
\makeatother

\begin{document}

\begin{noheadline}

\begin{frame}

\begin{block}{}
\begin{minipage}[c][0.16\textheight][c]{\linewidth}
\centering \textbf{My slides}
\end{minipage}
\end{block}

\end{frame}

\end{noheadline}

\section{My slides}

\begin{frame}

My first slide

\end{frame}

\end{document}

欢迎任何帮助。谢谢!

答案1

  • 在您的noheadline环境中,您明确地用深蓝色条替换了正常标题。如果您不想要此条,请不要进行此替换。

  • 要更改块的颜色,您可以使用\setbeamercolor{block body}{bg=section in head/foot.bg,fg=white}


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

\mode<article> % only for the article version
{
  \usepackage{fullpage}
  \usepackage{hyperref}
}

\mode<presentation>
{
  \setbeamertemplate{background canvas}[vertical shading][bottom=red!10,top=blue!10]

  \usetheme{JuanLesPins}
  \setbeamercovered{transparent}
  \usefonttheme{serif}
}

\usepackage[english]{babel}

\setbeamercovered{dynamic}

\setbeamertemplate{items}[circle]

\setbeamertemplate{headline}
{%
  \leavevmode%
  \begin{beamercolorbox}[wd=\paperwidth,ht=3.1ex,dp=2ex]{section in head/foot}%
     \hspace*{10.5pt}\usebeamerfont{section in head/foot}\insertsection
  \end{beamercolorbox}%
}

\makeatletter
\newenvironment{noheadline}{
    \setbeamertemplate{headline}{\vskip\headheight}
}{}
\makeatother


\begin{document}

\begin{noheadline}

\begin{frame}
\setbeamercolor{block body}{bg=section in head/foot.bg,fg=white}
\begin{block}{}
\begin{minipage}[c][0.16\textheight][c]{\linewidth}
\centering \textbf{My slides}
\end{minipage}
\end{block}

\end{frame}

\end{noheadline}

\section{My slides}

\begin{frame}

My first slide

\end{frame}

\end{document}

在此处输入图片描述

相关内容