I have a big issue with project compilation. Instead of "concentrating on getting the right content", I've spend several days on getting the project compiled. My project deadline is near, and I would appreciate any help.

I work with Overleaf and I liked its' interface and it is easy to use. I have a big project. I can compile it by parts, but I can't compile the whole project since Overleaf applies compilation time limitation even for paying customers. I tried all suggested tricks, but it didn't help: Fixing and preventing compile timeouts.

I've made an attempt to compile the project locally on my computer (Windows). I installed TeX Live. Again, I can compile the project by parts, but I can't compile the whole project. I receive the following error:

Unable to read an entire line---bufsize=200000.
Please increase buf_size in texmf.cnf.

I tried to increase the buf_size by running on the Windows cmd:

buf_size=100000 pdflatex main.tex

As proposed in this StackExchange thread

But I get an error:

'buf_size' is not recognized as an internal or external command, operable program or batch file.

Then, I changed texmf.cnf file by adding:

main_memory = 7000000

As proposed in this StackExchange thread. But when I run in cmd:

sudo fmtutil-sys --all

I get the following error:

'sudo' is not recognized as an internal or external command, operable program or batch file.

I have no idea how to compile the project. I worked on it for several months. I will appreciate any assistance.

Best regards, Alex.

  • 1
    why does your project need such a large bufsize? Do you externalize large graphics? Jan 28 at 20:55
  • 2
    sudo is a linux command do not use that on windows Jan 28 at 20:58
  • 2
    is your entire file on one line? why do you need an input buffer of anything like that size? Jan 28 at 21:00
  • 1
    just use fmtutil-sys --all (no sudo) but first check your tex coding that you are not in an infinite loop that will use up the buffer however large you make it. Jan 28 at 21:04
  • 1
    you could normally process a document of thousands of pages with an input buffer of a few hundred characters, why are you producing (after expanding commands) 100000 characters on a single line of input ??? Jan 28 at 21:06

1 Answer 1


You can set the buffer size on the commandline

 pdflatex --cnf-line=buf_size=400000 file

would double the default size of 200000 to 400000.

You can check how much of the buffer is being used by checking a line at the end of the log

 35i,5n,50p,1016b,109s stack positions out of 10000i,1000n,20000p,400000b,200000s

it is the b value here this test used 1016 (already a very abnormally large example created by having 1000 x on a single line)

Note this buffer is the buffer for holding a single line of input not for holding the whole file, it needs to be larger than the actual longest line in the source file, but not usually much larger, you have to be doing something unusual to use 200000 characters in the input buffer.

You may have an ininite loop that is filling this buffer no matter how large you make it. If you comment out parts of the document so that it completes you can check each section and check the b value to see which construct is using more than 200000 input buffer characters.

  • Thanks David, it solves the buffer size issue, but now the compilation is stacked with the following message: [323] [324] No file main.ind. (./main.aux ! Text line contains an invalid character. l.1 ^^@ ^^@^^@^^@^^@^^@^^@^^@^^@^^@^^@^^@^^@^^@^^@^^@^^@^^@^^@^^@^^@^^@^^@^^@... ?
    – ab3001
    Jan 29 at 6:16
  • On the other hand it compiled the first 326 pages, and this is a significant progress!
    – ab3001
    Jan 29 at 6:28
  • that is byte 0, ASCII null why have you got nulls in your aux file, but that is easy to fix just delete the aux file Jan 29 at 8:37
  • oh that probably explains the buffer overrun if you have 200,000 null bytes then tex will see that as a single line with 200 thousand characters and over run the buffer. As said in comments under the question fixing the error makes more sense than increasing the buffer size @ab3001 Jan 29 at 8:38
  • David, what are "null bytes" and how to find them? I want to find the error and fix it.
    – ab3001
    Jan 29 at 9:43

You must log in to answer this question.

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