[OS X TeX] addcontentsline difficulty

David Arnold dwarnold45 at suddenlink.net
Mon Jul 6 07:10:13 CEST 2009


All,

Using memoir and hyperref. I have a macro:

\newenvironment{Exercises}
	{\openoutputfile{\jobname.backans}{backansout}%
	\addcontentsline{toc}{subsection}{Exercises}
	\noindent\rule{\linewidth}{1pt}
	\par\medskip\hfil{\Large\mylleaf\quad\mylleaf\quad\mylleaf\qquad  
\textbf{Exercises}\qquad\myrleaf\quad\myrleaf\quad\myrleaf}\hfil\par
	\noindent\rule{\linewidth}{1pt}}
	{\closeoutputstream{backansout}}

The result typeset like this:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pastedGraphic.tiff
Type: image/tiff
Size: 23286 bytes
Desc: not available
URL: <http://tug.org/pipermail/macostex-archives/attachments/20090705/03715098/attachment.tiff>
-------------- next part --------------



There is no \subsection command used here, just what you see in the  
macro. The difficulty we are experiencing is the addcontentsline.  
Works OK, puts the correct page in the TOC.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pastedGraphic.tiff
Type: image/tiff
Size: 40478 bytes
Desc: not available
URL: <http://tug.org/pipermail/macostex-archives/attachments/20090705/03715098/attachment-0001.tiff>
-------------- next part --------------




But when we click on the link in the TOC, we land on a page or two  
earlier than we should. There is no error of "unnamed destination in  
the log file."

The chapter toc  file looks somewhat strange.

\contentsline {chapter}{\chapternumberline {4}Fractions}{1}{chapter.4}
\contentsline {section}{\numberline {4.1}Equivalent Fractions}{3} 
{section.4.1}
\contentsline {subsection}{The Greatest Common Divisor}{6}{section*.1}
\contentsline {subsection}{Reducing a Fraction to Lowest Terms}{7} 
{section*.2}
\contentsline {subsection}{Reducing Fractions with Variables}{9} 
{section*.3}
\contentsline {subsection}{A Word on Mathematical Notation.}{10} 
{section*.4}
\contentsline {subsection}{Equivalent Fractions in Higher Terms}{11} 
{section*.5}
\contentsline {subsection}{Negative Fractions}{12}{section*.6}
\contentsline {subsection}{Exercises}{14}{example.4.1.10}

This is the line of concern:

\contentsline {subsection}{Exercises}{14}{example.4.1.10}

This is where we wind up when we click Exercises in the TOC:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pastedGraphic.tiff
Type: image/tiff
Size: 23664 bytes
Desc: not available
URL: <http://tug.org/pipermail/macostex-archives/attachments/20090705/03715098/attachment-0002.tiff>
-------------- next part --------------



So, were being taken to the last "\label" just prior to the exercises  
on a consistent basis whenever we click on tany "Exercises" link in  
the TOC.

Can someone shine some light on our difficulty?

Thanks.

David Arnold
College of the Redwoods








More information about the macostex-archives mailing list