EthanDeng / mhlatex

Mostly Harmless LaTeX Techniques
15 stars 7 forks source link

Darmstadt 主题的页脚如何显示标题和作者信息的那一栏? #26

Open zybian15 opened 4 years ago

zybian15 commented 4 years ago

想请教一个小问题,就是第一个图片是网上的事例,Darmstadt 主题下页脚那里是显示有作者信息和标题信息的,为什么我在实际用的时候(第二个图片)页脚那里就没有这一栏了呢?

WeChat Image_20191219195303

WeChat Image_20191219195347

EthanDeng commented 4 years ago

Beamer 里面有不同的主题组合搭配,见:Beamer Theme Matrix,看了下,发现这个并非 Darmstadt 主题默认的搭配效果。

这样的话就需要魔改,在网上搜索 footline beamer,能找到对应的方案如下:Singapore Beamer Theme - add bottom bar with author info。代码简化如下:

\documentclass{beamer}

\usetheme{{Darmstadt}}
\usecolortheme{default}

\setbeamertemplate{navigation symbols}{}

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

\title[International Trade]{International Trade}
\subtitle{Financial Constraints}
\author[Zeyang Bian]{Zeyang Bian}
\date[\today]{\today}
\institute[Fudan University]{Fudan University}

\begin{document}

\section{Introduction} 
\subsection*{Introduction}
\begin{frame}{Background}
  \begin{itemize}
   \item ABC
   \item ABC
   \item ABC
   \item ABC
  \end{itemize}
\end{frame}

\end{document}

加粗、距离我调过了,颜色你参考 beamercolorbox in the color of a theme 修改,现在这个颜色为主题颜色,跟随主题,效果如下:

QQ截图20191219201008