Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Mysterious interaction of hyperref and section*, chapter* etc.

798 views
Skip to first unread message

Zargon

unread,
Apr 18, 2000, 3:00:00 AM4/18/00
to
At the start of my document, I have a few part*s with chapter*s for
contents and other stuff (all frontmatter). In my mainmatter, also, I
want an unnumbered introduction section here and there, and these are
section*s or chapter*s. All of the *'d forms until the first non-*'d
sectioning command cause a warning fromhyperref: contentsline with no
destination at blahblahblah. Each of these lacks a hyperlink from the
TOC entry to the section, as well; the missing links make the TOC look
inconsistent and ugly.

How do I fix this? I heard something about starting the document with
a \phantomsection to make sure the hyperref package can make anchors
for the early *'d forms, but when I put this in just before the first
"real" sectioning command (and after \begin{document}), I get
"undefined control sequence".

JLP

unread,
Apr 18, 2000, 3:00:00 AM4/18/00
to
If unnumbered chapters and below are what you want then use:

\newenvironment{mychapter}
{\setcounter{secnumdepth}{-1}}
{\setcounter{secnumdepth}{2}}

put that in your preamble. This will give you unnumbered chapters and
below that appear in the toc. you don't need the starred forms anymore
with this.

If you want an unnumbered part and toc entry do:


\part*[short-name]{partname} %[short-name] with * gives me problems....
\addcontentsline{toc}{part}{partname}

You can also check out titlesec.

\usepackege{titlesec}
\input{ttlhref} %I can't remember the file name exactly...it's in the
docs for titlesec.


Jeremy


Sent via Deja.com http://www.deja.com/
Before you buy.

Jean-Pierre Drucbert

unread,
Apr 18, 2000, 3:00:00 AM4/18/00
to
The latex manual says that the *-form of the sectionning commands does
not accept the optional argument: the *-form puts nothing in the TOC,
neither in the marks, so only one (mandatory) argument is needed, for
the local title of the sectionning command. What would be the use of
[short-name] in \part*[short-name]{patname} ? Superfluous! The
mychapter environment suggestion seems a good staring point, baut
secnumdepth should be retored to its previous value, not to 2, which
is arbitrary (even if if was the default value, the user may have
changed it earlier).

Regards,

--
Jean-Pierre F. Drucbert (JPFD) Email: druc...@onecert.fr
ONERA/Centre de Toulouse SRI Tél. 05-62-25-25-15; FAX: 05-62-25-25-35
Office national d'études et de recherches aérospatiales
Centre de Toulouse Service réseaux et informatique
Complexe scientifique de Rangueil
2, Avenue Édouard Belin BP 4025 F-31055 TOULOUSE CEDEX FRANCE

A bird cannot land once on a great tree and claim to know it.
But I imagine that he would, yes.
Iain M. Banks (1993), Against a dark background.

JLP

unread,
Apr 18, 2000, 3:00:00 AM4/18/00
to
In article <8dhq6v$57e$1...@news.cict.fr>,

perhaps secnumdepth at 2 is a bad idea, but it produces the results
that I want. Also it is in the documentation for titlesec. As for the
precise reason, I'm not sure.

As for the starred form you are right. I'm not sure what I was trying
to accomplish by using that.

Below is a short sample file that I think does what the original poster
wanted. Incidentally, removing the {\setcounrer{secnumdepth}{2}}
cuases an error. Perhaps someone know of an explanation?

\documentclass[openany]{book}
\usepackage[pdfpagelayout=OneColumn,
pdfstartpage=2,
pdfstartview=FitH,
colorlinks=true,
linkcolor=black,
hyperindex=true,
urlcolor=black,]{hyperref}


\newenvironment{mychapter}
{\setcounter{secnumdepth}{-1}}
{\setcounter{secnumdepth}{2}}

\begin{document}
\tableofcontents
\begin{mychapter}
\chapter{Test1}
This is chapter 1.%
\chapter{Test2}
This is chapter 2.%
\end{mychapter}
\end{document}

