NUWEB(1)
π NAME π
This is the NUWEB(1) page from the General Commands Manual, and itβs all about Nuweb, a literate programming tool. Thatβs the name, bestie β slay. β¨
π¦ SYNOPSIS π¦
nuweb
nuweb [options] [file] ...
π₯ DESCRIPTION π₯
Okay so Nuweb is a literate programming tool like Knuthβs WEB, only simpler. A nuweb file contains program source code interleaved with documentation.
When nuweb is given a nuweb file, it writes the program file(s), and also produces LaTeX source for typeset documentation. Iconic. π
π COMMAND LINE OPTIONS π
Bestie, here are the command-line flags, one by one, no skipping:
-tβ suppresses generation of the{t .tex}file.-oβ suppresses generation of the output files.-dβ list dangling identifier references in indexes.-cβ forces output files to overwrite old files of the same name without comparing for equality first.-vβ the verbose flag. Forces output of progress reports.-nβ forces sequential numbering of scraps (instead of page numbers).-sβ doesnβt print the list of scraps making up the file at the end of each scrap.-ppath β prepend path to the filenames for all the output files.-Vstring β provide the string for replacement of the@voperation. This is intended as a means for including version information in generated output.-xβ include cross-references in comments in output files.-hoptions β turn on hyperlinks using thehyperrefpackage of LaTeX and provide the options to the package.-rβ turn on hyperlinks using thehyperrefpackage of LaTeX, with the package options being in the text.-Ipath β provide a directory to search for included files. This may appear several times.
π¦ FORMAT OF NUWEB FILES π¦
A nuweb file contains mostly ordinary LaTeX. The file is read and copied to output (.tex file) unless a nuweb command is encountered. All nuweb commands start with an βat-signβ (@). Files and fragments are defined with the following commands:
@o file-name flags scrapβ where scrap is smaller than one page.@O file-name flags scrapβ where scrap is bigger than one page.@d fragment-name scrap.β where scrap is smallar than one page.@D fragment-name scrap.β where scrap is bigger than one page.@q fragment-name scrap.β where scrap is smallar than one page. The scrap is not expanded in the output, allowing you to construct output files which can, perhaps after further processing, be input to nuweb.@Q fragment-name scrap.β where scrap is bigger than one page. Likewise.
Scraps have specific begin and end markers; which begin and end marker you use determines how the scrap will be typeset in the .tex file:
@{...@}β verbatim βterminal styleβ formatting or, with the-lflag, LaTeX listing package.@[...@]β LaTeX paragraph mode formatting.@(...@)β LaTeX math mode formmating (yes, that spelling is in the original, keeping it π ).
Any amount of whitespace (including carriage returns) may appear between a name and the begining of a scrap β and yes, the original really says βbegining.β π«Ά
Several code/file scraps may have the same name; nuweb concatenates their definitions to produce a single scrap. Code scrap definitions are like macro definitions; nuweb extracts a program by expanding one scrap. The definition of that scrap contains references to other scraps, which are themselves expanded, and so on. Nuwebβs output is readable; it preserves the indentation of expanded scraps with respect to the scraps in which they appear. No cap. π₯
πΈ PER FILE OPTIONS πΈ
When defining an output file, the programmer has the option of using flags to control the output:
-doption β Nuweb will emit line number indications at scrap boundaries.-ioption β Nuweb supresses the indentation of fragments (useful for Fortran).-toption β makes nuweb copy tabs untouched from input to output.-cxβ include comments in the output file.xmay becfor C-style comments,+for C++ andpfor perl and similar.
π MINOR COMMANDS π
These are the little side-quest commands:
@@β causes a single βat-signβ to be copied into the output.@_β causes the text between it and the next{t @_}to be made bold (for keywords, etc.) in the formatted document. (Yes,{t @_}is literally what the original says. π)@%β comments out a line so that it doesnβt appear in the output.@ifilename β causes the file named to be included.@fβ creates an index of output files.@mβ creates an index of fragments.@uβ creates an index of user-specified identifiers.
To mark an identifier for inclusion in the index, it must be mentioned at the end of the scrap it was defined in. The line starts with @| and ends with the end of scrap mark @}. Periodt. π«Ά
π ERROR MESSAGES π
The original page has this heading but literally zero content under it β no error messages listed. Not me staring at an empty section. π
π BUGS π
Same energy: the heading is here, but the original lists no bugs. π
π AUTHOR π
Preston Briggs. Internet address preston@cs.rice.edu.
π MAINTAINER π
- Simon Wright β Internet address
simon@pushface.org - Keith Harwood β Internet address
Keith.Harwood@vitalmis.com
okay bye bestie β this is the NUWEB(1) manual, and the footer says local, dated 3/22/95. π
ππ«Ά
π¦ where this page comes from
- nixos 26.05: nuweb 1.62
- nixpkgs unstable: nuweb 1.64
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms