I used TeX a lot in the past and I am just about to start using it again. I got the TeXLive 2008 CD and installed it but I can't get it to work. The error message from a minimal plain TeX compilation is
kpathsea: Running mktexfmt tex.fmt
I can't find the format file `tex.fmt'!
It looks like a problem with the path. I've searched the FAQ and this forum but I can't find anything useful. Is there an obvious solution or shall I set out all the things I've tried and what happened?
TeX Live and MacTeX ⇒ error: 'can't find the format file tex.fmt'
NEW: TikZ book now 40% off at Amazon.com for a short time.

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
error: 'can't find the format file tex.fmt'
Obviously something went wrong during the installation process. Unfortunately you didn't give information about your operating system. Independent from that you should open a command prompt (shell, terminal) with administrator rights and try to build the format files subsequently.
This will rebuild all format files. After that try a new compilation.
Best regards and welcome tot he board
Thorsten
Code: Select all
fmtutil-sys --all
Best regards and welcome tot he board
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: error: 'can't find the format file tex.fmt'
Thanks for the welcome. I should have said a bit more. I am running Debian Lenny. I have used tetex before but this time I installed from the CD. The installation seemed to go well and I chose all the defaults. The format file tex.fmt exists in
/usr/local/texlive/2008/texmf-var/web2c/tex/tex.fmt
along with all the other formats so when it says it can't find the file it is not because the file isn't there it is because it (kpathsea) is not looking in the right place. I created a link to the file in my home directory and there was then no error message about the format file but it couldn't find cmr12.tfm and again the tfm files are all there in the right place. So it is a path problem. My path is
/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/local/texlive/2008/bin/i386-linux:.:/home/solon/bin:/sbin:/usr/sbin
and I own the tree /usr/local/texlive. Is that ok? I'd like to track what kpathsea is doing; is there a way of doing that? Also I'd like to know where the format file error message comes from; I've searched but not found it.
Tony Sumner
/usr/local/texlive/2008/texmf-var/web2c/tex/tex.fmt
along with all the other formats so when it says it can't find the file it is not because the file isn't there it is because it (kpathsea) is not looking in the right place. I created a link to the file in my home directory and there was then no error message about the format file but it couldn't find cmr12.tfm and again the tfm files are all there in the right place. So it is a path problem. My path is
/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/local/texlive/2008/bin/i386-linux:.:/home/solon/bin:/sbin:/usr/sbin
and I own the tree /usr/local/texlive. Is that ok? I'd like to track what kpathsea is doing; is there a way of doing that? Also I'd like to know where the format file error message comes from; I've searched but not found it.
Tony Sumner
Re: error: 'can't find the format file tex.fmt'
There are debug options in kpathsea but in the end I didn't need them. After I installed TeXLive I had set an environment variable TEXMF to /usr/local/texlive/2008/texmf, just for convenience and to save typing. This didn't conflict with any of the environment variables listed in the installation instructions, eg TEXMFHOME=~/texmf, but I found later, in section 8.2.1 of The TeX Live Guide, that TEXMF is the default kpathsea search path so it is not as innocent as I thought. When I unset TEXMF in ~/.tcshrc then kpathsea is able to find the format file tex.fmt and tex now compiles story.tex, creates the tfm files and gives me story.dvi with no error. I have still something to learn about how kpathsea works but the problem I started with is now solved. I hope this helps someone.