TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a LaTeX document that was compiling fine until this evening. I was playing around with synctex and latexmk when I noticed the error, but I'm not sure what is causing it.

There are over 100 of the following errors when pdflatex gives up:

! Text line contains an invalid character.
l.18 ...^^@^^@^^@^^@^^@^^@^^@^^@^^@^^@^^@^^@^^@^^@

Wasn't sure what those were. I noticed line 18 was blank in TextMate. But in Editra, I see that it is full of NULL characters.

Weirdest thing I've seen. Plus, I can't delete these characters. Anyone know where to start debugging?

share|improve this question

closed as too localized by Paul Gaborit, Thorsten, Claudio Fiandrino, Stefan Kottwitz Dec 5 '12 at 13:21

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

I've suggested closing this question as it seems like a very localised and particular problem that is unlikely to arise for others. – Alan Munn Mar 5 '11 at 2:58
@Alan: That is fair. Is closing the same as deleting? One thing I did notice is that ^^@ wasn't showing anything useful in my Google searches, so identifying that as the NULL character might be helpful to those who doesn't know. – jrhorn424 Mar 5 '11 at 18:09
Closing keeps the question visible. However just accepting your answer (in a day) should (imo) be good enough. – Caramdir Mar 5 '11 at 18:20
No, closed questions don't get deleted unless they are exact duplicates of other questions, which isn't the case here. So the question will remain if it is in fact closed. (Also enough people have to vote to close it.) – Alan Munn Mar 5 '11 at 18:26
Possible duplicate of (or related in some way to) Compiler gives hundreds of "invalid character" suddenly Can they be linked somehow? – JLDiaz Dec 5 '12 at 10:10
up vote 7 down vote accepted

The reason it was only affecting this file is because I had run latexmk -pvc and backgrounded the process. When it hit an error, I wasn't notified, but the shell exited with "a broken pipe", or so Growl told me.

Once I killed the processes that were continuously running in the background, constantly recompiling the document, the null characters disappeared from the aux file and the document compiled correctly.

I feel like such a doofus. I definitely won't be making this mistake again.

share|improve this answer
It's great that you posted this answer. Can you please also accept it so that the system knows that the problem is solved? – Hendrik Vogt Mar 5 '11 at 8:35
@Hendrik I will accept it. SX is telling me I have to wait one more day, first. :) – jrhorn424 Mar 5 '11 at 18:08
Oh my, only now I got it fully: The system won't let you if you don't wait 48 hours first. Thanks for letting me know. – Hendrik Vogt Mar 6 '11 at 17:04

Not the answer you're looking for? Browse other questions tagged or ask your own question.