Beamer:页码位置

Beamer:页码位置

我正在使用 Beamer,并设法在页码旁边加上单词“Pag:”。为此,我使用\raisebox{1.39cm}(下面代码的第 28 行)直到 Pag. 和页码对齐。但是,即使它有效,我也不喜欢这个解决方案,因为它不精确。你能想出更好的解决方案吗?

\documentclass[8pt,handout]{beamer}
\setbeamertemplate{frametitle}[default][center]
\usepackage[italian,english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath,amssymb,amsthm}
\usepackage{pifont} %per il simbolo dell'elenco puntato
\setbeamercolor{item}{fg=black} %simbolo elenco puntato di nero
\setbeamercolor{frametitle}{fg=black} %frametitle di colore nero
\renewcommand{\sfdefault}{phv} %cambia il font
\usepackage{textpos}

\title{Title}
\author{Author}
\date{}

                      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                      %   Code for the number position of the page  %
                      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\setbeamercolor{page number in head}{fg=black}

\defbeamertemplate{footline}{myframe number}
{
  \hfill%
  \usebeamercolor[fg]{page number in head}%
  \usebeamerfont{page number in head}%
  \raisebox{1.39cm}[0pt][0pt]{ %<----------------  Vertical position of the number
  \shifttext{-619pt}{\insertframenumber}} %<------ Horizontal position of the number
}

\makeatletter 
\newcommand*{\shifttext}[2]{%
  \settowidth{\@tempdima}{#2}%
  \makebox[\@tempdima]{\hspace*{#1}#2}%
}
\makeatother
\setlength{\parindent}{0pt}

\setbeamertemplate{footline}[myframe number]

                      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                      %  End of the code
                      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\setbeamersize{text margin left=40pt,text margin right=40pt}

\begin{document}

\begin{frame}
 \maketitle
\end{frame}

%                         Position of Pag.                  
\addtobeamertemplate{frametitle}{}{%
\begin{textblock*}{100mm}[0.88,-48.2](.85\textwidth,-1cm) %[0.88,-48.2] are coordinates
\parbox{1cm}{\centering
\tiny Pag.}
\end{textblock*}}


\begin{frame}
  \frametitle{\textbf{Title}}
 \begin{itemize}
  \item[\ding{226}] Text

\end{itemize}

\end{frame}
\end{document}

在此处输入图片描述

答案1

您可以像这样定义脚线:

\setbeamertemplate{footline}{
  \usebeamercolor[fg]{page number in head}%
  \usebeamerfont{page number in head}%
  \hspace{40pt}
  Pag. \insertframenumber
  \vspace{40pt}
}

相关内容