Generalstrange build error

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

strange build error

Post by yotama9 »

Hi.

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

Code: Select all

! Text line contains an invalid character.
l.2 

A funny symbol that I can't read has just been input.
Continue, and I'll forget that it ever happened.
here is the beginning of the document:

Code: Select all

\documentclass[titlepage]{report}
\usepackage{amsmath}
on texwork I get:

Code: Select all

! Text line contains an invalid character.
l.2 
what's going on?

Thanks.

Yotam

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

strange build error

Post by localghost »

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
yotama9
Posts: 61
Joined: Thu Sep 24, 2009 2:59 pm

strange build error

Post by yotama9 »

I created hello world! file and it worked just fine:

Code: Select all

\documentclass[titlepage]{report}
\usepackage{amsmath}
\begin{document}
hello world!
\end{document}
yotama9
Posts: 61
Joined: Thu Sep 24, 2009 2:59 pm

Re: strange build error

Post by yotama9 »

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.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

strange build error

Post by localghost »

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.
yotama9
Posts: 61
Joined: Thu Sep 24, 2009 2:59 pm

Re: strange build error

Post by yotama9 »

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
(44 Bytes) Downloaded 397 times
vezous
Posts: 1
Joined: Mon Jul 02, 2012 9:24 pm

Re: strange build error

Post by vezous »

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

Re: strange build error

Post by NeilPhan »

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

Re: strange build error

Post by josephwright »

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
Post Reply