[tex-k] CTANGLE cannot find file if CWEBINPUTS environment variable is set

Andreas Scherer andreas_tex at freenet.de
Sat Jun 6 15:36:13 CEST 2020

Hi, Igor,

>> What is the output of 'pwd' in this situation?
> For example, /home/user

I believe now to understand your situation:

(a) In /home/user/cweb -- where you direct the CWEBINPUTS envvar in your
first post -- is the CWEB system/source;

(b) your current working directory is /home/user, and here your prog.w
file is also located;

(c) you export the CWEBINPUTS envvar and run ctangle on prog.w.

> Check ctangle from ftp://ftp.cs.stanford.edu/pub/cweb/cweb.tar.gz on
> the attachments. It works flawlessly. But ctangle from TL fails.

Well, they work differently. ;o)

If you read the original cwebman.tex (for example, by invoking 'texdoc
cwebman'; sic!), you expect that ctangle looks at the (single!) path in
CWEBINPUTS for input file _in_addition_to_ the local (current)
directory.  For the 'original' ctangle (and cweave as well) this is
indeed correct, so 'ctangle prog' succeeds.

However, if you use the TL ctangle (or cweave or ctwill), you're well
advised to read the associated manpage with 'man ctangle'.  There you'll

(1) CWEB in TL extends the usage of CWEBINPUTS to "several,
colon-separated, paths" (see "DIFFERENCES TO ORIGINAL CWEB");

(2) and "See tex(1) -- i.e., 'man tex' -- for the details of the
searching" (see "ENVIRONMENT");

(3) there, for the TEXINPUTS variable (TeX's equivalent for CWEB's
CWEBINPUTS), you learn that "[t]his [should] probably start with '.', so
that user files are found before system files.

So, in order to resolve your issue, you should

$ export CWEBINPUTS=.:/home/user/cweb

or, as you're in /home/user anyway, better


using the advanced search capabilities of any Kpathsea-enabled program.

Hope this helps,

More information about the tex-k mailing list.