[OS X TeX] Re: Reading The TeXbook terminal in hand

David Watson dewatson at me.com
Wed Jun 6 12:28:08 EDT 2012

On Jun 6, 2012, at 8:50 AM, Alain Schremmer wrote:

> On Jun 5, 2012, at 9:37 AM, Alain Schremmer wrote:
>>> 	terminal:
>>> kpathsea: Running mktexfmt TeX.fmt
>>> I can't find the format file `TeX.fmt'!
>>> MacAlain:~ gpadnom$
> When I (finally) thought of looking for TeX.fmt myself, I found it here:
> Macintosh HD > usr > local > texlive > 2011 > texmf-var > web2c > tex > tex.fmt
> Since I sure did not put it there myself, why can't terminal find it?
> gpadnom is the name under which I am known by computer MacAlain
> Since I would really like to read the TeXbook, I would appreciate it very much if someone would help me help terminal find tex.fmt

If you are trying to locate a file named "tex.fmt" in the terminal, you could always use "find", e.g.

    find / -name "tex.fmt"

or even better, since you seem to be aware that it should live in "/usr/local/texlive" somewhere,

    find /usr/local/texlive -name "tex.fmt"

Even if you were stymied with because you couldn't find TeX.fmt, you could still find all of the format files with

    find /usr/local/texlive -name "*.fmt"

On the other hand, if you know exactly where the format files are, and by "help terminal find tex.fmt" you mean "make sure a tex executable is in my PATH" you could start by looking on your own, e.g.

    which tex

or even better

    which -a tex

if you are the type of person who may have used Fink or MacPorts at some point.

If you really didn't have a tex executable in your path, the "which" command would not return any results and you would be forced to use the "find" command to locate your tex executable.

Here's where the real fun begins, though.
If you are on a case-insensitive file system, which I expect most Mac users are by default, the "which" command and any executable file in your PATH will be found no matter whether you use upper- or lowercase the name of the executable.
Go ahead and try it, e.g.

    open .
    oPeN .

will both open up a Finder window rooted in your current directory.

However, the "find" command will simply not return any results if the file name matching pattern doesn't match the case exactly.

Now, getting back to "TeX".
If you examine the manual page for "tex" (not "TeX"), you will find that there is an option to specify the format file to be used (i.e. "-f tex.fmt").
The manual indicates that in absence of this option on the command line, it will use the format which corresponds to the "the name by which TeX was called or a %& line".

Since you called "tex" by the name "TeX", it will look for "TeX.fmt" in the usual places, but it won't "find" it, because apparently the tex executable is using a system call which is case-sensitive, like the "find" command.

Hence your confusion.

More information about the MacOSX-TeX mailing list