# bug in fancybox

Denis Girou Denis.Girou at idris.fr
Wed Sep 3 23:02:09 CEST 1997

-----------------------------------------------------------------------------
This is the PSTricks mailing list, devoted to discussions about computational
graphics in (La)TeX using the PSTricks package from Timothy van Zandt.
For help using this mailing list, see instructions at the end of message.
-----------------------------------------------------------------------------

>>>>> "Eric.Picheral" == Eric Picheral <- CRI Universite' Rennes 1 - 99.84.71.23" <Eric.Picheral at univ-rennes1.fr>> writes:

Eric.Picheral> I just discover what seems to be a bug in the new version of
Eric.Picheral> fancybox.sty.
Eric.Picheral> Here is the latex source :

Eric.Picheral> ---------------------------------------------------------------------
Eric.Picheral> \documentclass[10pt,a4paper]{article}
Eric.Picheral> \usepackage{fancybox}

Eric.Picheral> \begin{document}
Eric.Picheral> \tableofcontents

Eric.Picheral> \section{section 1}
Eric.Picheral> \section{section 2}
Eric.Picheral> \section{section 3}
Eric.Picheral> \end{document}
Eric.Picheral> ---------------------------------------------------------------------
Eric.Picheral> If run with the may 97 version of fancybox, the resulting dvi does not
Eric.Picheral> If run with the old version of fancybox, it's OK.

After verification, I see that it is a side effect that I never detect in a

For your case, it is enough to remove this correction:

%\newcount\c at tocdepth

But it is a workaround because at this time the problem I detected (and
which was several times reported after - mainly by people using fancybox with
Seminar) with macros like \fancyput and \fancypage appear again.

You can check it after removing my line with the following test:

\documentclass{article}

\usepackage{fancybox}

\thisfancypage{\setlength{\fboxsep}{1cm}\ovalbox}{}

\begin{document}
\section{Test fancypage}
\end{document}

So what we have to do is to found a better correction than mine, with
no side effect... As it is related to the internals of LaTeX that I don't know
well and often don't understand, if some of you with a better knowledge than
mine has a solution, it will be good...

The error message is:

\addpenalty #1->\ifvmode \if at minipage \else \if at nobreak \else \ifdim \lastskip
=\z@ \penalty #1\relax \else \@tempskipb \lastskip \vskip -\lastskip \penalty #
1\vskip \@tempskipb \fi \fi \fi \else \@noitemerr \fi
#1<-\@secpenalty

\@noitemerr ->\@latex at error {Something's wrong--perhaps a missing \protect \ite
m }\@ehc

In any case, thank you for the report.

D.G.

-----------------------------------------------------------------------------