What is the best way to read CWEB code on Windows?

Donald Knuth has a large number of reading programs on his page. But they are mostly in the "weird" CWEB format ...

What could be the best way to make them readable on Windows?

+4
source share
2 answers

Less than five minutes of Googling brings this: http://www.literateprogramming.com/cweb_download.html

+5
source

The best way for me to read the CWEB program is to run cweave ( manpage ) on the .w source file to create the .tex file, and then run pdfetex to get good PDF hyperlinks. Clearly:

  `.W SOURCE ----(cweave)----> .TEX ----(pdfetex)----> PDF` 

As you know, the structure of the CWEB program is itself a hyperlink (with sections related to other sections). A good, linked PDF file is just a pleasure to read, especially if the programs were written by don Knut himself!

The following setup will require some effort on your part (and MB downloads), but I hope you enjoy the end result:

  • Install Cygwin (for any serious Windows programmer, I think installing cygwin is easy). Make sure you install the bundle bundle package (tex, pdfetex, amstex and all that). If cygwin gives you the option to install CWEB, do it too.
  • If you do not get cweave and ctangle with cygwin, download the sources and create / install them.

After installing cygwin and cweb, follow these steps for any .w program that you want to learn (I take the bdd12.w example):

  • Run cweave as follows: cweave bdd12.w This should generate the bdd12.tex file.
  • Then run pdfetex as follows: pdfetex bdd12.tex This should help you get a detailed PDF file with cross-reference. The generated PDF also has a character index at the end (and some other cross-reference data), so you can quickly jump to their definitions.
+4
source

Source: https://habr.com/ru/post/1286237/


All Articles