6

When compiling a latex document with 15 or so packages and about five includes, pdflatex throws a "too many open files"-error. All includes are ended with \endinput. Any ideas what might cause the error?

The error seems to depend on how many packages are used (no surprise...); however, this is not the first time I use this many packages, while I've never encountered such an error before.

@axel_c: This is not about linux. As you may or may not know, LaTeX is also available on windows (which just happens to be what I'm using right now).

Martijn
  • 5,471
  • 4
  • 37
  • 50

4 Answers4

11

Try inserting

\let\mypdfximage\pdfximage
\def\pdfximage{\immediate\mypdfximage}

before \documentclass.

See also these threads from the pdftex mailing list:

rcs
  • 67,191
  • 22
  • 172
  • 153
3

Type

ulimit -n

to get the maximum number of open files. To change it to e.g. 2048, type

ulimit -S -n 2048
pfnuesel
  • 14,093
  • 14
  • 58
  • 71
1

What is this command giving you:

$ ulimit -n

You might want to increase it by editing /etc/security/limits.conf file.

Pablo Santa Cruz
  • 176,835
  • 32
  • 241
  • 292
0

This could be caused by a low value in your 'max open file descriptors' kernel configuration. Assuming you're using Linux, you can run this command to find out current limit:

cat /proc/sys/fs/file-max 

If the limit is low (say, 1024 or so, which is the default in some Linux distros), you could try raising it by editing /etc/sysctl.conf:

  fs.file-max = 65536

Details may differ depending on your Linux distribution, but a quick google search will let you fix it easily.

axel_c
  • 6,557
  • 2
  • 28
  • 41