微调帧号的位置

微调帧号的位置

我想微调投影仪演示文稿中帧编号的位置,以便调整相对于帧角的分数的水平和垂直边距。您能帮忙吗? 在此处输入图片描述以下是相同的 MWE:

\documentclass[9pt]{beamer}

\usepackage{graphicx} % Required for inserting images
\usepackage{lipsum}
\usepackage{amsfonts, amsmath,amssymb,amsthm}
\usepackage{tikz}



\usetheme[numbering=fraction]{metropolis}
\usecolortheme{dove}
\setbeamertemplate{title separator}{}


% Adjust the position of the frametitle
\makeatletter
\setbeamertemplate{frametitle}{
  \nointerlineskip%
  \begin{beamercolorbox}[sep=0.3cm,ht=3em,wd=\paperwidth]{frametitle}
    \vbox{}\vskip-1ex%
    \hspace{1.2em}\strut\underline{\insertframetitle}\strut
    \vskip-1.5ex%
  \end{beamercolorbox}
}
\makeatother





\usepackage{xcolor}
\definecolor{VimalBlue}{RGB}{51, 51, 179}
\definecolor{VimalGreen}{RGB}{0, 102, 0}
\definecolor{VimalPurple}{RGB}{93, 94, 200}
\definecolor{ChadDarkBlue}{rgb}{.1,0,.2}  
\definecolor{ChadBlue}{rgb}{.1,.1,.5}  
\definecolor{ChadRoyal}{rgb}{.2,.2,.8} 
\definecolor{ChadGreen}{rgb}{0,.4,0} 

\setbeamercolor{frametitle}{fg=VimalBlue}
\setbeamercolor{title}{fg=VimalBlue}
\setbeamercolor{author}{fg=VimalGreen}
\setbeamercolor{footline}{fg=black!50}




%\setbeamersize{text margin left=20pt}

\setbeamertemplate{title page}{
  \begin{center}
    \usebeamercolor[fg]{title}\inserttitle\\[1ex]
    \usebeamercolor[fg]{subtitle}\insertsubtitle\\[6ex]
    \usebeamercolor[fg]{author}\insertauthor\\[2ex]
    \usebeamercolor[fg]{institute}\insertinstitute\\[2ex]
    \usebeamercolor[fg]{date}\insertdate
  \end{center}
}



% Set custom color and size for bullets
\setbeamertemplate{itemize item}{$\bullet$}
\setbeamertemplate{itemize subitem}{$\circ$}
\setbeamertemplate{itemize subsubitem}{--}

\setbeamertemplate{enumerate item}[circle]
\setbeamertemplate{enumerate subitem}[circle]

% Customize the enumerate item template
\setbeamertemplate{enumerate item}{
  \tikz[baseline=(item.base)]{
    \node[inner sep=0, outer sep=0, draw=VimalPurple, fill=VimalPurple, text=white,circle, minimum size=0.3em, inner sep=0.1em] (item) {\scriptsize\insertenumlabel};
  }
}

\setbeamertemplate{enumerate subitem}{
  \tikz[baseline=(item.base)]{
    \node[inner sep=0, outer sep=0, draw=VimalPurple, fill=VimalPurple, text=white,square, minimum size=0.3em, inner sep=0.2em] (item) {\scriptsize\insertenumlabel};
  }
}




\setbeamertemplate{itemize/enumerate body begin}{\normalsize}
\setbeamertemplate{itemize/enumerate subbody begin}{\normalsize}


% Customize the enumerate items template
\setbeamercolor{itemize item}{fg=VimalBlue}
\setbeamercolor{itemize subitem}{fg=VimalBlue}


%\setbeamerfont{itemize item}{size=\huge}
%\setbeamerfont{itemize subitem}{size=\small}



% Font packages
\usepackage{mathptmx}
%\usepackage[cochineal]{newtxmath}
\usepackage{bm}   
\usepackage[scaled]{helvet}
\usepackage{microtype}



\title{\huge \textbf{Title}}
\subtitle{\large Authors}
\author{\textbf{\large John Doe}\\Workshop\\Insti\\January 2024}
\date{}

\begin{document}
\maketitle


\begin{frame}{Motivation}
\lipsum[1]
\end{frame}

\end{document}

答案1

metropolis您可以不必使用过时的主题,而是使用moloch更现代的主题分支metropolis

moloch主题的优点是它使用标准page number in head/foot模板,您可以轻松添加一些间距:

\documentclass[9pt]{beamer}

\usetheme{moloch}% modern fork of the metropolis theme
\setbeamertemplate{page number in head/foot}[totalframenumber]

\addtobeamertemplate{page number in head/foot}{}{\hspace*{0.5cm}\vspace*{0.5cm}}

\begin{document}


\begin{frame}
\frametitle{Motivation}
\end{frame}

\end{document}

在此处输入图片描述

在原有的大都市主题中,footline 的定义基本上是这样的:

\documentclass[9pt]{beamer}

\usetheme[numbering=fraction]{metropolis}

\makeatletter
\setbeamertemplate{footline}{%
  \begin{beamercolorbox}[wd=\textwidth, sep=3ex,rightskip=0pt]{footline}% <- change the 3ex to control the distance of the frame number from the right and bottom margin, change the 0pt to additional move the frame number further left
    \usebeamerfont{page number in head/foot}%
    \usebeamertemplate*{frame footer}
    \hfill%
    \usebeamertemplate*{frame numbering}
  \end{beamercolorbox}%
}
\makeatother

\begin{document}


\begin{frame}
\frametitle{Motivation}
\end{frame}

\end{document}

您可以更改来sep修改到底部和右边缘的距离,另外还可以rightskip更改来水平移动帧号。

相关内容