Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

My code:

 \begin{document}
    \begin{equation}
    2*x+y
    \end{equation}
 \end{document}

I found that F2 can compile as LaTeX. Compile result:

 Process started

 Process exited with error(s)

How to fixed and preview it?

share|improve this question
    
What are the errors you get? –  egreg Aug 30 '11 at 8:27
    
If I compile by press F2,it doesn't show any error message.Or what the compile way I should take? –  sam Aug 30 '11 at 9:12
    
I revised the original post by F1 compiling messages.If I press F1,it shows: LaTeX Error: The font size command \normalsize is not defined: there is probably something wrong with the class file. –  sam Aug 30 '11 at 9:21
    
Please, turn the example code into the actual code you're using. –  egreg Aug 30 '11 at 9:22
    
At that time,I just post all the code I know,but now I know how to get working~Thank you all~ –  sam Aug 30 '11 at 9:36
add comment

2 Answers

up vote 3 down vote accepted

F2 in TeXmaker is a shortcut. What it runs is seen in the 'Tools' menu.

By default it runs 'LaTeX' but for this to compile correctly you would need your equation to be part of a complete, albeit minimal, .tex file. For example,

\documentclass{article}
\begin{document}
\begin{equation}
  \dot P = K'P+PK'^T + Cov(Kv-Gw)
\end{equation}
\end{document}

compiles without errors and should produce a .dvi file.

You may, as usual, wish to add additional packages (e.g. amsmath) or more code to view the snippet as intended.

share|improve this answer
    
What is amsmath for? How to use it?Should I apt-get install something? –  sam Aug 30 '11 at 9:35
    
To quote from the amsmath package documentation: "The amsmath package is a LaTeX package that provides miscellaneous enhancements for improving the information structure and printed output of documents that contain mathematical formulas." –  mas Aug 30 '11 at 12:13
    
@sam: normally seen, amsmath should work out of the box. some other packages will need installation of texlive-... packages on your linux-box –  long tom Oct 26 '12 at 21:29
add comment

In LaTeX, the equation environment typesets its entire contents (everything between \begin{equation} and \end{equation}) in math mode. Therefore, issuing $...$ is not needed within the environment and causes the error. Therefore, remove the "inner" $'s and it should compile fine.

share|improve this answer
    
I removed it as the post I revised,and press F2. That problem is still the same.How to preview the result? –  sam Aug 30 '11 at 8:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.