我正在编写一个 .sty 文件,供几个常见的演示文稿使用:
我的麦粒肿档案
\usepackage{ragged2e}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{color}
\usepackage{tikz}
\usepackage{tikzpagenodes}
\usepackage{multicol}
\tikzstyle{block}=[draw opacity=0.7,line width=1.4cm]
%add logo to every page
\addtobeamertemplate{frametitle}{}{
\begin{tikzpicture}[overlay,remember picture,inner sep=0pt, outer sep=0pt]
\node[anchor=south,yshift=5pt] at (current page text area.south) {\includegraphics[height=0.8cm,width=\linewidth]{images/logo};
\end{tikzpicture}}
%add logo to titlepage
\institute{
\begin{tikzpicture}[overlay,remember picture,inner sep=0pt, outer sep=0pt]
\node[anchor=south,yshift=5pt] at (current page text area.south) {\includegraphics[height=0.8cm,width=\linewidth]{images/logo}};
\end{tikzpicture}}
问题是 addtobeamertemplate 函数不起作用,也就是说,我的徽标没有被添加到每个页面。
主文件:
\documentclass[12pt]{beamer}
\usepackage{Template}
\usetheme{Frankfurt}
\title{Your Title}
\author{You}
\date{date}
\begin{document}
\begin{frame}
\maketitle
\end{frame}
\section{Example}
\begin{frame}{Example}
slide example
\end{frame}
\end{document}
谁能帮我?
谢谢
答案1
两个问题:
您的通话
}
中缺少a\addtobeamertemplate
Frankfurt
主题定义了它自己的 frametitle 模板,因此您必须先调用主题,然后执行您的操作\addtobeamertemplate
,否则您之前的更改将被覆盖。
两个非问题:
你不需要
\usepackage{graphicx}
,\usepackage{color}
因为 beamer 已经提供了此功能在我看来,
\usepackage{multicol}
与 beamer 一起使用没有任何意义,因为 beamer 提供了它自己的columns
环境。
\documentclass[12pt]{beamer}
\usetheme{Frankfurt}
\usepackage{ragged2e}
\usepackage[utf8]{inputenc}
%\usepackage{amsmath}
%\usepackage{amsfonts}
%\usepackage{amssymb}
%\usepackage{graphicx}
%\usepackage{color}
\usepackage{tikz}
\usepackage{tikzpagenodes}
%\usepackage{multicol}
\tikzset{block/.style={draw opacity=0.7,line width=1.4cm}}
%add logo to every page
\addtobeamertemplate{frametitle}{}{
\begin{tikzpicture}[overlay,remember picture,inner sep=0pt, outer sep=0pt]
\node[anchor=south,yshift=5pt] at (current page text area.south) {\includegraphics[height=0.8cm,width=\linewidth]{example-image}};
\end{tikzpicture}}
%add logo to titlepage
\institute{
\begin{tikzpicture}[overlay,remember picture,inner sep=0pt, outer sep=0pt]
\node[anchor=south,yshift=5pt] at (current page text area.south) {\includegraphics[height=0.8cm,width=\linewidth]{example-image}};
\end{tikzpicture}}
%\usetheme{Frankfurt}
\title{Your Title}
\author{You}
\date{date}
\begin{document}
\begin{frame}
\maketitle
\end{frame}
\section{Example}
\begin{frame}{Example}
slide example
\end{frame}
\end{document}