ascherer / cwebbin

Literate Programming in C/C++
https://github.com/ascherer/cweb
MIT License
28 stars 5 forks source link

ctwill and table of contents ToC #45

Open joaocortes opened 3 years ago

joaocortes commented 3 years ago

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?

ascherer commented 3 years ago

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 commented 3 years ago

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.

joaocortes commented 3 years ago

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.

ascherer commented 3 years ago

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

joaocortes commented 2 years ago

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?

ascherer commented 2 years ago

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.