$ tex --version | head -n2
TeX 3.14159265 (TeX Live 2019/Debian)
kpathsea version 6.3.1
$ lsb_release -a | head -n3
Distributor ID: Ubuntu
Description: Ubuntu 20.04.6 LTS
The values from ~/Downloads/noweb/src/Makefile to install noweb
on Ubuntu 20.04.6 LTS with TeX 3.14159265 (TeX Live 2019/Debian)
BIN=/usr/local/bin/
LIB=/usr/local/lib/
MAN=/usr/local/share/man/
MANEXT=1
MAN7EXT=7
TEXINPUTS=/usr/share/texlive/texmf-dist/tex/latex/
ELISP=/dev/null
To compile its documentation (weave):
noweave test.nw > test.tex
pdflatex test.tex
evince test.pdf
To compile its “code” (tangle):
notangle test.nw > test.txt
cat test.txt
Here is a test.nw
program that I wrote:
% a test program in noweb
% comments get ignored
<<*>>=
This bit of is "the program".
For the purpose of this test, we'll just write plaintext.
Here are some common terms, imported via macros:
<<foo>>
<<bar>>
@
This is the other ``side'' of the literate program.
It is going to get compiled in to via \texttt{pdflatex}.
\[ e^{i \pi} + 1 = 0 \]
<<foo>>=
This line says foo.
@
This chunk documents foo.
[[ And this is some code that I need interleaved with the documentation.]]
You can do math here: $1 + 1 = 2$.
<<bar>>=
And this line says bar.
@
And this documents bar.
[[
You can put quoted code on multiple lines.
]]
Published: Aug 15, 2024
Last Modified: Aug 23, 2024
Thanks for reading! If you have any comments or questions about the content, please let me know. Anyone can contact me by email.