When I use titlesec, hyperref, and algorithm2e together, sections after an \appendix are not numbered properly.
\documentclass{article}
\usepackage{titlesec}
\usepackage{hyperref}
\usepackage{algorithm2e}
\begin{document}
\section{foo}
\appendix
\section{bar}
\end{document}
Compiling this gives the warning
pdfTeX warning (ext4): destination with the same identifier (name{section.1}) has been already used, duplicate ignored
Sure enough, the .aux file shows
\@writefile{toc}{\contentsline {section}{\numberline {1}foo}{1}{section.1}}
\@writefile{toc}{\contentsline {section}{\numberline {A}bar}{1}{section.1}}
- Removing
titlesecchanges the secondsection.1toappendix.1. - Removing
algorithm2echanges the secondsection.1tosection.A. - Removing both changes the second
section.1toappendix.A.
Unlike last time, I tried all six permutations of the packages but had no luck.
Can this combination of packages be made to work?
\let\chapter\undefinedafter loadingalgorithm2e. As you note, I should have been loadinghyperreflast, and indeed I normally would. I just happened to start with lexicographic ordering of the packages to make sure I didn't miss any of the 6 permutations. t, h, a was the 6th permutation. =) – TH. Apr 10 '11 at 01:13