![LaTex Beamer:两行框架标题移动徽标](https://linux22.com/image/381211/LaTex%20Beamer%EF%BC%9A%E4%B8%A4%E8%A1%8C%E6%A1%86%E6%9E%B6%E6%A0%87%E9%A2%98%E7%A7%BB%E5%8A%A8%E5%BE%BD%E6%A0%87.png)
我刚开始用 LaTex beamer 做演示,所以对所有概念都不是很熟悉。现在我遇到的问题是,当框架标题太长时,徽标会改变其位置,以至于必须将其分成两行。我使用以下方式插入徽标:
\addtobeamertemplate{frametitle}{}{%
\begin{textblock*}{100mm}(.81\textwidth,7.2cm)
\includegraphics[width=2cm]{logo.png}
\end{textblock*}}
我希望它保持原样,不受 framtitle 长度的影响。有人能解释一下这个问题吗?谢谢!这是一个没有 titlepage 等的最小示例。
\documentclass[10pt]{beamer}
\usepackage[utf8x]{inputenc}
\usepackage{textpos}
\usepackage{graphicx, caption, subcaption, tabularx, tikz, textpos}
\usepackage{appendixnumberbeamer}
\usetheme{Hannover}
\usecolortheme{rose}
\useoutertheme{infolines}
\useinnertheme{circles}
\logo{\includegraphics[width = 3.5cm]{logo.png}}
\begin{document}
\setbeamertemplate{footline}
{
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=\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%
}
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{headline}{}
\addtobeamertemplate{frametitle}{}{%
\begin{textblock*}{100mm}(.81\textwidth,7.2cm)
\includegraphics[width=2cm]{logo.png}
\end{textblock*}}
\begin{frame}
\frametitle{LIBS and Raman spectroscopy}
\end{frame}
\begin{frame}
\frametitle{LIBS and Raman spectroscopy for Solar System exploration}
\end{frame}
\end{document}
答案1
快速破解:不要滥用来frametitle
添加您的徽标,而是滥用navigation symbols
另外,请不要多次加载包,并且您不需要使用graphicx
beamer。
\documentclass[10pt]{beamer}
\usepackage[utf8x]{inputenc}
%\usepackage{textpos}
%\usepackage{graphicx}
\usepackage{caption, subcaption, tabularx, tikz, textpos}
\usepackage{appendixnumberbeamer}
\usetheme{Hannover}
\usecolortheme{rose}
\useoutertheme{infolines}
\useinnertheme{circles}
\logo{\includegraphics[width = 3.5cm]{logo.png}}
\setbeamertemplate{footline}{
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=\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%
}
\setbeamertemplate{navigation symbols}{\includegraphics[width=2cm]{example-image}}
\setbeamertemplate{headline}{}
\begin{document}
\begin{frame}
\frametitle{LIBS and Raman spectroscopy}
\end{frame}
\begin{frame}
\frametitle{LIBS and Raman spectroscopy for Solar System exploration}
\end{frame}
\end{document}