我正在尝试在 beamer 演示文稿的 fancyhdf 页脚中添加部分名称,但以下命令不起作用。我找到了一些建议该命令的帮助,\renewcommand{\subsubsectionmark}[1]{\markright{\thesubsubsection\ #1}}
但这在我的情况下不起作用。我复制/粘贴了所有有效代码:
%%%%%%%%%%%%%%%%%%%%%%
% Class and packages %
%%%%%%%%%%%%%%%%%%%%%%
\documentclass[12pt]{beamer}
\usetheme{default}
\usepackage{calc}
\usepackage{lipsum}
\usepackage{everypage}
\usepackage{layout}
\usepackage{empheq}
\usepackage{listings}
\usepackage{graphicx}
\usepackage{ccaption}
\usepackage{subfigure}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{psfrag}
\usepackage{hyperref}
\usepackage{bm}
\usepackage{pdfpages}
\usepackage[british]{babel}
\usepackage[applemac]{inputenc}
\usepackage{fancyhdr}
\usepackage{hyperref}
\usepackage{setspace}
\usepackage{color}
\hypersetup{
bookmarks=true, % show bookmarks bar?
unicode=false, % non-Latin characters in Acrobat’s bookmarks
pdftoolbar=true, % show Acrobat’s toolbar?
pdfmenubar=true, % show Acrobat’s menu?
pdffitwindow=false, % window fit to page when opened
pdfstartview={FitH}, % fits the width of the page to the window
pdftitle={My title}, % title
pdfauthor={Author}, % author
pdfsubject={Subject}, % subject of the document
pdfcreator={Creator}, % creator of the document
pdfproducer={Producer}, % producer of the document
pdfkeywords={keyword1} {key2} {key3}, % list of keywords
pdfnewwindow=true, % links in new window
colorlinks=false, % false: boxed links; true: colored links
linkcolor=red, % color of internal links
citecolor=green, % color of links to bibliography
filecolor=magenta, % color of file links
urlcolor=cyan % color of external links
}
\usepackage{array}
\newcolumntype{L}[1]{>{\raggedright}m{#1}}
\newcolumntype{C}[1]{>{\centering}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft}m{#1}}
%%%%%%%%%%%%
% Template %
%%%%%%%%%%%%
% Page dimension
\paperwidth=16cm
\paperheight=12cm
\textwidth=14cm
\oddsidemargin=-1.5cm
\topmargin=0cm
\headsep=5pt
\marginparsep=0.3cm
\marginparwidth=1cm
\voffset=-2cm
\hoffset=0cm
\setbeamertemplate{frametitle}{\insertframetitle}
% Header
\def\title#1{\gdef\@title{#1}\gdef\stored@title{#1}}
\setbeamertemplate{navigation symbols}{}
\pagestyle{fancy}
\fancyhf{}
\lhead{{\footnotesize\textbf{school}}\hspace{10pt}{\scriptsize departement - \@title}}
\rhead{\scriptsize\thepage}
\renewcommand{\headrulewidth}{0pt}
% Footer
\lfoot{\scriptsize\today}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
\rfoot{\fancyplain{}{\rightmark }}
% Title frame
\fancypagestyle{fancyonlheadings}{
\renewcommand{\headrulewidth}{0pt}
\lhead{\scriptsize full school name and so on\\
\textbf{Institute name}}
\lfoot{\scriptsize\today}
\rhead{}
}
%%%%%%%%%%%
% Aliases %
%%%%%%%%%%%
\def \be {\begin{equation}}
\def \ee {\end{equation}}
\def \d {\mathrm{d}}
\def \D {\mathrm{D}}
\newcommand{\unit}[1]{ \, \small\mathrm{#1}}
%%%%%%%%%%%%%%%%%
% Last settings %
%%%%%%%%%%%%%%%%%
\begin{document}
% In beamer, these changes have no effect in preamble
\textheight=10cm
\headheight=0.5cm
\footskip=5pt
%%%%%%%%%
% Title %
%%%%%%%%%
% Title template
\defbeamertemplate*{title page}{customized}[1][]{
\thispagestyle{fancyonlheadings}
\large{\textbf{SCHOOLNAME}}\\\vspace{10pt}
{\usebeamercolor[fg]{title}\Huge\@title}\\\vspace{2cm}
{\Large\insertsubtitle}\\\vfill\vspace{2cm}
{\Large\insertauthor}\par
{\Large\insertinstitute}\\\vspace{0.5cm}
{\small\today}
}
% Title data
\title{Titleeeee}
\subtitle{subtitleeee}
\author{me}
\date{\today}
\institute{schoool}
\maketitle
%%%%%%%%%%%%%%%%
% Presentation %
%%%%%%%%%%%%%%%%
\section{Introduction}
\begin{frame}{title of the slide}
\lipsum[3]
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Conclusion}
\begin{frame}{title of the slide}
\lipsum[3]
\end{frame}
\begin{frame}
\begin{Large}
\begin{center}
Thanks for your attention!\\ \vspace{10pt}
%\includegraphics[width=0.6\textwidth]{fig/steel1.jpg} \\ \vspace{5pt}
Any question?
\end{center}
\end{Large}
\end{frame}
\end{document}
我的问题出在 %footer 部分。有人能帮我吗?
提前感谢 philus
答案1
如果没有重要原因需要使用fancyhdr
with beamer
,我建议使用 和 来声明页眉footline
和headline
beamertemplates
页脚beamer's
。
以下代码显示了一个起点。
%%%%%%%%%%%%%%%%%%%%%%
% Class and packages %
%%%%%%%%%%%%%%%%%%%%%%
\documentclass[12pt]{beamer}
\usetheme{default}
\usepackage{lipsum}
\usepackage[british]{babel}
\usepackage[applemac]{inputenc}
\hypersetup{
bookmarks=true, % show bookmarks bar?
unicode=false, % non-Latin characters in Acrobat’s bookmarks
pdftoolbar=true, % show Acrobat’s toolbar?
pdfmenubar=true, % show Acrobat’s menu?
pdffitwindow=false, % window fit to page when opened
pdfstartview={FitH}, % fits the width of the page to the window
pdftitle={My title}, % title
pdfauthor={Author}, % author
pdfsubject={Subject}, % subject of the document
pdfcreator={Creator}, % creator of the document
pdfproducer={Producer}, % producer of the document
pdfkeywords={keyword1} {key2} {key3}, % list of keywords
pdfnewwindow=true, % links in new window
colorlinks=false, % false: boxed links; true: colored links
linkcolor=red, % color of internal links
citecolor=green, % color of links to bibliography
filecolor=magenta, % color of file links
urlcolor=cyan % color of external links
}
%%%%%%%%%%%%
% Template %
%%%%%%%%%%%%
% Page dimension
\paperwidth=16cm
\paperheight=12cm
\textwidth=14cm
\oddsidemargin=-1.5cm
\topmargin=0cm
\headsep=5pt
\marginparsep=0.3cm
\marginparwidth=1cm
\voffset=-2cm
\hoffset=0cm
\setbeamertemplate{frametitle}{\insertframetitle}
% Header
\def\title#1{\gdef\@title{#1}\gdef\stored@title{#1}}
\setbeamertemplate{navigation symbols}{}
\setbeamerfont{section in head/foot}{size=\scriptsize}
\setbeamertemplate{headline}
{
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.65ex,dp=1.5ex,left]{section in head/foot}%
\usebeamerfont{section in head/foot}\hspace*{1cm}{\footnotesize\textbf{school}}\hspace{10pt}{ departement - \@title}
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.65ex,dp=1.5ex,right]{section in head/foot}%
\usebeamerfont{section in head/foot}\thepage\hspace*{1cm}
\end{beamercolorbox}}%
\vskip0pt%
}
\setbeamertemplate{footline}{
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.25ex,dp=1ex,left]{section in head/foot}%
\usebeamerfont{section in head/foot}\hspace*{1cm}\today
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.25ex,dp=1ex,right]{section in head/foot}%
\usebeamerfont{section in head/foot} \insertsection\hspace*{1cm}
\end{beamercolorbox}}%
\vskip0pt%
}
%%%%%%%%%%%
% Aliases %
%%%%%%%%%%%
\def \be {\begin{equation}}
\def \ee {\end{equation}}
\def \d {\mathrm{d}}
\def \D {\mathrm{D}}
\newcommand{\unit}[1]{ \, \small\mathrm{#1}}
%%%%%%%%%%%%%%%%%
% Last settings %
%%%%%%%%%%%%%%%%%
\begin{document}
% In beamer, these changes have no effect in preamble
\textheight=10cm
\headheight=0.5cm
\footskip=5pt
%%%%%%%%%
% Title %
%%%%%%%%%
% Title template
\defbeamertemplate*{title page}{customized}[1][]{
%\thispagestyle{fancyonlheadings}
\large{\textbf{SCHOOLNAME}}\\\vspace{10pt}
{\usebeamercolor[fg]{title}\Huge\@title}\\\vspace{2cm}
{\Large\insertsubtitle}\\\vfill\vspace{2cm}
{\Large\insertauthor}\par
{\Large\insertinstitute}\\\vspace{0.5cm}
{\small\today}
}
% Title data
\title{Titleeeee}
\subtitle{subtitleeee}
\author{me}
\date{\today}
\institute{schoool}
\begin{frame}
\maketitle
\end{frame}
%%%%%%%%%%%%%%%%
% Presentation %
%%%%%%%%%%%%%%%%
\section{Introduction}
\begin{frame}{title of the slide}
\lipsum[3]
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Conclusion}
\begin{frame}{title of the slide}
\lipsum[3]
\end{frame}
\begin{frame}
\begin{Large}
\begin{center}
Thanks for your attention!\\ \vspace{10pt}
%\includegraphics[width=0.6\textwidth]{fig/steel1.jpg} \\ \vspace{5pt}
Any question?
\end{center}
\end{Large}
\end{frame}
\end{document}