cwebbin icon indicating copy to clipboard operation
cwebbin copied to clipboard

ctwill and table of contents ToC

Open joaocortes opened this issue 4 years ago • 6 comments

ctwill does not produce a ToC, even with the option +x. According to the man documentation,

       • -x: omit indices, section names, table of contents

Running ctwill-twinx attempt.tex > index.tex creates a master index, but there is no table of contents.

Is this by design?

joaocortes avatar Mar 03 '21 17:03 joaocortes

Yes, it is by design. See ctwimac.tex and pdfctwimac.tex for details about \inx, \fin, and \con. If you use ctwill +pdf (and a TeX engine for PDF output), at least you should get "bookmarks" as a table-of-contents.

ascherer avatar Mar 03 '21 18:03 ascherer

In fact, the ctwill executable – just like its sibling cweavedoes create files jobname.idx, jobname.scn, and jobname.toc (replace jobname appropriately). It's just the TeX macros that are not elaborate enough to process these informations at this time. (Personally, I never came around to even learn the usage of ctwill-twinx to generate a “master index” for ctwill.w and common.w.) Feel free to write extensions and submit a pull request.

ascherer avatar Mar 03 '21 18:03 ascherer

Thanks. I got it after looking at the different definitions of those macros. When using ctwill, \con is never defined. It seems to be a strange choice. I can't think of any reason why ctwill should have an harder time building the ToC. I will try to write an extension, as soon as I have time to do that.

joaocortes avatar Mar 03 '21 21:03 joaocortes

You may want to look at CWEB 4.3 dev. The extended pdfctwimac.tex already produces a table-of-contents

  • at the end of the PDF
  • it does not yet cooperate with pdfwebtocfront.tex
  • all page numbers are 0

ascherer avatar Mar 07 '21 16:03 ascherer

Hi again. I am trying to get this solved. I looked into the current version ofpdfctwimac.tex, and it seems it still does not produce a ToC. Did you reference the wrong branch on your last comment?

joaocortes avatar Feb 14 '22 00:02 joaocortes

The current state of affairs is CWEB 4.9 dev and CWEBbin 4.9 dev. Table-of-Contents in CTWILL was not on the top of the list.

ascherer avatar Feb 14 '22 11:02 ascherer