Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Using tikz/matrix inside beamer, I have several slides with a wrong page/frame count.

Why is that so, and how can I avoid it?

MWE:

\documentclass[14pt]{beamer}
\usepackage{tikz}
\usetikzlibrary{matrix}

\setbeamertemplate{footline}{\insertframenumber/\inserttotalframenumber}
\begin{document}

\begin{frame}[fragile]
  \frametitle{Bar}
    \begin{tikzpicture}
    \matrix (m) [matrix of math nodes]
    {42&42\\23&23\\};
  \end{tikzpicture}
\end{frame}

\end{document}

This gives me a frame number of 2/2 even though there is only one slide. I use tikz/matrices to write (category theory-ish) diagrams with arrows because diagrams.sty didn't work in beamer, and then, I use [fragile] for the code to compile because of the &.

EDIT: I found a way to solve the problem, but I'm still interested in explications (and reproduction of the problem, as it seems not every one has this bug. I'm using TeTex and beamer-3.07, both from the FreeBSD ports, so maybe it's a compatibility bug or an old version issue…)

share|improve this question
    
I get a regular 1/1 –  egreg Nov 15 '11 at 0:11
    
@egreg: I get 2/1 on first pass (with pdflatex), and 2/2 on second pass… –  Axioplase Nov 15 '11 at 0:14
    
I always get 1/1. –  egreg Nov 15 '11 at 0:16
    
I get 1/1 also with beamer 3.07 on a TeX Live 2009 –  egreg Nov 15 '11 at 7:51
add comment

closed as too localized by egreg, Joseph Wright Nov 30 '11 at 12:56

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers

In 2006, support for teTeX has been stopped. I recommend installing TeX Live 2011, which is also available for FreeBSD. It also contains a newer version of beamer. With TeX Live, I get the correct behavior for your example, a single frame numbered 1/1.

share|improve this answer
    
For FreebBSD, you use the "unofficial" port? Because it's not in my port tree, afaik. –  Axioplase Nov 15 '11 at 9:41
add comment
up vote 2 down vote accepted

Hum, the following solved the issue, for some reason.

\begin{frame}
  \frametitle{Bar}
    \begin{tikzpicture}[ampersand replacement=\&]
    \matrix (m) [matrix of math nodes]
    {42\&42\\23\&24\\};
  \end{tikzpicture}
\end{frame}
share|improve this answer
2  
So this sounds as though it's a bug with what happens when beamer writes a "fragile" frame to a file and then reads it back in again. However, as you're using a very old version of beamer, the best solution is as Stefan says: upgrade. –  Andrew Stacey Nov 15 '11 at 7:45
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.