我想微調投影機簡報中幀編號的位置,在其中我可以調整分數相對於幀角的水平和垂直邊距。你能幫忙嗎? 這是相同的 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}
在最初的大都會主題中,腳線基本上是這樣定義的:
\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
更改 來水平移動幀編號。