![投影机类中帧标题的间距](https://linux22.com/image/371904/%E6%8A%95%E5%BD%B1%E6%9C%BA%E7%B1%BB%E4%B8%AD%E5%B8%A7%E6%A0%87%E9%A2%98%E7%9A%84%E9%97%B4%E8%B7%9D.png)
请参考附图。我正在使用 IIT Roorkee 的 beamer 类和 latex 模板制作演示文稿。框架标题“本学期完成的工作”超出水平蓝线太多。我想将其居中,使标题上方和标题下方的空白几乎相同。我该怎么做?
latex代码如下:
\documentclass[compress]{beamer}
\usetheme{IITR} % To use the theme of IITR for beamer class in Latex
\usepackage{ragged2e}
\apptocmd{\frame}{}{\justifying}{}
\usepackage{textpos}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{helvet}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{tikz, graphicx}
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{headline}{}
\setbeamercovered{transparent}
\usebackgroundtemplate{\includegraphics [width=\paperwidth,height=\paperheight]{slide_bg.png}}
\usepackage{url}
%%%%%%%%%%%%% Title Slide %%%%%%%%%%%%%%%%%
\title{ABC}
%\subtitle{Subtitle of the Talk}
\vspace{200mm}
\author[My name]{{\small \textbf{Presented by}\\ \vspace{0.75mm}
\small \color{IITRBlue}\textbf{xyz}\\ \vspace{0.75mm} {\small \color{black}\textbf{Enrollment no -} \color{IITRBlue} \textbf{123}} \\ \vspace{0.75mm} \small \color{black}\textbf{Project guide -} \color{IITRBlue} \textbf{YBT}}} % auteur
\date{\textbf{{\today}} \vspace{3em}}
%\institute{\url{[email protected]}\\
%\href{http://faculty.iitr.ac.in/\textasciitilde abc/}{http://faculty.iitr.ac.in/\textasciitilde abc/}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
%%%%%%%%%%%%% Title Slide %%%%%%%%%%%%%%%%%
{\usebackgroundtemplate{\includegraphics[width=\paperwidth,height=\paperheight]{titleslide_bg.png}}
\begin{frame}[plain,t]%{INDIAN INSTITUTE OF TECHNOLOGY ROORKEE}
\titlepage
\begin{textblock*}{200mm}(.94\textwidth,-8.75cm)
\includegraphics[height=.98cm]{logo_white.png}
\end{textblock*}
\end{frame}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%% TOC Slide %%%%%%%%%%%%%%%%%
\begin{frame}[t]{Table of Contents}
\tableofcontents
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%% Slide Layout %%%%%%%%%%%%%%%%%
\section{section1}
\begin{frame}{Table of Contents}
\tableofcontents[currentsection, hidesubsections]
\end{frame}
\begin{frame}[t]{\LARGE Work done in this semester}
\begin{itemize}
\item Big Bang Big Crunch optimization algorithm
\justifying
\item MOR of LTI – SISO systems via BBBC algorithm and Pade approximation
\justifying
\end{itemize}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%% Slide Layout %%%%%%%%%%%%%%%%%
\section{section2}
\begin{frame}[t]{Slide 2 section2 (text in bullet form)}
\begin{itemize}
\item example1
\item example2
\item example3
\end{itemize}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%% Slide Layout %%%%%%%%%%%%%%%%%
\subsection{subsection 2.1}
\begin{frame}[t]{Slide 2 subsection2.1 (text in block form)}
\begin{block}{Theorem1}
Write theorem 1 text here.
\end{block}
\begin{block}{Theorem2}
Write theorem 2 text here.
Example 1
Example 2
Example 3
Example 4
\end{block}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%% Slide Layout %%%%%%%%%%%%%%%%%
{\usebackgroundtemplate{\includegraphics[width=\paperwidth,height=\paperheight]{white_bg.png}}
\begin{frame}[plain,c]
\begin{center}
\definecolor{IITRBlue}{RGB}{26,33,141}
{\color{IITRBlue}\LARGE \underline{Thanks.}}
\end{center}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
.sty 文件如下,也可以从以下网址下载https://www.iitr.ac.in/Main/pages/_en_IITR_Presentation__en_.html:
\ProvidesPackage{beamerthemeIITR}[2015/07/20]
\usefonttheme[onlylarge]{structurebold}
%%%%%%%%%%%%%%%%%%%%%%%
% Colours
%%%%%%%%%%%%%%%%%%%%%%%
\definecolor{IITRBlue}{RGB}{26,33,141}
\definecolor{IITRRed}{RGB}{213,24,0}
\definecolor{SubduedBlue}{RGB}{107,142,168}
\usecolortheme[named=IITRBlue]{structure}
\usecolortheme{rose}
\setbeamercolor{item}{fg=SubduedBlue}
\setbeamercolor{title}{fg=IITRBlue}
\setbeamercolor{block title}{fg=IITRBlue,bg=IITRBlue!15!white}
\setbeamercolor{block body}{fg=black}
\setbeamercolor{section in head/foot}{fg=IITRRed}
\setbeamercolor{separator}{fg=IITRRed}
\setbeamercolor{page number in head/foot}{fg=white}
\setbeamercolor{footline}{bg=IITRBlue!30!white,fg=black}
\setbeamercolor{mini frame}{fg=SubduedBlue}
\setbeamertemplate{mini frame in other subsection}[default][40]
\setbeamersize{text margin left=1em,text margin right=1em}
%%%%%%%%%%%%%%%%%%%%%%%%
% Inner theme
%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage{pifont}
\useinnertheme{rounded}
\setbeamertemplate{itemize items}{\ding{113}}
\setbeamertemplate{enumerate items}[default]
\addtobeamertemplate{block begin}{\pgfsetfillopacity{0.5}}{\pgfsetfillopacity{1}}
\addtobeamertemplate{block alerted begin}{\pgfsetfillopacity{0.5}}{\pgfsetfillopacity{1}}
\addtobeamertemplate{block example begin}{\pgfsetfillopacity{0.5}}{\pgfsetfillopacity{1}}
%%%%%%%%%%%%%%%%%%%%%%%%
% Outer theme
%%%%%%%%%%%%%%%%%%%%%%%%
\setbeamertemplate{background canvas}{}
\setbeamerfont{footline}{series=\bfseries}
\useoutertheme{tree}
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{frametitle}{\bfseries\insertframetitle\par\vskip14pt
\begin{textblock*}{200mm}(.93\textwidth,-1.15cm)
\includegraphics[height=1.2cm]{logo_color.jpg}
\end{textblock*}}
\setbeamertemplate{headline}{%
\vskip1pt\hskip2pt%
\hspace*{23pt}\insertnavigation{.65\paperwidth}}
\setbeamertemplate{footline}[frame number]
\addtobeamertemplate{title page}{\vskip20pt}{\vfil\centering%
\pgfpathrectangle{\pgfpoint{0pt}{0pt}}{\pgfpoint{\textwidth}{-2pt}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
答案1
问题是,您的主题通常有一个标题,但您用 禁用了它\setbeamertemplate{headline}{}
,因此缺少了通常由标题占用的空间。为了弥补剩余的空间,我建议\setbeamertemplate{headline}{\vskip3pt}
改为(您可能需要尝试垂直空间的确切值)
其他几点:
\usepackage{graphicx}
对于 beamer 来说没有必要不要像
\LARGE
宏参数那样手动输入格式化指令,而是更改相应的字体:\setbeamerfont{frametitle}{size=\LARGE,series=\bfseries}
如果插入定义了高度和宽度的图像,请添加
\keepaspectratio
,否则图像将会扭曲。
\documentclass[compress]{beamer}
\usepackage{textpos}
\setbeamertemplate{headline}{\vskip3pt}
\setbeamertemplate{frametitle}{%
\insertframetitle\par\vskip14pt
\begin{textblock*}{200mm}(.93\textwidth,-1.3cm)
\includegraphics[height=1.2cm]{example-image}
\end{textblock*}}
\usebackgroundtemplate{\includegraphics [width=\paperwidth,height=\paperheight,keepaspectratio]{YdRyj}}
\setbeamerfont{frametitle}{size=\LARGE,series=\bfseries}
\begin{document}
\begin{frame}[t]
\frametitle{Work done in this semester}
\end{frame}
\end{document}