31

For no particular reason that I could identify, I was faced with the impossibility to compile any latex document and invariably got this error message each time I tried :

LaTeX: problems after [0] pages

kpathsea: Running mktexfmt pdflatex.fmt
tcfmgr: config file `tcfmgr.map' (usually in $TEXMFMAIN/texconfig) not found.
I can't find the format file `pdflatex.fmt'!
Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
M. Toya
  • 3,227
  • For me I simply had to copy the .fmt file into the directory the PHP file was calling it from. It worked fine from a terminal but gave the error when running via PHP. – Alan Feb 17 '15 at 15:53

8 Answers8

16

I thought I would post this here because it gave me some cold sweats as I could not make any sense of the error message and have only two months remaining to write my thesis.

In a terminal, just type

sudo texconfig rehash

which should give

mktexlsr: Updating /var/lib/texmf/ls-R-TEXMFMAIN...
mktexlsr: Updating /var/lib/texmf/ls-R-TEXLIVE...
mktexlsr: Updating /var/lib/texmf/ls-R...
mktexlsr: Done.

This solution was found on this website.

darthbith
  • 7,384
M. Toya
  • 3,227
3

I had this problem and none of the sites I visited helped. This is for linux. I was installing on a semi-incomplete backed-up image of a previous computer. My problem turned out to be the pre-existing config files in /etc/texmf/updmap.d

This is what I did:

  1. Remove all tex packages: sudo apt-get remove texlive*

  2. PURGE all tex packages: sudo apt-get purge texlive*

  3. Delete everything in /etc/texmf/updmap.d

  4. Re-install desired tex packages: sudo apt-get install texlive etc

It now seems to work fine.

Phil

M. Toya
  • 3,227
Phil
  • 39
2

Check whether the file is in your TeX search path.

kpsewhich pdflatex.ini

If the result is empty, then add path to TEXINPUTS, e.g. put into .bash_profile

export TEXINPUTS=.:/opt/tex/cur/texmf-dist/tex/latex/latexconfig/

UPD. If this doesn't help with other paths, it means that your installation is corrupt. To reisntall would be better in that case (I'm doing that at the moment).

  • 1
    Nuking and re-installing a 5GB piece of software, that took over 120 minutes of full tilt CPU, is a bit of an upsell for such a weak kind of error, I think the better solution as this point is to > /dev/null this pdflatex kaynine excrement. Problem solved! – Eric Leschinski Oct 28 '19 at 17:34
  • 1
    This is it. On my system the pdflatex.ini was missing. So e.g. on Archlinux: pacman -F pdflatex.ini to find that the package to provide the file is texlive-latex and then install it. – Hi-Angel Oct 30 '23 at 09:24
1

If this can be of any help it happened the same to me and I realized that, since the last time I had opened Texmaker, I had installed Anaconda. It turns out that Anaconda had installed a texlive-core package, which was conflicting with my original texlive installation. I just had to remove the anaconda package through:

conda remove texlive-core

and it worked. None of the previous solutions worked for me for obvious reasons.

0

I solved the same problem in openSUSE Tumbleweed with re-installing texlive via

 zypper remove texlive*
 zypper install texlive
Zarko
  • 296,517
umich
  • 11
  • 1
    This doesn't work if recommended packages are not set to be installed as well. – ytg Dec 22 '17 at 15:34
0

This fixed the issue for me

sudo dpkg --configure -a
sudo apt install texlive
hhh
  • 8,743
0

On Arch Linux, I fixed the issue by installing all of texlive-* packages:

pacman -Ssq texlive-* | sudo pacman -S -
ahmelq
  • 125
  • 4
0

I had to install:

sudo pacman -S extra/texlive-latex extra/texlive-latexextra extra/texlive-plaingeneric

For exporting org-mode files as PDF.

trxgnyp1
  • 101