LaTeX.org

LaTeX forum ⇒ Texmaker and TeXstudio ⇒ ! LaTeX Error: Can be used only in preamble.

Information and discussion about Texmaker, an integrated LaTeX environment for several platforms , and the related TeXstudio

2 posts • Page 1 of 1 Lybrial Posts: 1 Joined: Thu Oct 06, 2011 7:54 pm

! LaTeX Error: Can be used only in preamble.

Post by Lybrial » Thu Oct 06, 2011 7:58 pm

i use the newest TexMaker Version on a Windows 7 PC with
MikTex 2.9. However, i tried to compile a little Script today
but it didnt work.

! LaTeX Error: Can be used only in preamble. was the Error Message
and he explains about that some packages are not installed.
MikTex PackageManager says that all Packages are installed.

Maybe a Fail of TexMaker?
Someone a idea?

Recommended reading 2024:

LaTeX Beginner LaTeX Cookbook LaTeX TikZ graphics

Stefan Kottwitz Site Admin Posts: 10209 Joined: Mon Mar 10, 2008 9:44 pm

! LaTeX Error: Can be used only in preamble.

Post by Stefan Kottwitz » Thu Oct 06, 2011 9:17 pm

Lybrial wrote: i tried to compile a little Script today
but it didnt work.

why don't you show us the little code? So we would not have to guess what you are doing.

Lybrial wrote: ! LaTeX Error: Can be used only in preamble. was the Error Message

That means you used a command after \begin which can be used only before, such as \usepackage for example.

Lybrial wrote: and he explains about that some packages are not installed.

Which packages? For which commands in your code?

Lybrial wrote: MikTex PackageManager says that all Packages are installed.

How does it say it? What's the message? I doubt MiKTeX knows about all packages in general.

Lybrial wrote: Maybe a Fail of TexMaker?

I guess it's not a problem of Texmaker. Texmaker is just an editor, which calls the LaTeX compiler of MiKTeX.

Perhaps provide some information.