Zargon

unread,
Apr 19, 2000, 3:00:00 AM4/19/00
to
On Tue, 18 Apr 2000 13:44:10 GMT, JLP <port...@my-deja.com> wrote:

>If unnumbered chapters and below are what you want then use:
>
>\newenvironment{mychapter}
> {\setcounter{secnumdepth}{-1}}
> {\setcounter{secnumdepth}{2}}
>
>put that in your preamble. This will give you unnumbered chapters and
>below that appear in the toc. you don't need the starred forms anymore
>with this.

They are appearing in the toc, it's just that hyperref doesn't seem to
like them.

Zargon

unread,
Apr 19, 2000, 3:00:00 AM4/19/00
to
On 18 Apr 2000 14:07:27 GMT, druc...@atoll.onecert.fr (Jean-Pierre
Drucbert) wrote:

>The latex manual says that the *-form of the sectionning commands does
>not accept the optional argument: the *-form puts nothing in the TOC,
>neither in the marks, so only one (mandatory) argument is needed, for
>the local title of the sectionning command.

It doesn't seem that you are correct, at least not when the amsbook
class is being used. The entries show in the TOC, which I want, and
are unnumbered, which I want. The problem is that hyperref generates
warnings for them and does not generate hyperlinks for them!

>secnumdepth should be retored to its previous value, not to 2...

Not that I have any clue how to save and restore its previous value
anyways.

T. Smith

unread,
Apr 19, 2000, 3:00:00 AM4/19/00
to
On Tue, 18 Apr 2000 15:56:45 GMT, JLP <port...@my-deja.com> wrote:

>Below is a short sample file that I think does what the original poster

>wanted...

Sheesh, you guys obviously didn't bother to read what the original
poster wanted. He already has section* and so forth showing in the
toc, the problem he's having is that hyperref isn't making hyperlinks
and is spewing warning messages, and the phantomsection command he's
heard about isn't working.

JLP

unread,
Apr 19, 2000, 3:00:00 AM4/19/00
to
what version of hyperref are you using? I'm using
[2000/03/22 v6.70 Hypertext links for LaTeX] and get no warnings for
doing this. What are the warnings you get?

Zargon

unread,
Apr 19, 2000, 3:00:00 AM4/19/00
to
On Wed, 19 Apr 2000 09:26:13 GMT, JLP <port...@my-deja.com> wrote:

>what version of hyperref are you using? I'm using
>[2000/03/22 v6.70 Hypertext links for LaTeX] and get no warnings for
>doing this. What are the warnings you get?

Version:
Package: hyperref 1999/04/13 6.56 Hypertext links for LaTeX

Seems to be out of date -- MikTeX seems to have distributed slightly
out-of-date versions of everything, sheesh. Got a URL for a fresh
update, which might have this wart/bug/whatever removed?

The options info it prints:

Package hyperref Info: option hyperindex set true on input line 715.
Package hyperref Info: option colorlinks set true on input line 715.
Package hyperref Info: option bookmarks set true on input line 715.
Package hyperref Info: option bookmarksnumbered set true on input line
715.
Package hyperref Info: Bookmarks ON on input line 732.
Package hyperref Info: Hyper figures OFF on input line 744.
Package hyperref Info: Link nesting OFF on input line 749.
Package hyperref Info: Hyper index ON on input line 752.
Package hyperref Info: Plain pages ON on input line 757.
Package hyperref Info: Backreferencing OFF on input line 764.
Implicit mode ON; LaTeX internals redefined
Package hyperref Info: Hyper figures OFF on input line 1244.
Package hyperref Info: Link nesting OFF on input line 1249.
Package hyperref Info: Hyper index ON on input line 1252.
Package hyperref Info: backreferencing OFF on input line 1259.
Package hyperref Info: Link coloring ON on input line 1262.
*hyperref using default driver hypertex*
Package hyperref Info: Link coloring ON on input line 142.

As far as output driver is concerned, it's using the default, which I
have verified is dvips.

