如何删除帧标题开头的灰线

如何删除帧标题开头的灰线

我需要知道如何去除标题框上方的灰线

\documentclass{beamer}
\usetheme{Warsaw}
\usepackage{graphicx}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{theorems}[numbered]
\newtheorem{thm}{Theorem}
\newtheorem{lem}{Lemma}
\newtheorem{cor}{Corollary}
\newtheorem{prop}{Proposition}
\theoremstyle{definition}
\newtheorem{dfn}{Definition}

\setbeamersize{text margin left=1.5cm,text margin right=1.5cm}
\setbeamercolor*{title}{fg=white, bg=green!45! black}
\setbeamercolor{frametitle}{fg=white, bg=green! 45! black}
\setbeamercolor{author in head/foot}{fg=white}
\setbeamertemplate{footline}
{
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=.3\paperwidth,ht=2.25ex,dp=1ex,center]{author in  head/foot}%
\usebeamerfont{author in head/foot}\insertshortauthor
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.7\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
\usebeamerfont{title in head/foot}\insertshorttitle         \hspace{1.5cm}\insertframenumber/\inserttotalframenumber
\end{beamercolorbox}}%
\vskip0pt%
}
\makeatletter
\setbeamercolor{block title}{use=structure, fg=white, bg=green! 45!black}
\setbeamercolor{block body}{use=structure, fg=black, bg=green! 20! white}
\setbeamercolor*{author in head/foot}{use=structure, fg=white, bg=green!  45!black}
\setbeamercolor{qed symbol}{use=structure, fg=green! 45! black}
\setbeamertemplate{frametitle}[default][center]
\setbeamercolor*{title in head/foot}{use=structure, fg=black, bg=yellow! 100!white}
\usepackage{etoolbox}
\makeatletter
\expandafter\patchcmd\csname beamer@@tmpl@title page\endcsname
{\vfill}
{\vspace*{10mm}}
{}{}
\makeatother
\begin{document}
\title{\textbf{Characterisations and Properties of Nilpotent Groups }}
\author [Rajeev Maharaj] {\textbf{Rajeev Maharaj} \\   [1em]\textbf{Supervisor: Prof. B. Rodrigues} \\[1em]\includegraphics[width=5cm]{logo_ukzn} \\ [1em]\textbf{Math799 Honours Project}\\ [1em] \textbf{December 3, 2015}}
\date{}
\begin{frame}[plain]
\titlepage
\end{frame}
\begin{frame}
\frametitle{\textbf{Characterisation of Nilpotent Groups}}
\end{frame}
\end{document}

答案1

这是最小的例子

\documentclass{beamer}
\usetheme{Warsaw}
\setbeamertemplate{frametitle}[default]
\begin{document}

\frame{{title1}{subtitle1}}

\end{document}

灰色的线来自您的主题Warsaw:它包含外部主题shadow;后者包含以下几行:

\addtobeamertemplate{headline}
{}
{%
  \vskip-0.2pt
  \pgfuseshading{beamer@topshade}
  \vskip-2pt
}

没有简单的方法可以取消单个 的效果\addtobeamertemplate。只能找到正确的控制序列名称并删除其所有内容。

仍有几种方法可以解决这个问题。最简单的方法是停止Warsaw包含外部主题:

\documentclass{beamer}
\def\useoutertheme#1{}
\usetheme{Warsaw}
\setbeamertemplate{frametitle}[default]
\begin{document}

\frame{{title1}{subtitle1}}

\end{document}

第二种方法是\addtobeamertemplate再次使用取消灰线。

\documentclass{beamer}
\usetheme{Warsaw}
\setbeamertemplate{frametitle}[default]
\addtobeamertemplate{headline}
{}
{%
  \vskip-1.8pt
}

\begin{document}

\frame{{title1}{subtitle1}}

\end{document}

如果您确实想取消所有效果\addtobeamertemplate,请提到正确的控制序列名称:

\documentclass{beamer}
\usetheme{Warsaw}
\expandafter\def\csname beamer@@tmpl@headline\endcsname{}
\setbeamertemplate{frametitle}[default]
\begin{document}

\frame{{title1}{subtitle1}}

\end{document}

它们都导致

相关内容