beamer
我正在用和制作海报,beamer-poster
但我的图块出了问题。标题和正文未对齐。
这是一个简单的例子:
\usepackage{lipsum}
\usepackage[orientation=landscape,size=a0,scale=1.9,debug]{beamerposter}
\title[my pres]{my pres}
\author[my name]{my name}
\institute[My home]{My home}
\date{29/05/2011}
\definecolor{couleurtexte}{RGB}{255,255,255}
\definecolor{couleurconsole}{RGB}{0,0,0}
\begin{document}
\begin{frame}
\vfill
\begin{columns}[T]
\begin{column}{.25\linewidth}
\vbox to .95\textheight{%
\begin{block}{block 1}
\lipsum[1]%
\end{block}
\vfill
\begin{block}{block 2}%
\lipsum[1]%
\end{block}%
\vfill
\begin{block}{block 3}
\begin{itemize}
\item some items
\item some items
\item some items
\item some items
\end{itemize}
\end{block}
}
\end{column}
\end{columns}
\vfill
\end{frame}
\end{document}
以及相关的主题文件:
\ProvidesPackage{beamerthemetm1}
\usepackage[french]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\definecolor{firstcolor}{RGB}{0,68,255}
\definecolor{secondcolor}{RGB}{0,54,204}
\definecolor{thirdcolor}{RGB}{0,41,153}
\definecolor{backgroundcolor}{RGB}{77,124,255}
\setbeamercolor{background canvas}{bg=backgroundcolor}
\setbeamercolor{headline}{fg=black,bg=firstcolor}
\setbeamercolor{footline}{fg=couleurtexte, bg=firstcolor}
\setbeamerfont{footline}{size=\normalsize}
\setbeamercolor{separation line}{bg=black}
\setbeamercolor{title in headline}{fg=couleurtexte}
\setbeamercolor{author in headline}{fg=couleurtexte}
\setbeamercolor{institute in headline}{fg=couleurtexte}
\setbeamercolor{framesubtitle}{fg=couleurtexte, bg=ta2gray}
\setbeamercolor{author in head/foot}{fg=couleurtexte, bg=black}
\setbeamercolor{title in head/foot}{fg=couleurtexte, bg=black}
\setbeamercolor*{normal text}{fg=couleurtexte, bg=couleurtexte}
\setbeamercolor*{block begin}{bg=secondcolor,fg=black}
\setbeamercolor*{block end}{bg=secondcolor,fg=black}
\setbeamercolor*{block body}{bg=firstcolor,fg=black}
\setbeamercolor*{block title}{fg=couleurtexte,bg=secondcolor}
\setbeamerfont{block title}{size=\normalsize}
\setbeamerfont{block body}{size=\tiny}
我认为问题是由于标题和正文的字体大小不同造成的(相同的大小可以给出正确的对齐)
您知道我为什么会收到此错误以及如何更正它吗?
答案1
投影仪块定义如下:
\defbeamertemplate*{block begin}{default}
{
\par\vskip\medskipamount%
\begin{beamercolorbox}[colsep*=.75ex]{block title}% <-- LINE 1
\usebeamerfont*{block title}\insertblocktitle%
\end{beamercolorbox}%
{\parskip0pt\par}%
\ifbeamercolorempty[bg]{block title}
{}
{\ifbeamercolorempty[bg]{block body}{}{\nointerlineskip\vskip-0.5pt}}%
\usebeamerfont{block body}%
\begin{beamercolorbox}[colsep*=.75ex,vmode]{block body}% <-- LINE 2
\ifbeamercolorempty[bg]{block body}{\vskip-.25ex}{\vskip-.75ex}\vbox{}%
}
\defbeamertemplate*{block end}{default}
{\end{beamercolorbox}\vskip\smallskipamount}
您所看到的行为由与字体大小相关的beamercolorbox
选项决定colsep
。因此,您需要做的是使用与字体大小无关的度量(例如 mm)重新定义块开始模板:
\setbeamertemplate{block begin}
{
\par\vskip\medskipamount%
\begin{beamercolorbox}[colsep*=2mm]{block title}
\usebeamerfont*{block title}\insertblocktitle%
\end{beamercolorbox}%
{\parskip0pt\par}%
\ifbeamercolorempty[bg]{block title}
{}
{\ifbeamercolorempty[bg]{block body}{}{\nointerlineskip\vskip-0.5pt}}%
\usebeamerfont{block body}%
\begin{beamercolorbox}[colsep*=2mm,vmode]{block body}%
\ifbeamercolorempty[bg]{block body}{\vskip-.25ex}{\vskip-.75ex}\vbox{}%
}