[tex-live] beamer and hyperref

Vedran Miletić rivanvx at gmail.com
Mon Apr 5 14:11:30 CEST 2010


Hi everyone,

there is a bug in beamer related to hyperref and PDF bookmarks: beamer
adds \section* and \subsection* to PDF bookmarks (but not to
\tableofcontents), and \subsection* appears empty; it would be much
more logical if it didn't add them at all.

Since beamer is no longer maintained, I'm posting this patch Heiko
sent me when I mailed him about it. It works; all you need to do is
put it into document preamble. It would be great if someone could
integrate this with beamer source (effectively replacing code that
doesn't work), so I'm CC'ing Karl and Vladimir who stepped up when
beamer's interaction with geometry had to be patched.

I looked at beamerbasesections.sty, but to actually integrate this fix
requires knowledge of LaTeX macros. The difference between lines 238
and 166 could be the reason why subsections appear empty, while
sections appear with a name.

Regards,

Vedran Miletić

\makeatletter
\long\def\@LongEmpty{}
\newcommand*{\org at beamer@section}{}
\let\org at beamer@section\beamer at section
\long\def\beamer at section[#1]#2{%
  \let\org at writebookmark\Hy at writebookmark
  \long\def\@secname{#1}%
  \ifx\@secname\@LongEmpty
   \def\Hy at writebookmark##1##2##3##4##5{}%
  \fi
  \long\def\@secname{#2}%
  \ifx\@secname\@LongEmpty
   \def\Hy at writebookmark##1##2##3##4##5{}%
  \fi
  \org at beamer@section[{#1}]{#2}%
  \let\Hy at writebookmark\org at writebookmark
}
\newcommand*{\org at beamer@subsection}{}
\let\org at beamer@subsection\beamer at subsection
\long\def\beamer at subsection[#1]#2{%
  \let\org at writebookmark\Hy at writebookmark
  \long\def\@secname{#1}%
  \ifx\@secname\@LongEmpty
    \def\Hy at writebookmark##1##2##3##4##5{}%
  \fi
  \long\def\@secname{#2}%
  \ifx\@secname\@LongEmpty
    \def\Hy at writebookmark##1##2##3##4##5{}%
  \fi
  \org at beamer@subsection[{#1}]{#2}%
  \let\Hy at writebookmark\org at writebookmark
}
\makeatother



More information about the tex-live mailing list