The warnigns are given below. I've consolidated them; they were
interspersed with boxed numbers, e.g. [8], indicating pages output,
and with a smattering of under- and overfull boxes I have yet to track
down and fix. (Fixing the hyperref problem and the mangled table are
my priorities right now.) There were also a few messages about font
loading, whose purpose I can't begin to fathom, but which don't seem
to be warnings or errors, since I've seen them before accompanying
output that looked fine.

Package hyperref Warning: contentsline with no destination at line
170.
Package hyperref Warning: contentsline with no destination at line
171.
Package hyperref Warning: contentsline with no destination at line
177.
Package hyperref Warning: contentsline with no destination at line
179.
Package hyperref Warning: contentsline with no destination at line
182.
Package hyperref Warning: contentsline with no destination at line
184.
Package hyperref Warning: contentsline with no destination at line
185.
Package hyperref Warning: contentsline with no destination at line
199.
Package hyperref Warning: contentsline with no destination at line 1.
Package hyperref Warning: contentsline with no destination at line 37.

Some of these lines are in \include files, others are in the main
file; all correspond to starred forms of document subdivision
commands, e.g. section*, part*, chapter*. All of the corresponding
entries in the TOC lack hyperlinks. It seems to be failing to create
destination anchors with the starred forms.

I saw a similar question a couple of weeks ago answered with a
suggestion to put a \phantomsection command before the first "real"
sectioning command (in my case a \part*); when I tried this, so my
document started like this:

\frontmatter
\maketitle
\phantomsection
\part*{Preface}

I got this:

! Undefined control sequence.
l.170 \phantomsection

