如何删除幻灯片编号并修改 Share Latex beamer 底部的内容?

如何删除幻灯片编号并修改 Share Latex beamer 底部的内容?

我在 Share Latex 的序言中有以下内容。

\documentclass{beamer}
\usetheme{CambridgeUS}
\usepackage{graphicx}
\usepackage{mathabx}
\usepackage{enumitem}
\setitemize{itemsep=10pt,% Change the item separation here
label=\usebeamerfont*{itemize item}% These lines are necessary to restore the bullets to each item
\usebeamercolor[fg]{itemize item}%
\usebeamertemplate{itemize item}%
}
\setbeamertemplate{caption}[numbered]{}% Number float-like environments
%% Shortcuts
\newcommand{\td}[2]{\dfrac{d #1}{d #2}}
\newcommand{\std}[2]{\dfrac{d^2 #1}{d {#2}^2}}
\newcommand{\ctd}[3]{\dfrac{d^2 #1}{d #2 d #3}}

\newcommand{\pd}[2]{\dfrac{\partial #1}{\partial #2}}
\newcommand{\spd}[2]{\dfrac{\partial^2 #1}{\partial {#2}^2}}
\newcommand{\cpd}[3]{\dfrac{\partial^2 #1}{\partial #2 \partial #3}}

\newcommand{\pdi}[2]{\partial #1/\partial #2}

\newcommand{\LR}{\Leftrightarrow}
\newcommand{\Lg}{\mathcal{L}}
\newcommand{\half}{\tfrac{1}{2}}
\newcommand{\eqp}{\phantom{=}}
\newcommand{\eqs}{\buildrel s \over =}
\newcommand{\me}{\mathrm{e}}


\title{Comments on Angrist and Evans: Children and Their Parents' Labor Supply (1998)}
\author{Name}
\institute{University}
\date{Oct 16, 2015}

在此处输入图片描述

我想知道如何删除幻灯片编号,并将底部的“对安格里斯特和埃文斯的评论:儿童”缩短为“对安格里斯特和埃文斯的评论”。我正在使用 Share Latex,任何帮助都将不胜感激。谢谢

答案1

要删除幻灯片编号,您必须重新定义footlineCambridgeUS主题使用infolines外部主题。因此,找到文件beamerouterthemeinfolines.sty并找到footline并修改。修改后的文件如下所示,其中有一行被注释掉

\makeatletter
\setbeamertemplate{footline}{%
  \leavevmode%
  \hbox{%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
    \usebeamerfont{author in head/foot}\insertshortauthor\expandafter\beamer@ifempty\expandafter{\beamer@shortinstitute}{}{~~(\insertshortinstitute)}
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
    \usebeamerfont{title in head/foot}\insertshorttitle
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,right]{date in head/foot}%
    \usebeamerfont{date in head/foot}\insertshortdate{}\hspace*{2em}
    %\insertframenumber{} / \inserttotalframenumber\hspace*{2ex}   %% comment this
  \end{beamercolorbox}}%
  \vskip0pt%
}
\makeatother

对于第二个,使用可选title参数

\title[Comments on Angrist and Evans]{Comments on Angrist and Evans: Children and Their Parents' Labor Supply (1998)}

以下是完整的代码。

\documentclass{beamer}
\usetheme{CambridgeUS}
\usepackage{graphicx}
\usepackage{mathabx}
\usepackage{enumitem}
\setitemize{itemsep=10pt,% Change the item separation here
label=\usebeamerfont*{itemize item}% These lines are necessary to restore the bullets to each item
\usebeamercolor[fg]{itemize item}%
\usebeamertemplate{itemize item}%
}
\setbeamertemplate{caption}[numbered]{}% Number float-like environments
%% Shortcuts
\newcommand{\td}[2]{\dfrac{d #1}{d #2}}
\newcommand{\std}[2]{\dfrac{d^2 #1}{d {#2}^2}}
\newcommand{\ctd}[3]{\dfrac{d^2 #1}{d #2 d #3}}

\newcommand{\pd}[2]{\dfrac{\partial #1}{\partial #2}}
\newcommand{\spd}[2]{\dfrac{\partial^2 #1}{\partial {#2}^2}}
\newcommand{\cpd}[3]{\dfrac{\partial^2 #1}{\partial #2 \partial #3}}

\newcommand{\pdi}[2]{\partial #1/\partial #2}

\newcommand{\LR}{\Leftrightarrow}
\newcommand{\Lg}{\mathcal{L}}
\newcommand{\half}{\tfrac{1}{2}}
\newcommand{\eqp}{\phantom{=}}
\newcommand{\eqs}{\buildrel s \over =}
\newcommand{\me}{\mathrm{e}}

\makeatletter
\setbeamertemplate{footline}{%
  \leavevmode%
  \hbox{%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
    \usebeamerfont{author in head/foot}\insertshortauthor\expandafter\beamer@ifempty\expandafter{\beamer@shortinstitute}{}{~~(\insertshortinstitute)}
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
    \usebeamerfont{title in head/foot}\insertshorttitle
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,right]{date in head/foot}%
    \usebeamerfont{date in head/foot}\insertshortdate{}\hspace*{2em}
    %\insertframenumber{} / \inserttotalframenumber\hspace*{2ex}
  \end{beamercolorbox}}%
  \vskip0pt%
}
\makeatother



\title[Comments on Angrist and Evans]{Comments on Angrist and Evans: Children and Their Parents' Labor Supply (1998)}
\author{Name}
\institute{University}
\date{Oct 16, 2015}
\begin{document}
  \begin{frame}
    \maketitle
  \end{frame}
\end{document}

在此处输入图片描述

相关内容