[Tex/LaTex] Compiler gives hundreds of “invalid character” suddenly

compilingerrors

I am writing my latex document in TexMaker and suddenly in one of the thousands of compilations I make there is a error and I cant get rid of it. The error is:

! Text line contains an invalid character.

The "funny" thing is that the error is in line 2, where I haven't changed anything for weeks and it turn out that there are 100 errors like this in the compilation, each of them with 1 more invalid character. Starts with one and then every error gives +1 character more to the string. Weird.

Has anyone had this error before? It is clear that the error is not because of the invalid character, it doesn't exist! Any ideas?

Best Answer

The following comes from the .log file you reported:

("C:\Documents and Settings\ander.biguri\Escritorio\Memoria\LaTeX\Memoria.aux"
! Text line contains an invalid character.
l.2 ! Text line contains an invalid character.

This means that the invalid character is found in the .aux file. Remove the file and retry.

Errors during a compilation may, sometimes, cause a corruption of the .aux file that is rewritten each time. The removal is a safe operation, which has the only consequence that some more LaTeX runs are needed for synchronizing cross references.