[OS X TeX] Hyperref and multiple appendices

Themis Matsoukas tmatsoukas at icloud.com
Fri May 30 20:53:06 CEST 2014


I hacked some code I found that places appendices as sections at the end of a chapter. The code resets the section number to zero so that the first section in the appendix of a chapter is set to 1. The problem is that the hyperref link in the table of contents is wrong and points to section 1 at the beginning of the chapter. I’m not sure how to fix this. Here is my minimal example. 

\documentclass[11pt,article]{memoir}
\usepackage[colorlinks]{hyperref}
\usepackage{lipsum}

\newcommand{\StartApp}{\setcounter{section}{0}
\renewcommand\thesection{\Alph{section}}}
\newcommand{\EndApp}{\renewcommand\thesection{\thechapter.\arabic{section}}}

\begin{document}
\tableofcontents
\chapter{First chapter}
         \section{Introduction}
         \lipsum
\StartApp
         \section{Derivations}
         \lipsum
\EndApp
\chapter{Second chapter}

\end{document}

Themis





More information about the macostex-archives mailing list