Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ctwill and table of contents ToC #45

Open
joaocortes opened this issue Mar 3, 2021 · 6 comments
Open

ctwill and table of contents ToC #45

joaocortes opened this issue Mar 3, 2021 · 6 comments

Comments

@joaocortes
Copy link

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
Copy link
Owner

ascherer commented Mar 3, 2021

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 ascherer closed this as completed Mar 3, 2021
@ascherer
Copy link
Owner

ascherer commented Mar 3, 2021

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
Copy link
Author

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
Copy link
Owner

ascherer commented Mar 7, 2021

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 ascherer reopened this Mar 7, 2021
@joaocortes
Copy link
Author

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
Copy link
Owner

ascherer commented Feb 14, 2022

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 referenced this issue in ascherer/web May 23, 2024
In this particular example, the code from knuth.drv in connection
with pdfwebtocfront.tex produces the expected page labels in the
resulting PDF.

TODO: Correct page labels without pdfwebtocfront.
TODO: Default setting \contentspagenumber{0}
TODO: Adaption for XeTeX et al.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants