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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My question is in a sense the reverse of this question on overlays. Here's what I'd like to do.

I have a beamer presentation that includes two frames, each with some overlays. Each frame looks like


Suppose I have 3 overlays in each frame. Then my output PDF has 6 pages and even if I don't render page numbers in my style, I can see the page numbers in the viewer.

What I'd like instead to have happen is that the pages are numbered X-Y in the final PDF, so that in my PDF viewer, I see "1-1, 1-2, 1-3, 2-1, 2-2, 2-3" instead of 1-6.

Note that this may be independent of whether I choose to render the page numbers in a beamer style (I'm not sure if it is).

My reason is that I want a better way to calibrate the "number of slides" that my talk has, and overlays shouldn't really count (because they animate quickly)

Update: Here's an example of what I'd see in the viewer:

enter image description here

share|improve this question
At its heart, this seems to be asking for custom page numbers in the PDF to be displayed in the viewer (ie not (just) typeset on the page). Am I right? If so, there are two parts: customising the PDF page numbers and getting beamer to put the A-B part in there. The first of these is not beamer related and, without investigation, for me looks the harder task. Do you know if it is possible? If not, and my interpretation is right, you might want to consider splitting this into two questions accordingly. – Loop Space Aug 22 '12 at 8:16
You may be right. I know this is possible because when I generate views in ipe, I can get this effect. Since Ipe uses latex to generate the final output, I assumed that it's a tex trick. Specifically, using the "create page" feature in ipe to make a multipage pdf, and the 'create view" to create overlays, I can get this. – Suresh Aug 22 '12 at 10:01

The PDF page labels are added by beamer via \thispagelabel{\insertframenumber}. Because hyperref uses \pdfstringdef to convert the page label to a PDF string, its methods, \pdfstringdefDisableCommands can be used to change \insertframenumber for the page labels. I have not found a counter for the overlays, the only useful thing was the page number \beamer@framestartpage, when the frame starts. That at least allows the calculation of the overlay number.




1st frame,\\
\only<1>{1st overlay}
\only<2>{2nd overlay}
\only<3>{3rd overlay}

2nd frame,\\
\only<1>{1st overlay}
\only<2>{2nd overlay}
\only<3>{3rd overlay}


Thumbnail view with PDF page labels

Corresponding image from updated question:

enter image description here

Output of \listfiles, MiKTeX 2.9:

 *File List*
  beamer.cls    2011/09/12 development version 3.20 A class for typesetting pre
sentations (rcs-revision 70f9d8411e54)
beamerbasercs.sty    2012/06/01 (rcs-revision 352157baec3a)
beamerbasemodes.sty    2012/04/15 (rcs-revision cc6557182d97)
beamerbasedecode.sty    2010/05/01 (rcs-revision efa082c6111d)
   ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)
beamerbaseoptions.sty    2010/04/27 (rcs-revision 982469101dd6)
  keyval.sty    1999/03/16 v1.13 key=value parser (DPC)
geometry.sty    2010/09/12 v5.6 Page Geometry
  ifvtex.sty    2010/03/01 v1.5 Detect VTeX and its facilities (HO)
 ifxetex.sty    2010/09/12 v0.6 Provides ifxetex conditional
  size11.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
 pgfcore.sty    2010/04/11 v2.10 (rcs-revision 1.7)
graphicx.sty    1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
graphics.sty    2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg    2010/04/23 v1.9 graphics configuration of TeX Live
  pdftex.def    2011/05/27 v0.06d Graphics/color for pdfTeX
infwarerr.sty    2010/04/08 v1.3 Providing info/warning/error messages (HO)
 ltxcmds.sty    2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
  pgfsys.sty    2010/06/30 v2.10 (rcs-revision 1.37)
  pgfrcs.sty    2010/10/25 v2.10 (rcs-revision 1.24)
everyshi.sty    2001/05/15 v3.00 EveryShipout Package (MS)
pgfsyssoftpath.code.tex    2008/07/18  (rcs-revision 1.7)
pgfsysprotocol.code.tex    2006/10/16  (rcs-revision 1.4)
  xcolor.sty    2007/01/21 v2.11 LaTeX color extensions (UK)
   color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive
 xxcolor.sty    2003/10/24 ver 0.1
hyperref.sty    2012/05/13 v6.82q Hypertext links for LaTeX
hobsub-hyperref.sty    2012/04/25 v1.12 Bundle oberdiek, subset hyperref (HO)
hobsub-generic.sty    2012/04/25 v1.12 Bundle oberdiek, subset generic (HO)
  hobsub.sty    2012/04/25 v1.12 Construct package bundles (HO)
ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)
 intcalc.sty    2007/09/27 v1.1 Expandable calculations with integers (HO)
etexcmds.sty    2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
kvsetkeys.sty    2012/04/25 v1.16 Key value parser (HO)
kvdefinekeys.sty    2011/04/07 v1.3 Define keys (HO)
pdftexcmds.sty    2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO)
pdfescape.sty    2011/11/25 v1.13 Implements pdfTeX's escape features (HO)
bigintcalc.sty    2012/04/08 v1.3 Expandable calculations on big integers (HO)
  bitset.sty    2011/01/30 v1.1 Handle bit-vector datatype (HO)
uniquecounter.sty    2011/01/30 v1.2 Provide unlimited unique counter (HO)
letltxmacro.sty    2010/09/02 v1.4 Let assignment for LaTeX macros (HO)
 hopatch.sty    2011/06/24 v1.1 Wrapper for package hooks (HO)
