## LaTeX forum ⇒ Conversion Tools ⇒ compiling tex file

Information and discussion about output converters related to LaTeX (e.g. dvips, ps2pdf, ...)
kentman234
Posts: 8
Joined: Wed Dec 09, 2015 11:40 pm

### compiling tex file

Hello I've just installed Texmaker, and i'm totally new to it.

I tried to compile a prepared tex file that I have but it simply didn't do anything. I have tried all levels of compiling:DVI,Ps, PDF..

Can you give me an advice please? Thank you.

Tags:

kentman234
Posts: 8
Joined: Wed Dec 09, 2015 11:40 pm
I found that when i try to compile it to PDF, it shows file not found! Other tex files worked peoperly..but still i can't believe the file doesn't exist because it does exist.

Johannes_B
Site Moderator
Posts: 4168
Joined: Thu Nov 01, 2012 4:08 pm
Have you installed a TeX distribution like TeX Live or MikTeX?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Stefan Kottwitz
Posts: 9586
Joined: Mon Mar 10, 2008 9:44 pm
Welcome to the forum!

Just try to give us more information. Do you get another error message? Is there a file produced in your folder with the file name extension .log? If yes, please post it here as attachment.

I think, the PDF file for viewing cannot be found, because there's a error in the LaTeX syntax so there's no file produced.

Stefan

kentman234
Posts: 8
Joined: Wed Dec 09, 2015 11:40 pm
The error message I get is: Cannot execute command: pdflatex.exe -synctex=1 -interaction=nonstopmode '***'.tex

Stefan Kottwitz
Posts: 9586
Joined: Mon Mar 10, 2008 9:44 pm
As the pdflatex command doesn't work, you don't have TeX installed (or not properly). This happens if one installed simply an editor but not TeX itself.

Stefan

kentman234
Posts: 8
Joined: Wed Dec 09, 2015 11:40 pm
So tell me what can I do in this case?

kentman234
Posts: 8
Joined: Wed Dec 09, 2015 11:40 pm
Ok, I installed Mikitex and it works fine now. I run the file, there are many errors but the main one is:

! LaTeX Error: Can be used only in preamble.

Johannes_B
Site Moderator
Posts: 4168
Joined: Thu Nov 01, 2012 4:08 pm
You probably have something in your document body like `\usepackage`, which can only be used in the preamble (hence the message).

I suggest to read some basic introductory material. This is much much better than to search on the internet using google. The linked material is of high quality and free, google on the other hand looks for keywords. As a starter, you might not know the right keywords, which leaves you quite soon lost with strange code. Reading LaTeX for complete novices just takes a couple of hours (get coffee and some cookies ) and you have all you need to properly start.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Stefan Kottwitz
Posts: 9586
Joined: Mon Mar 10, 2008 9:44 pm
If you got any question while reading the introduction, you can ask here in the forum, of course. We can explain the background, reasons, or further things.

It's good to have read introductory information as a basis, that makes it easier here to talk and to fix harder issues.

Stefan