如何在普通框架中添加framenumber

时间:2010-11-03 12:24:49

标签: latex beamer

我的演示文稿中有一些框架,我想要摆脱我的标准标题/标题,因为我需要数字空间,我使用\includegraphics包含。这些数字占据了整个空间。现在我想插入右下角的帧编号

请注意。我使用标准主题和自定义标题/标题。这里可以找到一个最小的工作示例: http://rapidshare.com/files/429008846/Beamer.zip

这是代码:

\documentclass{beamer}
\usepackage{german}
\usepackage{graphicx}
\usepackage{color}
\usepackage{colortbl}
\usepackage{pgf}
%----------------------------------------------------------------------
%----------------------------------------------------------------------
%new color
\definecolor{Gray}{gray}{0.9}
\def\textboxcolor{Gray}
%----------------------------------------------------------------------
%----------------------------------------------------------------------
\setbeamertemplate{headline}{%
\hspace{0.01\textwidth}\begin{minipage}[t]{0.88\textwidth}
\vspace{0.1cm}
\begin{tabular}{p{0.5\textwidth}p{0.4\textwidth}p{0.1\textwidth}}
Organisation - Institution&%
&%
\includegraphics[width=1cm]{pictures/logos/logo_ohne_text.jpg}\\
\hline\\
\end{tabular}
\end{minipage}}
%----------------------------------------------------------------------
\setbeamertemplate{footline}{%
\hspace{0.01\textwidth}\begin{minipage}[t]{0.88\textwidth}%
\begin{tabular}{p{0.3\textwidth}p{0.35\textwidth}p{0.2\textwidth}p{0.1\textwidth}}%
\rowcolor[rgb]{0.8,0.8,0.8}\hline%
\raggedright\begin{minipage}{0.3cm}\includegraphics[width=0.30cm]{pictures/logos/quadrat.jpg}\end{minipage}\ \insertauthor &%
\centering \    \usebeamerfont{date in head/foot}\insertshortdate{}& &%
Seite \insertframenumber{}/\inserttotalframenumber\\
\hline\\
\end{tabular}
\end{minipage}}
%----------------------------------------------------------------------
%----------------------------------------------------------------------
\begin{document}
%----------------------------------------------------------------------
    \begin{frame}{Normal Frame}
      \begin{block}{Blocktitle}
        Text
      \end{block}
    \end{frame}
%----------------------------------------------------------------------
    \begin{frame}[plain]{Frame with Images}
       \begin{center}
            \includegraphics[height=0.5\textheight]{pictures/cf.png}
            \includegraphics[height=0.5\textheight]{pictures/cf.png}\\
            \includegraphics[height=0.5\textheight]{pictures/cf.png}
            \includegraphics[height=0.5\textheight]{pictures/cf.png}
        \end{center}
        \begin{pgfpicture}{0}{0}{12.8cm}{9.6cm}
            \pgfputat{\pgfxy(10.62,1.05)}{\pgfbox[left,base]{ %
              \tiny{\insertframenumber{}/\inserttotalframenumber}}}
        \end{pgfpicture}
    \end{frame}
%----------------------------------------------------------------------
\end{document}
%----------------------------------------------------------------------
%----------------------------------------------------------------------

3 个答案:

答案 0 :(得分:2)

在我原来的回答中,我要求你张贴一些照片。非常感谢;那些非常有用。


你的幻灯片看起来像是使用Graz主题[1]。我下载了它并提出了这个解决方案。试试这个(用我们称之为你的版本的替换我的\ usetheme {Graz},也许你已经修改了一下):

\documentclass{beamer}
\usepackage{pgf} % make sure you use this!
\setbeamertemplate{navigation symbols}{}
\usetheme{Graz}

\pgfdeclareimage[height=0.5cm]{university-logo}{images/uni_logo}
\logo{\pgfuseimage{university-logo}}

\begin{document}

\begin{frame}[plain]{Test slide}
  \begin{pgfpicture}{0}{0}{12.8cm}{9.6cm} % see Note 1

    \pgfputat{\pgfxy(10.62,1.05)}{\pgfbox[left,base]{ % see Note 2
              \tiny{\insertframenumber{}/\inserttotalframenumber}}}

   \pgfputat{\pgfxy(0.4,1.1)}{\pgfimage[width=0.95\textwidth]{figure}} % see Note 3

  \end{pgfpicture}
\end{frame}

\end{document}

注1:如果您不熟悉pgf [2],则语法为:

\begin{pgfpicture}{start x}{start y}{end x}{end y}

所以你可能只用一张带有{0} {0} {12.8} {1.05}的pgf图片,它会填满整个宽度(0 - > 12.8cm x宽度),只需给你足够的页脚页码(0 - > 1.05cm y高度)。

但是,如果你离开它,你也可以使用pgf来放置你的图像。由你决定。它不会影响整个框架的大小。

注意2:根据您的需要更改这些坐标。您可以在默认幻灯片和此幻灯片之间来回切换以调整这些坐标,直到两者之间的页面#/ tot页面列表中没有明显差异。

一个注意事项是,如果你开始添加文字以及你对框架有什么影响,那么pgfbox的位置可能会被忽略轻微。如果它这样做,只需使用数字得到你喜欢的框架,然后重做\ pfgputat的坐标就可以得到你想要的地方。

注3:我从上面的链接中截取了数字的截图,并使用pgf将其放在我的框架中。你的标题是左对齐的,而我的标题是默认的中心位置,但总体上希望这看起来像你想要的(上面的LaTeX命令生成了这个):IMAGE

就像我说的那样,只需调整各种坐标即可获得所需的一切。


更新11/5:

正如我在注释2中所建议的那样,在框架中添加内容可能会使放置变得混乱。我查看了你的更新代码并使pgf发挥得很好。它可能应该被认为是“黑客”,因为它正在做的是克服由\ includegraphics命令引起的降档。从本质上讲,看起来pgfbox不能驻留在使用此方法放置图形的位置,因此您必须在幻灯片上“人工”创建一个框以强制它出现......但这样可行!我实际上调整了它,这样如果你进入全屏模式,第一张幻灯片上的“Seite 1/2”和第二张幻灯片上的“2/2”之间不应该有任何移动。这是:

\begin{pgfpicture}{0}{0}{12.8cm}{9.6cm}
    \pgfputat{\pgfxy(10.585,9.74)}{\pgfbox[left,base]{ %
      \tiny{\insertframenumber{}/\inserttotalframenumber}}}
\end{pgfpicture}

让我知道这是怎么回事!


[1] www。是的图格拉兹。在/人员/ weiglhofer /杂项/ tugbeamer /

[2]关于ctan的PGF手册:www。 ctan。 base / doc中的org / tex-archive / graphics / pgf

答案 1 :(得分:0)

另一种方法可能是临时使用另一层来显示帧号,例如导航符号。这样做的另一个好处是,该层在帧内容的顶部渲染,因此即使是全屏图像也可以看到。

user1    20

答案 2 :(得分:-1)

我正在为此使用一个简单的解决方案:

\setbeamertemplate{navigation symbols}{\footnotesize\insertframenumber{} / \insertmainframenumber}

它将您的帧号替换为导航符号栏。它显示在每帧的右下角(不仅是[普通]帧)。