xcolor-patch.sty    2011/01/30 xcolor patch
atveryend.sty    2011/06/30 v1.8 Hooks at the very end of document (HO)
atbegshi.sty    2011/10/05 v1.16 At begin shipout hook (HO)
refcount.sty    2011/10/16 v3.4 Data extraction from label references (HO)
 hycolor.sty    2011/01/30 v1.7 Color options for hyperref/bookmark (HO)
kvoptions.sty    2011/06/30 v3.11 Key value format for package options (HO)
  pd1enc.def    2012/05/13 v6.82q Hyperref: PDFDocEncoding definition (HO)
hyperref.cfg    2002/06/06 v1.2 hyperref configuration of TeXLive
     url.sty    2006/04/12  ver 3.3  Verb mode for urls, etc.
 hpdftex.def    2012/05/13 v6.82q Hyperref driver for pdfTeX
rerunfilecheck.sty    2011/04/15 v1.7 Rerun checks for auxiliary files (HO)
beamerbaserequires.sty    2010/05/01  (rcs-revision efa082c6111d)
beamerbasecompatibility.sty    2012/05/01  (rcs-revision 67c48b3b652d)
beamerbasefont.sty    2012/05/10  (rcs-revision a0b4f9f91ee9)
 amssymb.sty    2009/06/22 v3.00
amsfonts.sty    2009/06/22 v3.00 Basic AMSFonts support
sansmathaccent.sty    2012/04/26
beamerbasetranslator.sty    2010/06/11  (rcs-revision 85fd1cc7fc42)
translator.sty    2010/06/12 ver 1.10
beamerbasemisc.sty    2012/02/24  (rcs-revision 2ff5461be705)
beamerbasetwoscreens.sty    2010/05/01  (rcs-revision efa082c6111d)
beamerbaseoverlay.sty    2012/04/03  (rcs-revision 45744d9ae88b)
beamerbasetitle.sty    2010/09/21  (rcs-revision f0446ed0b6ae)
beamerbasesection.sty    2012/05/30  (rcs-revision 22ff49def670)
beamerbaseframe.sty    2012/05/31  (rcs-revision 5fc3b3dbfeba)
beamerbaseverbatim.sty    2011/09/12  (rcs-revision 70f9d8411e54)
beamerbaseframesize.sty    2011/09/12  (rcs-revision 70f9d8411e54)
beamerbaseframecomponents.sty    2012/03/07  (rcs-revision 9f094699ce15)
beamerbasecolor.sty    2010/06/06  (rcs-revision d1a9b48be06d)
beamerbasenotes.sty    2010/05/01  (rcs-revision efa082c6111d)
beamerbasetoc.sty    2012/02/28  (rcs-revision 138681b92320)
beamerbasetemplates.sty    2010/05/01  (rcs-revision efa082c6111d)
beamerbaseauxtemplates.sty    2012/05/01  (rcs-revision 67c48b3b652d)
beamerbaseboxes.sty    2012/05/13  (rcs-revision 56972908a390)
beamerbaselocalstructure.sty    2012/05/25  (rcs-revision 5ff5e8ed7c0e)
enumerate.sty    1999/03/05 v3.00 enumerate extensions (DPC)
beamerbasenavigation.sty    2012/04/03  (rcs-revision 42a0f21a412d)
beamerbasetheorems.sty    2010/06/06  (rcs-revision 7e7cc5e53e9d)
 amsmath.sty    2000/07/18 v2.13 AMS math features
 amstext.sty    2000/06/29 v2.01
  amsgen.sty    1999/11/30 v2.0
  amsbsy.sty    1999/11/29 v1.2d
  amsopn.sty    1999/12/14 v2.01 operator names
  amsthm.sty    2004/08/06 v2.20
beamerbasethemes.sty    2010/05/01  (rcs-revision efa082c6111d)
beamerthemedefault.sty    2010/06/17  (rcs-revision d02a7cf4d8ae)
beamerfontthemedefault.sty    2010/06/17  (rcs-revision d02a7cf4d8ae)
beamercolorthemedefault.sty    2010/06/17  (rcs-revision d02a7cf4d8ae)
beamerinnerthemedefault.sty    2012/05/01  (rcs-revision 67c48b3b652d)
beamerouterthemedefault.sty    2010/06/17  (rcs-revision d02a7cf4d8ae)
   t1enc.def    2005/09/27 v1.99g Standard LaTeX file
 lmodern.sty    2009/10/30 v1.6 Latin Modern Fonts
  t1lmss.fd    2009/10/30 v1.6 Font defs for Latin Modern
epstopdf-base.sty    2010/02/09 v2.5 Base part for package epstopdf
  grfext.sty    2010/08/19 v1.1 Manage graphics extensions (HO)
 nameref.sty    2010/04/30 v2.40 Cross-referencing by name of section
gettitlestring.sty    2010/12/03 v1.4 Cleanup title references (HO)
share|improve this answer
That'll be \beamer@slideinframe (see tex.stackexchange.com/q/55058/86) – Loop Space Aug 22 '12 at 10:01
ah. unfortunately, this changes page numbers but not what the viewer sees. – Suresh Aug 22 '12 at 10:02
No, it does not change the page numbers, but the page labels. A PDF page label is a string that tells the PDF viewer, how the page should be labeled. – Heiko Oberdiek Aug 22 '12 at 10:33
@AndrewStacey: Unfortunately \the\beamer@slideinframe will not help here, the values are not correct, increased by one except for the last slide in a frame. – Heiko Oberdiek Aug 22 '12 at 10:35
From a glance at the code, my guess is that \beamer@slideinframe gets incremented after the frame content is read but before it gets written out, whence when \insertframenumber is used then it actually is at the next setting, except for the last frame as that skips the incrementation step. – Loop Space Aug 22 '12 at 11:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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