Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Text line contains an invalid character

4,338 views
Skip to first unread message

Geoff

unread,
Sep 1, 2010, 3:52:07 PM9/1/10
to
I seem to be getting a repeating problem that is driving me nuts. I do
pdflatex of my document and sometimes it stops due to some error on my
part. So I kill the job. I correct the error and run the process
again. Now it just says:

Text line contains an invalid character l.1

I can't seem to get out of this loop. Sometimes it works when I simply
add

\begin{document}\end{document}

directly after the documentclass, (the behaviour happens both with
article and beamer) and then comment this out.

Any ideas?

Thanks in advance,
Geoff

Heiko Oberdiek

unread,
Sep 1, 2010, 4:04:39 PM9/1/10
to
Geoff <geoff...@yahoo.co.uk> wrote:

> I seem to be getting a repeating problem that is driving me nuts. I do
> pdflatex of my document and sometimes it stops due to some error on my
> part. So I kill the job. I correct the error and run the process
> again. Now it just says:
>
> Text line contains an invalid character l.1

Check your .log file in order to get the current filename.
Then open the file in a hex editor and inspect the first line
for unusual characters. In plain TeX and LaTeX usually
the character with code 0 has catcode 9 (invalid).

--
Heiko Oberdiek

Heiko Oberdiek

unread,
Sep 1, 2010, 4:12:39 PM9/1/10
to
Geoff <geoff...@yahoo.co.uk> wrote:

> I seem to be getting a repeating problem that is driving me nuts. I do
> pdflatex of my document and sometimes it stops due to some error on my
> part. So I kill the job. I correct the error and run the process
> again. Now it just says:
>
> Text line contains an invalid character l.1

Check your .log file in order to get the current filename.


Then open the file in a hex editor and inspect the first line

for unusual characters. The catcode for invalid is 15.
LaTeX uses this catcode for most of the control
characters:
0x00 (0) -- 0x08 (8),
0x0B (11),
0x0E (14) -- 0x1F (31),
0x7F (127)

(PS: please ignore the previous cancelled posting)
--
Heiko Oberdiek

Peter Flynn

unread,
Sep 1, 2010, 5:27:47 PM9/1/10
to

Open the file in an editor that shows you EVERY byte in the file, for
good or bad (eg Emacs). Some editors hide characters they consider you
ought not see, without realising that this prevents debugging.

///Peter

Robert Heller

unread,
Sep 1, 2010, 6:00:53 PM9/1/10
to

Are you using a UNICODE editor? Or (shudder) MS-Word as a text editor?

TeX/LaTeX really only handle 7-bit ASCII characters. Maybe newer
versions of TeX/LaTeX might handle selected UNICODE characters.

>
> Thanks in advance,
> Geoff
>

--
Robert Heller -- 978-544-6933
Deepwoods Software -- Download the Model Railroad System
http://www.deepsoft.com/ -- Binaries for Linux and MS-Windows
hel...@deepsoft.com -- http://www.deepsoft.com/ModelRailroadSystem/

Ulrike Fischer

unread,
Sep 2, 2010, 3:21:28 AM9/2/10
to
Am Wed, 1 Sep 2010 12:52:07 -0700 (PDT) schrieb Geoff:

> I seem to be getting a repeating problem that is driving me nuts. I do
> pdflatex of my document and sometimes it stops due to some error on my
> part. So I kill the job. I correct the error and run the process
> again. Now it just says:
>
> Text line contains an invalid character l.1

How do you "kill the job"? Are you using the TeX input "x" or are
you closing some window or using ctrl+q or ctrl+z?

--
Ulrike Fischer

james...@gmail.com

unread,
Jan 15, 2014, 4:39:39 PM1/15/14
to
To fix this problem I copied the latex code to WordPad and then copied the text from WordPad back to latex. Weird. But it worked for me.
0 new messages