## LaTeX forum ⇒ General ⇒ strange build error

LaTeX specific issues not fitting into one of the other forums of this category.
yotama9
Posts: 61
Joined: Thu Sep 24, 2009 2:59 pm

### strange build error

Hi.

I can't compile my latex document. On texmaker I get 100 error of the following type:

1. ! Text line contains an invalid character.
2. l.2
3.
4. A funny symbol that I can't read has just been input.
5. Continue, and I'll forget that it ever happened.

here is the beginning of the document:

1. \documentclass[titlepage]{report}
2. \usepackage{amsmath}

on texwork I get:
1. ! Text line contains an invalid character.
2. l.2

what's going on?

Thanks.

Yotam

localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm
Create a new file with these two lines and a minimal document. Do not copy them but type them new and try again.

Best regards
Thorsten
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

yotama9
Posts: 61
Joined: Thu Sep 24, 2009 2:59 pm
I created hello world! file and it worked just fine:

1. \documentclass[titlepage]{report}
2. \usepackage{amsmath}
3. \begin{document}
4. hello world!
5. \end{document}

yotama9
Posts: 61
Joined: Thu Sep 24, 2009 2:59 pm
I created a new document and copied all my thesis there apart from the \usepakcage{}s. I add all the packages manually and latex would work fine. I then removed all the openning text from the first document including the first paragraph and tried. I got the expected error of now \begin{document}. When I copied the relevant part from the new document I got the same error.

localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm
Reduce the problem to a minimal working example (MWE) to make it comprehensible. Perhaps there is an invisible character (or more) in your code. Put all the files together in an archive and attach it to your next post.
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

yotama9
Posts: 61
Joined: Thu Sep 24, 2009 2:59 pm
I copied the file and the copy is fine.

Also, I edited the file to include the following:

\begin{document}
hello world!
\end{document}

and I get the same error. I have attached the file.
Attachments
thesis.tex

vezous
Posts: 1
Joined: Mon Jul 02, 2012 9:24 pm
I checked the document for bad characters (I sometimes turn my keyboard to cyrilic while falling asleep above the keyboard) and there was none, still this error was there.

It helped me to delete all the files produced during compiling (*.aux, *.log, *.gz, *.toc).

NeilPhan
Posts: 1
Joined: Thu Aug 16, 2012 6:46 pm
I found the reason why that happened.
You just copy the entire document in Latex to a new document and compile again.
It normally happens when I copy some texts from Microsoft Word to Latex. Maybe Microsoft Word text has some invisible crazy characters.

josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm
Which editor are you using? Some add a 'byte order marker' at the start of files, and this will confuse TeX as it does not recognise this concept.
Joseph Wright