3

I use latex just fine, but was trying to do the exercises in The TEXbook and run it via terminal and it just won't work.

This is happening on two different computers both with macOS Catalina (10.15.6 (19G73)) and MacTEX 2020.

Trying to run \relax, returns this:

 kpathsea: Running mktexfmt TeX.fmt
mktexfmt: mktexfmt is using the following fmtutil.cnf files (in precedence order):
mktexfmt:   /usr/local/texlive/2020basic/texmf-dist/web2c/fmtutil.cnf
mktexfmt: mktexfmt is using the following fmtutil.cnf file for writing changes:
mktexfmt:   /Users/jess/Library/texlive/2020basic/texmf-config/web2c/fmtutil.cnf
mktexfmt [INFO]: writing formats under /Users/jess/Library/texlive/2020basic/texmf-var/web2c
mktexfmt [INFO]: did not find entry for byfmt=TeX, skipped
mktexfmt [INFO]: not selected formats: 16
mktexfmt [INFO]: total formats: 16
mktexfmt [INFO]: exiting with status 0
I can't find the format file `TeX.fmt'!

Of note: On one of the machines, the first time I entered the command TeX, it returned: "This is TeX, Version 3.14159265 (TeX Live 2020) and when I ran \relax, I got the single *. But when I returned to it, the next time it retuned the TeXk (note the k). I cannot find any reference anywhere to what that extra k is or what it means.

I can verify that tex.fmt does indeed exist in the following location: /usr/local/texlive/2020basic/texmf-var/web2c/tex/tex.fmt

I have rebooted, updated my TeX installation, and even removed TeX completely on one machine and downloaded just the basic TeX package. All to no avail. Any guidance or suggestions would be much appreciated.

4
  • Welcome to TeX.StackExchange! When you start tex on the terminal, do you write tex (in lowercase) or TeX (in mixed case)? If you didn't do that before, please try the lowercase version tex. Commented Jul 30, 2020 at 22:11
  • 1
    OMG! That fixed it!!!! Thank you!! Any idea what the texk means (out of curiosity)? (By fixed, I mean, that was clearly what I was doing wrong.) How did you know that??
    – Jessica
    Commented Jul 30, 2020 at 22:14
  • 1
    Great! Only unmodified programs are allowed to be called TeX, so TeXk is used to indicate that there is some extension active. It should tell you which in the log. Look for "Source specials enabled", "%&-line parsing enabled" or "file:line:error style messages enabled" Commented Jul 30, 2020 at 22:21
  • 1
    TeX uses the name you use for calling the program to identify the format to load. (This is e.g. used to allow you to call latex and automatically get latex.fmt loaded) The error message indicates that it didn't know how to build TeX.fmt and you mentioned that tex.fmt exists, so the only reason why it would try to build TeX.fmt was that it has been invoked with that name. Commented Jul 30, 2020 at 22:26

1 Answer 1

6

tl;dr: When calling TeX from the terminal, call tex (in lowercase), not TeX.

Modern TeX engines look at the name the program is called with to identify the default format to load. (E.g. if the program is called tex, plain TeX is loaded, if it is called latex, LaTeX is loaded, etc.) This allows you to call e.g. latex instead of pdftex "&latex". But it has a side-effect: TeX doesn't behave properly if you call it with an unexpected name. E.g. if you rename the program from tex to typeset, calling typeset won't work because TeX would try to use a non-existent typeset format.

Your case is similar. While your operating system is case-insensitive and therefore allows you to call TeX instead of tex, this will lead to confusion because TeX tries to find a format with the literal name TeX, but the default setup assumes that the format is called tex and therefore does not know how to build a TeX format, leading to

mktexfmt [INFO]: did not find entry for byfmt=TeX, skipped

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .