General! text line contains an invalid character

LaTeX specific issues not fitting into one of the other forums of this category.
valtz
Posts: 8
Joined: Mon Apr 23, 2012 5:32 pm

! text line contains an invalid character

Post by valtz »

when i compile there is a message error like this

! text line contains an invalid character.
l.1 ...

my main file is

Code: Select all

\documentclass{report}



\usepackage{graphicx}

\usepackage{amsmath,amssymb,amsthm}



\def\figurename{Gambar}



\newtheorem{theorem}{Teorema}[chapter]

\newtheorem{definition}{Definisi}[chapter]

\newtheorem{lemma}[theorem]{Lema}

\newtheorem{proposition}[theorem]{Proposisi}

\newtheorem{corollary}[theorem]{Akibat}

\newtheorem{example}[theorem]{Contoh}

\def\proofname{Bukti}



\newenvironment{remark}[1][Catatan]{\begin{trivlist}

\item[\hskip \labelsep {\bfseries #1}]}{\end{trivlist}}







\begin{document}



\tableofcontents



\input{BAB1.tex}



\input{BAB2.tex}



\input{BAB3.tex}



\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

! text line contains an invalid character

Post by Stefan Kottwitz »

Hi Valtz,

welcome to the board!

This code doesn't contain the error, I tested it. Of course we don't have the files you loaded by \input. Perhaps post a real minimal example, which brings this error when we compile. Because now we just get the error that BAB1.tex etc. are missing.

Also, you could post your .log file as attachment to a post. Perhaps we will know more if we see this information, such as warnings, complete errors, and the way of compilation.

Stefan
LaTeX.org admin
valtz
Posts: 8
Joined: Mon Apr 23, 2012 5:32 pm

Re: ! text line contains an invalid character

Post by valtz »

here my file bab1.tex bab2.tex and bab3.tex , i attach it

please help me ,

i dont know what wrong ,

cause i'm new with latex
Attachments
BAB3.tex
(14.77 KiB) Downloaded 524 times
BAB2.tex
(1.57 KiB) Downloaded 602 times
BAB1.tex
(21 Bytes) Downloaded 547 times
User avatar
nlct
Posts: 276
Joined: Thu Nov 06, 2008 11:15 am

! text line contains an invalid character

Post by nlct »

valtz wrote: ! text line contains an invalid character.
l.1
The "l.1" means the problem is on line 1. As Stefan said, the log file will give more information, particularly which file is being processed at the time of the error. Maybe the problem is just with one file, or maybe there's a problem with the encoding used by your text editor. Try to create the following example document and see if you get the same error:

Code: Select all

\documentclass{article}
\begin{document}
Sample document.
\end{document}
If that still gives an error, then post your .log file and say what editor/frontend you are using (e.g. TeXWorks, WinEdt, TeXnicCenter)

Regards
Nicola Talbot
valtz
Posts: 8
Joined: Mon Apr 23, 2012 5:32 pm

! text line contains an invalid character

Post by valtz »

nlct wrote:
valtz wrote: ! text line contains an invalid character.
l.1
The "l.1" means the problem is on line 1. As Stefan said, the log file will give more information, particularly which file is being processed at the time of the error. Maybe the problem is just with one file, or maybe there's a problem with the encoding used by your text editor. Try to create the following example document and see if you get the same error:

Code: Select all

\documentclass{article}
\begin{document}
Sample document.
\end{document}
If that still gives an error, then post your .log file and say what editor/frontend you are using (e.g. TeXWorks, WinEdt, TeXnicCenter)

Regards
Nicola Talbot
I'm using WinEdt. The log file is attached. I'm very new to LaTeX :)
Any help is appreciated.
Attachments
INDUK SKRIPSI.log
(4.11 KiB) Downloaded 663 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

! text line contains an invalid character

Post by Stefan Kottwitz »

The .log file seems to be incomplete. It ends:

Code: Select all

\multlinegap=\skip44
\multlinetaggap=\skip45
\mathdisplay@stack=\toks19
LaTeX Info: R
Is the .log file on your disk the same as attached, or was it just an upload failure?

Perhaps check that, post a complete log file, or produce a new logfile with this or another test document.

Stefan
LaTeX.org admin
valtz
Posts: 8
Joined: Mon Apr 23, 2012 5:32 pm

! text line contains an invalid character

Post by valtz »

Stefan_K wrote:The .log file seems to be incomplete. It ends:

Code: Select all

\multlinegap=\skip44
\multlinetaggap=\skip45
\mathdisplay@stack=\toks19
LaTeX Info: R
Is the .log file on your disk the same as attached, or was it just an upload failure?

Perhaps check that, post a complete log file, or produce a new logfile with this or another test document.

Stefan
it is the same file with on my disk the same as attached
log file with another test document is here
but there no problem
Attachments
TES111.log
(2.7 KiB) Downloaded 517 times
INDUK SKRIPSI.log
(4.11 KiB) Downloaded 623 times
valtz
Posts: 8
Joined: Mon Apr 23, 2012 5:32 pm

Re: ! text line contains an invalid character

Post by valtz »

Output captured by WinEdt on Friday, April 27, 2012 at 15:04
------------------------------------------------------------------

WinEdt has successfully executed MiKTeX BibTeX accessory.

If BibTeX encountered and reported errors the resulting bbl file
may not appear properly displayed or in some cases may not be
created at all. For your convenience WinEdt captured output and
error files produced by the BibTeX accessory.

If there are problems (eg. if WinEdt displayed this file) read
this output carefully, fix any offending errors in your documents
and recompile your sources. If you are having troubles locating
and fixing errors please consult the extensive documentation
pertaining to BibTeX in MiKTeX Doc folder.

Hint: WinEdt is almost certainly irrelevant to this situation!

------------------------------------------------------------------

No errors were reported during the execution of .
*** Error File is empty!

*** WinEdt captured the following console output:

This is BibTeX, Version 0.99d (MiKTeX 2.9)
The top-level auxiliary file: INDUK SKRIPSI.aux
I found no \citation commands---while reading file INDUK SKRIPSI.aux
I found no \bibdata command---while reading file INDUK SKRIPSI.aux
I found no \bibstyle command---while reading file INDUK SKRIPSI.aux
(There were 3 error messages)


*** BibTeX produced the following log file "INDUK SKRIPSI.blg":

This is BibTeX, Version 0.99dThe top-level auxiliary file: INDUK SKRIPSI.aux
I found no \citation commands---while reading file INDUK SKRIPSI.aux
I found no \bibdata command---while reading file INDUK SKRIPSI.aux
I found no \bibstyle command---while reading file INDUK SKRIPSI.aux
(There were 3 error messages)


this is a log show in my winedt
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Re: ! text line contains an invalid character

Post by Stefan Kottwitz »

A truncated .log file can be a sign that there's a package missing and the compiler tries dowload and installation on the fly. Check each of your used packages in the problem document, if it is installed. If not, install it, using the MiKTeX package manager.

Furthermore, open the MiKTeX Maintenance or Settings/Options via the start menu, and choose either Yes or No (but not "Ask me first") for the option "Install missing packages on-the-fly".

Stefan
LaTeX.org admin
Mabolaya
Posts: 4
Joined: Fri Apr 20, 2012 9:44 am

Re: ! text line contains an invalid character

Post by Mabolaya »

I solved the problem by saving the file with a different name and the problem was gone. Just go to:
1) File>Save as>
Post Reply