这是代码,我使用了华沙主题,但对于主题“马尔堡”,徽标命令不起作用...如何将左侧的徽标放在侧边栏与图片相同的位置???
\documentclass[12pt]{beamer}
\mode<presentation>{}
%\usepackage{beamerthemesplit}
\usepackage{graphicx}
\usepackage{amsfonts}
\graphicspath{ {/home/user} }
\usetheme{Warsaw} %Marburg %Goettingen
\usecolortheme{sidebartab}
\useinnertheme{rounded}
\logo{%
\makebox[0.96\paperwidth]{%
\includegraphics[width=1cm,keepaspectratio]{wbsu}%
\hfill{}%
\includegraphics[width=1cm,keepaspectratio]{test}\hspace{0.05\textwidth}%
}%
}
\begin{document}
\begin{frame}
\frametitle{This is frame title}
\framesubtitle{sample slide for showing logo command}
This is where something to be written.
\end{frame}
\end{document}
答案1
或者重新定义footline
模板,您可以简单地使用以下命令添加徽标\addtobeamertemplate
:
\documentclass[12pt]{beamer}
\usetheme{Marburg}
\usecolortheme{sidebartab}
\useinnertheme{rounded}
\addtobeamertemplate{footline}{}{%
\makebox[\paperwidth]{%
\hspace{0.04\textwidth}\raisebox{2ex}[0pt][0pt]{\includegraphics[width=1cm,keepaspectratio]{example-image-a}}%
\hfill{}%
\raisebox{2ex}[0pt][0pt]{\includegraphics[width=1cm,keepaspectratio]{example-image-b}}\hspace{0.04\textwidth}%
}%
}
\begin{document}
\begin{frame}
\frametitle{This is the frame title}
\framesubtitle{Sample slide for showing the logo}
Some test text.
\end{frame}
\end{document}
结果:
答案2
像这样:
您需要重新定义主题footline
的模板Marburg
,如下所示:
\documentclass[12pt]{beamer}
\mode<presentation>{}
%\usepackage{beamerthemesplit}
\usepackage{graphicx,lmodern}
\usepackage{amsfonts}
%\graphicspath{ {/home/user} }
\usetheme{Marburg}%{Warsaw}%Goettingen
\usecolortheme{sidebartab}
\useinnertheme{rounded}
\makeatletter
\setbeamertemplate{footline}
{%
\begin{beamercolorbox}[wd=\paperwidth]{frametitle}
\ifx\beamer@sidebarside\beamer@lefttext%
\else%
\hfill%
\fi%
\ifdim\beamer@sidebarwidth>0pt%
\usebeamercolor[bg]{logo}%
\hfill\hbox to \beamer@sidebarwidth{\hss\vbox to
\beamer@headheight{\vss\hbox{\color{fg}\insertlogo}\vss}\hss}%
\else%
\vrule width0pt height \beamer@headheight%
\fi%
\end{beamercolorbox}
}
\logo{%
\raisebox{1.5cm}{\includegraphics[width=1cm,keepaspectratio]{example-image-A}}%
}
\makeatother
\begin{document}
\begin{frame}
\frametitle{This is frame title}
\framesubtitle{sample slide for showing logo command}
This is where something to be written.
\end{frame}
\begin{frame}
\frametitle{This is frame title 2}
\framesubtitle{sample slide for showing logo command}
This is where something to be written.
\end{frame}
\end{document}