我在 Beamer 中有一张图片和文字\frametitle
。我通过 将它们放在一起\tabular
。
现在我想知道如何将文本和图像相对于幻灯片那部分的蓝色背景垂直居中?\tabular
如果使用其他东西更容易居中,我也可以不使用。
下面给出了带有测试图像的最小工作示例:
\documentclass[aspectratio=169]{beamer}
\mode<presentation>
\usetheme{Goettingen}
\setbeamercovered{transparent}
\usecolortheme{seahorse}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{times}
\usepackage{eurosym}
\usepackage{tabularx}
\usepackage{xcolor}
\graphicspath{ {./images169/} }
\title[My title]
{My title\\[2ex]
project\\2021/2022.}
\author[D. Stokić]
{Dušan Stokić}
\date{\today}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\begin{frame}
\frametitle{
\begin{tabular}[t]{l c}
\includegraphics[width=.175\textwidth]{p4-logo} & frame title\\
\end{tabular}
}
\tableofcontents
\end{frame}
\section{section1}
\begin{frame}
\frametitle{
\begin{tabular}[t]{l c}
\includegraphics[width=.175\textwidth]{p4-logo} & frame title\\
\end{tabular}
}
\begin{figure}[t]
\centering
\includegraphics[width=0.5\textwidth]{p4-logo}
\end{figure}
\begin{block}{basic:}
\begin{itemize}
\item <1-> item1,
\item <2-> \textcolor{red}{item2}
\end{itemize}
\end{block}
\end{frame}
\section{section2}
\begin{frame}
\titlepage
\end{frame}
\end{document}
答案1
和\raisebox
:
\documentclass[aspectratio=169]{beamer}
\mode<presentation>
\usetheme{Goettingen}
\setbeamercovered{transparent}
\usecolortheme{seahorse}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{times}
\usepackage{eurosym}
\usepackage{tabularx}
\usepackage{xcolor}
\graphicspath{ {./images169/} }
\title[My title]
{My title\\[2ex]
project\\2021/2022.}
\author[D. Stokić]
{Dušan Stokić}
\date{\today}
\usepackage{tabularray}
\newcommand{\mytitle}[1]{%
\begin{tblr}{Q[c]X[l]}
\raisebox{-.26\height}{\includegraphics[width=.175\textwidth]{p4-logo}} & #1\\
\end{tblr}}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\begin{frame}
\frametitle{\mytitle{First frame title}}
\tableofcontents
\end{frame}
\section{section1}
\begin{frame}
\frametitle{\mytitle{Second frame title}}
\begin{figure}[t]
\centering
\includegraphics[width=0.5\textwidth]{p4-logo}
\end{figure}
\begin{block}{basic:}
\begin{itemize}
\item <1-> item1,
\item <2-> \textcolor{red}{item2}
\end{itemize}
\end{block}
\end{frame}
\section{section2}
\begin{frame}
\titlepage
\end{frame}
\end{document}