在 Beamer 中自定义 footline{}

在 Beamer 中自定义 footline{}

下面的代码打印出这但我希望看到footline 最后的唯一,即使我删除了也head不起作用。提前谢谢大家。

 \documentclass[10pt,english,8pt]{beamer}
\usetheme{CambridgeUS}
\usetheme{default}
\usecolortheme{crane}


\makeatletter
\setbeamertemplate{footline}
{
    \leavevmode%
    \hbox{%
        \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
            \usebeamerfont{author in head/foot}\insertsection
        \end{beamercolorbox}%
        \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
            \usebeamerfont{title in head/foot}\insertsubsection
        \end{beamercolorbox}}
    \vskip0pt%
}
\makeatother

\title{The Title}
\author{The Author}

\begin{document}
    
    \section{Test Section One}
    \subsection{Test Subsection One One}
    
    \begin{frame}
        test
    \end{frame}
    \subsection{Test Subsection One Two}
    \begin{frame}
        test
    \end{frame}
    
\end{document}

答案1

要完全删除标题,请使用

\setbeamertemplate{headline}{}A

\documentclass[10pt,english,8pt]{beamer}
\usetheme{CambridgeUS}
\usetheme{default}
\usecolortheme{crane}

\setbeamertemplate{headline}{} % added <<<<<<<<<<<<<<<<<<<<<
%% OR 
%\setbeamercolor{section in head/foot}{use=palette tertiary, fg=palette tertiary.bg}
%\setbeamercolor{subsection in head/foot}{use=palette secondary, fg=palette secondary.bg}   

\makeatletter
\setbeamertemplate{footline}
{
    \leavevmode%
    \hbox{%
        \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
            \usebeamerfont{author in head/foot}\insertsection
        \end{beamercolorbox}%
        \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
            \usebeamerfont{title in head/foot}\insertsubsection
    \end{beamercolorbox}}
    \vskip0pt%
}
\makeatother

\title{The Title}
\author{The Author}

\begin{document}
    
    \section{Test Section One}
    \subsection{Test Subsection One One}
    
    \begin{frame}
        test
    \end{frame}
    \subsection{Test Subsection One Two}
    \begin{frame}
        test
    \end{frame}
    
\end{document}

如果要在隐藏文本的同时保留标题的颜色,请使用

\setbeamercolor{section in head/foot}{use=palette tertiary, fg=palette tertiary.bg}
\setbeamercolor{subsection in head/foot}{use=palette secondary, fg=palette secondary.bg} 

b

相关内容