(Yes, my preamble is fairly large -- I define a bunch of math notation
shortcuts, some wrappers for tables and theorems, a bunch of
newtheorems, and set up options to use in making pdf output and set up
fancyhdr. I'm outputting plain-jane DVI right now though.)


JLP

unread,
Apr 19, 2000, 3:00:00 AM4/19/00
to
phantomsection _I think_ is a newer command in hyperref. As far as
getting an update 6.70 or later is available on CTAN

ctan.tug.org

do a search for hyperref at

http://ctan.tug.org/ctan/find.html

cd tex-archive/macros/latex/contrib/supported/hyperref/

hope that helps.

AWAY__@efd.lth.se Martin J Nilsson

unread,
Apr 19, 2000, 3:00:00 AM4/19/00
to
Hi!

> Seems to be out of date -- MikTeX seems to have distributed slightly
> out-of-date versions of everything, sheesh. Got a URL for a fresh
> update, which might have this wart/bug/whatever removed?

You can't seriously expect the author of MikTeX to update the entire MikTeX
package everytime something small changes, can you? There are alot of
different sty-files distributed with MikTeX and if he would have to check
them every day to see if they were updated, that would be a bit
time-consuming I expect.

I recommend that you check out:
http://www.tex.ac.uk/tex-archive/help/Catalogue/catalogue.html
which provides links to every TeX and LaTeX package on CTAN.

BTW, stop the silly changing of names... SpamKlr = Zargon = T. Smith, it's a
bit too obvious. Honestly.


kind regards
martin

Heiko Oberdiek

unread,
Apr 19, 2000, 3:00:00 AM4/19/00
to
zar...@hotmail.vom (Zargon) wrote:

>On Wed, 19 Apr 2000 09:26:13 GMT, JLP <port...@my-deja.com> wrote:
>
>>what version of hyperref are you using? I'm using
>>[2000/03/22 v6.70 Hypertext links for LaTeX] and get no warnings for
>>doing this. What are the warnings you get?
>
>Version:
>Package: hyperref 1999/04/13 6.56 Hypertext links for LaTeX

Please try out the latest version _before_ complaining and posting.

http://www.tug.org/applications/hyperref/hyperref.zip

Yours sincerely
Heiko <ober...@ruf.uni-freiburg.de>

Zargon

unread,
Apr 20, 2000, 3:00:00 AM4/20/00
to
On Wed, 19 Apr 2000 16:59:30 +0200, Heiko Oberdiek
<ober...@ruf.uni-freiburg.de> wrote:

>Please try out the latest version _before_ complaining and posting.

I managed to get it installed, once you supplied that URL, but it has
not fixed the problem. Instead of a passel of warnings I get just one:

Package: hyperref 2000/04/12 v6.70e Hypertext links for LaTeX
.
.
.
Package hyperref Warning: No destination for bookmark of
\addcontentsline,
(hyperref) destination is added on input line 171.


Moreover, the first batchof contents lines still have no hyperlinks.

Zargon

unread,
Apr 20, 2000, 3:00:00 AM4/20/00
to
On Thu, 20 Apr 2000 14:46:03 GMT, zar...@hotmail.vom (Zargon) wrote:

>Package hyperref Warning: No destination for bookmark of
>\addcontentsline,
>(hyperref) destination is added on input line 171.
>
>
>Moreover, the first batchof contents lines still have no hyperlinks.

It gets worse. Suddenly almost all the text in the DVI output is red!
The exception being section, figure, theorem, and table captions, and
footnote/index hyperlinks, which are (as usual) pink.

JLP

unread,
Apr 20, 2000, 3:00:00 AM4/20/00
to
yes they probably should change color considering it's a default of
hyperref to change the color of links. read the docs that come with
the package for info on how to change them.

as for the error, what does your addcontentsline look like? look it up
in miktex's help and see what it's supposed to look like or do a search
on this newsgroup.

jeremy

Heiko Oberdiek

unread,
Apr 20, 2000, 3:00:00 AM4/20/00
to
zar...@hotmail.vom (Zargon) wrote:

>On Wed, 19 Apr 2000 16:59:30 +0200, Heiko Oberdiek
><ober...@ruf.uni-freiburg.de> wrote:
>
>>Please try out the latest version _before_ complaining and posting.
>
>I managed to get it installed, once you supplied that URL,

* You should also read this newsgroup, I have posted this URL
a lot of times.
* You know CTAN? You can search there for hyperref.
The version of CTAN is 6.70, much better than your 6.56.

>Package hyperref Warning: No destination for bookmark of
>\addcontentsline,
>(hyperref) destination is added on input line 171.

This only says, that your problem is fixed.

>Moreover, the first batchof contents lines still have no hyperlinks.

I think you do not really want to get an answer without
a good description, what is going wrong, and without
a minimal test file in order to be able to reproduce
the problem.

Yours sincerely
Heiko <ober...@ruf.uni-freiburg.de>

Zargon

unread,
Apr 20, 2000, 3:00:00 AM4/20/00
to
On Thu, 20 Apr 2000 16:44:18 GMT, JLP <port...@my-deja.com> wrote:

>yes they probably should change color considering it's a default of
>hyperref to change the color of links. read the docs that come with
>the package for info on how to change them.

The text of my document shouldn't turn red! Certain links such as
those in the TOC are supposed to be red, but things thatare not links
should not have their color influenced at all by hyperref. And in that
older version, they weren't. Thanks a bunch for pointing me to a newer
version -- the newer version has broken things that used to work!

>as for the error, what does your addcontentsline look like?

I don't use \addcontentsline at all in my document. I just use the
\chapter, \section, \chapter*, and similar structuring commands. So
it's not that I used internal stuff in the TOC management that I
should have left alone. I know that using the internals of a thing
instead of its interface is a big No-No, because unexpected
dependencies can occur and be broken, and because it can put the
system being used into an inconsistent state if internal commands are
misused.

JLP

unread,
Apr 21, 2000, 3:00:00 AM4/21/00
to
In article <38ff6fe2...@news.globalserve.net>,

zar...@hotmail.vom wrote:
> On Thu, 20 Apr 2000 16:44:18 GMT, JLP <port...@my-deja.com> wrote:
>
> >yes they probably should change color considering it's a default of
> >hyperref to change the color of links. read the docs that come with
> >the package for info on how to change them.
>
> The text of my document shouldn't turn red! Certain links such as
> those in the TOC are supposed to be red, but things thatare not links
> should not have their color influenced at all by hyperref. And in that
> older version, they weren't. Thanks a bunch for pointing me to a newer
> version -- the newer version has broken things that used to work!
>
Using latex requires a bit of effort and research on the users part.
You obviously have some error in your document.

> >as for the error, what does your addcontentsline look like?
>
> I don't use \addcontentsline at all in my document. I just use the
> \chapter, \section, \chapter*, and similar structuring commands. So
> it's not that I used internal stuff in the TOC management that I
> should have left alone. I know that using the internals of a thing
> instead of its interface is a big No-No, because unexpected
> dependencies can occur and be broken, and because it can put the
> system being used into an inconsistent state if internal commands are
> misused.

It's next to impossible to assist you if you don't post a sample file
recreating the so called 'bugs'.

Zargon

unread,
Apr 21, 2000, 3:00:00 AM4/21/00
to
On Fri, 21 Apr 2000 03:35:19 GMT, JLP <port...@my-deja.com> wrote:

>In article <38ff6fe2...@news.globalserve.net>,
> zar...@hotmail.vom wrote:
>> On Thu, 20 Apr 2000 16:44:18 GMT, JLP <port...@my-deja.com> wrote:
>>
>> >yes they probably should change color considering it's a default of
>> >hyperref to change the color of links. read the docs that come with
>> >the package for info on how to change them.
>>
>> The text of my document shouldn't turn red! Certain links such as
>> those in the TOC are supposed to be red, but things thatare not links
>> should not have their color influenced at all by hyperref. And in that
>> older version, they weren't. Thanks a bunch for pointing me to a newer
>> version -- the newer version has broken things that used to work!
>>
>Using latex requires a bit of effort and research on the users part.
>You obviously have some error in your document.

I changed only one thing at a time -- I changed from the older to the
newer hyperref. If the red text means I just introduced some error
into my document, as you contend, then the only possible conclusion is
that the error is the use of the new version of hypertex -- IOW, the
new version contains a bug. Which is what I've just been saying. Glad
you agree with me. Now what should I do about it?


>It's next to impossible to assist you if you don't post a sample file
>recreating the so called 'bugs'.

All I have is a bunch of section*, section, chapter*, chapter, part*,
and part commands, as well as figures, tables, and an index, as
regards what goes into or affects the TOC. I have near the start
\tableofcontents, \listoffigures, and \listoftables. I did
\renewcommand{\partname}{Unit} but that shouldn't break anything.
Then again, the subject of the warning is line 171 of the source file,
which reads:

\part*{Preface}

and is the first sectioning command in the document.

For a sample file, try this:

\documentclass{amsbook}
\usepackage{hyperref}
\renewcommand{\partname}{Unit}% in case this does somehow gum things
up
\begin{document}
\title{Title}
\maketitle
\part*{Preface}
\chapter*{Contents}
\tableofcontents
\part{First Unit}
\chapter{First Chapter}
\section{First Section}
First Page
\newpage
Second Page
\newpage
Third Page
\end{document}


I get

Package hyperref Warning: No destination for bookmark of
\addcontentsline,

(hyperref) destination is added on input line 7.

which corresponds to the first \part*. Strangely, if I change

\usepackage{hyperref}

to

\usepackage[colorlinks=true]{hyperref}

I don't get the red text problem -- even if I use all of the same
package options with hyperref that won't reproduce.

However, if I use the \indexname hack to get extra text at the start
of the index, and use hyperref with colorlinks on, I do get the red!

It looks like the \indexname hack and hyperref interact badly, and it
looks like \part* and hyperref interact badly as well. Since I'm going
to have to change the \indexname hack anyways, because of other
trouble it caused, I'm left with only the missing links\no destination
warning problem, which seems to be caused by using a starred
sectioning command as the first sectioning command.

Since the sample file above is well-formed syntactically and
semantically and generates a warning and incorrect output, I must
conclude that I have discovered a bug in hyperref that has changed its
form slightly, but not been fixed, in the newer version.

Heiko Oberdiek

unread,
Apr 21, 2000, 3:00:00 AM4/21/00
to
On Fri, 21 Apr 2000 13:30:04 GMT, zar...@hotmail.vom (Zargon) wrote:

>On Fri, 21 Apr 2000 03:35:19 GMT, JLP <port...@my-deja.com> wrote:
>
>>Using latex requires a bit of effort and research on the users part.
>>You obviously have some error in your document.
>
>I changed only one thing at a time -- I changed from the older to the
>newer hyperref. If the red text means I just introduced some error
>into my document, as you contend, then the only possible conclusion is
>that the error is the use of the new version of hypertex -- IOW, the
>new version contains a bug.

Where is your bug report? Your test file below does not produce
any red text at all (even the color package is not loaded).

>>It's next to impossible to assist you if you don't post a sample file
>>recreating the so called 'bugs'.
>
>All I have is a bunch of section*, section, chapter*, chapter, part*,
>and part commands, as well as figures, tables, and an index, as
>regards what goes into or affects the TOC. I have near the start
>\tableofcontents, \listoffigures, and \listoftables. I did
>\renewcommand{\partname}{Unit} but that shouldn't break anything.
>Then again, the subject of the warning is line 171 of the source file,
>which reads:
>
>\part*{Preface}

The warning is a feature, that an anchor is been set and that
the location of that anchor can be wrong. But in your example
the anchor is very correct. And you already know about
\phantomsection.

>For a sample file, try this:
>
>\documentclass{amsbook}
>\usepackage{hyperref}

Which driver do you use? Without option hypertex, pdftex or
vtex are possible, or do you use a hyperref.cfg file?

>\chapter*{Contents}
>\tableofcontents

The \tableofcontents already simulates \chapter*{\contentsname}.

If you want to have a toc and bookmark entry, you can write:
\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{\contentsname}

Or if you only want to have a bookmark entry:
\cleardoublepage
\pdfbookmark[0]{\contentsname}{contents}

>Package hyperref Warning: No destination for bookmark of
>\addcontentsline,
>(hyperref) destination is added on input line 7.

See above, all is ok. I you do not want to have the warning,
add \phantomsection before \part*{...}.The \phantomsection
should be on the same page of course.

>\usepackage{hyperref}
>
>to
>
>\usepackage[colorlinks=true]{hyperref}
>
>I don't get the red text problem -- even if I use all of the same
>package options with hyperref that won't reproduce.
>
>However, if I use the \indexname hack to get extra text at the start
>of the index, and use hyperref with colorlinks on, I do get the red!

Because it is the third time that I have to write that you
should better provide a minimal test file, that shows the problem,
this is your last chance. Stop claiming, provide useful bug reports
or go away. (I am using a news client with the possibility of kill
filters.)

>I'm left with only the missing links\no destination
>warning problem, which seems to be caused by using a starred
>sectioning command as the first sectioning command.

The \addcontentsline command adds the bookmark entry. But it
needs a destination (where should the bookmark point).
LaTeX does not have hooks for hyperref. Therefore hyperref
does not have many good opertunities for his code to insert.
For example the destination for starred chapters are made
in \@schapter. The link points to the correct page, if
the \addcontentsline comes _after_ \@schapter:
\documentclass{book}
\begin{document}
\chapter*{Starred chapter}
\addcontentsline{toc}{chapter}{Starred chapter}

But the amsbook class already executes \addcontentsline
for starred chapters _before_ hyperref generate the
destination of the chapter.
Therefore you have to help by hand, for example:
\documentclass{amsbook}
\begin{document}
...
\cleardoublepage
\phantomsection
\chapter*{Starred chapter}

Yours sincerely
Heiko <ober...@ruf.uni-freiburg.de>

Zargon

unread,
Apr 21, 2000, 3:00:00 AM4/21/00
to
On Fri, 21 Apr 2000 18:29:45 +0200, Heiko Oberdiek
<ober...@ruf.uni-freiburg.de> wrote:

>The warning is a feature, that an anchor is been set and that
>the location of that anchor can be wrong. But in your example
>the anchor is very correct. And you already know about
>\phantomsection.

Including that on my setup it doesn't seem to work. Remember, I got
"Undefined control sequence" messages using it. Maybe there's a sty
file I need.

>The \tableofcontents already simulates \chapter*{\contentsname}.

Not apparently. There is a contents heading generated in-line but not
a TOC entry for it. This is peculiar since \listoffigures and
\listoftables *do* produce TOC entries.

>If you want to have a toc and bookmark entry, you can write:
>\cleardoublepage
>\phantomsection
>\addcontentsline{toc}{chapter}{\contentsname}

There's that phantomsection again. Is \addcontentsline safe for using
manually? I've seen warnings against using internal commands.

>>Package hyperref Warning: No destination for bookmark of
>>\addcontentsline,
>>(hyperref) destination is added on input line 7.
>
>See above, all is ok. I you do not want to have the warning,
>add \phantomsection before \part*{...}.The \phantomsection
>should be on the same page of course.

What style file provides phantomsection? The ones I've been using
(hyperref, threeparttable, graphicx, and so forth) don't seem to
provide it judging by the error messages I had been getting.

>The link points to the correct page, if
>the \addcontentsline comes _after_ \@schapter:
> \documentclass{book}
> \begin{document}
> \chapter*{Starred chapter}
> \addcontentsline{toc}{chapter}{Starred chapter}

So I need to use the \addcontentsline thing with starred forms? But
starred entries are already appearing in the TOC -- won't this
duplicate them all?

> \documentclass{amsbook}
> \begin{document}
> ...
> \cleardoublepage
> \phantomsection
> \chapter*{Starred chapter}

Once again we come down to \phantomsection... *sigh*

Zargon

unread,
Apr 21, 2000, 3:00:00 AM4/21/00
to
Thanks a lot. I tried some of your advice anyways, and apparently
corrupted the entire project. Now it looks like I'll have to restart
-- from scratch! I get

List of Tables
(group_th.lot

! LaTeX Error: Something's wrong--perhaps a missing \item.

See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...

l.1 \addvspace {10\p@ }


And undoing the changes doesn't fix it. Something is corrupted in the
system itself. Somehow a source that used to compile doesn't anymore,
even though it is word-for-word the same as it had been, as though
LaTeX itself remembers some extra state and won't let me go back. What
do I do now, rewrite my document, or reinstall LaTeX? Or is the
corruption likely to be localized somewhere where it can be fixed with
a hack of some sort?

Zargon

unread,
Apr 21, 2000, 3:00:00 AM4/21/00
to
I just changed the \mychapterstar to have \cleardoublepage and
%\phantomsection in it, the latter to be uncommented whenever I get
whatever sty file I need for \phantomsection to work; and I also
created this:

\newcommand{\mytoc}{%
\renewcommand{\chaptermark}[1]{\markboth{\contentsname}}%
\cleardoublepage%
%\phantomsection%
%\addcontentsline{toc}{chapter}{\contentsname}%
\tableofcontents%
}

Again, the commented lines are to be uncommented when I have
\phantomsection workable. I replaced my

\mychapterstar{Contents}
\tableofcontents
\listoftables
\listoffigures

with

%mychapterstar{Contenrs}%so I could go back if this doesn't work out
-- or so I thought
\mytoc
\listoftabkes
\listoffigures

Thus, the only "real" changes until things are uncommented are a few
\cleardoublepages here and there and no more \mychapterstar{Contents}.
In particular, \mytoc isn't opening any environments or anything that
it might be leaving unclosed when \listoftables gets called. All it
does is redefine \chaptermark, use a \cleardoublepage, and invoke a
\tableofcontents. The \chaptermark bit was happening before with
\mychapterstar too, which means the only thing that could be causing
the error are the smattering of new \cleardoublepages that have been
generated. You could have warned me that \cleardoublepage could be so
dangerous! Imagine that, a command that might if misused force people
to reinstall LaTeX. Seems like someone made something self-modifying
without heed for the likely consequences -- I thought only Microsoft
did that. (Many versions of Windows seem to be self-modifying,
altering their own DLL files from time to time, as evidenced by things
working one day and not the next, and still not after a hard reboot.
Once I had to reinstall it because it self-modified away its ability
to recognize modems, suddenly considering my modem to be perpetually
"in use" even after multiple hard restarts that should have made it
"forget" any per-session state like what hardware was in use by what
software.)

Zargon

unread,
Apr 21, 2000, 3:00:00 AM4/21/00
to
On Fri, 21 Apr 2000 17:23:47 GMT, zar...@hotmail.vom (Zargon) wrote:

I half-fixed it somehow. If I get rid of any of that stuff, and put a
plain \tableofcontents before \listoftables, it works fine. If I have
the \cleardoublepage before the \tableofcontents it also works. If I
put the \renewcommand{\chaptermark} there it fails, but the
\renewcommand is not ill-formed -- in particular it doesn't have any
mismatched braces or mismatched environment delimiters in it. It's
just

\renewcommand{\chaptermark}[1]{\markboth{\contentsname}}

and the only thing even the least bit odd about it is that it discards
an argument, which still ought to be legal. Besides which, it's code
you wrote, and you're supposed to know what you're doing...

AFAICT, something is corrupt in LaTeX on my system now, so certain
innocuous combinations like that \renewcommand and a \tableofcontents
will cause errors in unrelated areas, like \listoftables. Please
inform me immediately as to how I can undo this damage, so that things
work normally again.


ja...@uci.edu

unread,
Apr 21, 2000, 3:00:00 AM4/21/00
to
zar...@hotmail.vom (Zargon) writes:

> AFAICT, something is corrupt in LaTeX on my system now, so certain
> innocuous combinations like that \renewcommand and a \tableofcontents
> will cause errors in unrelated areas, like \listoftables.

Unless you changed the actual source of some of the packages you were
loading, or hacked the LaTeX format (both of which strike me as
unlikely, though I haven't followed this thread that closely), I doubt
that your "LaTeX system" is corrupt. You probably have a syntax error
in one of your input files, or an error in one of the auxillary files
that gets created "behind-your-back" (so to speak). If you _know_
that your project files are valid, you might try getting rid of the
auxilary files (say, by moving them to a directory that LaTeX doesn't
know about) and try re-TeXing the whole thing from scratch.

Jason

Giuseppe Bilotta

unread,
Apr 21, 2000, 3:00:00 AM4/21/00
to

Zargon <zar...@hotmail.vom> wrote in message

Try deleting all .aux, .toc, .lot, .lof etc files (that is, everything
except for source files) and recompile.

Also, whenever you do a change, keep a backup file in case something goes
wrong (this is true any time).

--
Giuseppe Bilotta
obl...@freemail.it

=============================================
This paper contains much that is new and much that is true.
Unfortunately, that which is true is not new
and that which is new is not true.
(Wolfgang Pauli (attr.))
=============================================


Giuseppe Bilotta

unread,
Apr 23, 2000, 3:00:00 AM4/23/00
to
>
> AFAICT, something is corrupt in LaTeX on my system now, so certain
> innocuous combinations like that \renewcommand and a \tableofcontents
> will cause errors in unrelated areas, like \listoftables.

If you have NOT modified the LaTeX source files, NOTHING can be broken; if
it worked before, it will do it again; unlike word processors, TeX systems
produce the same output under the same conditions.

If you have problems that you cannot solve by deleting auxiliary files
(.aux., .lot, .lof, etc), then you either re\def'ed some internal macro in
your document, or modified the standard files.

> Please inform me immediately as to how I can undo this damage, so that
things
> work normally again.

You need some rethoric lessons; would it have costed you much asking kindly
something like "Does anybody know of a way to undo the damage?" instead of
asking for immediate help; of course, the "please" is already a step forward
...

0 new messages