1

I have just installed MikTeX and WinEdt and i try this code in WinEdt:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsfonts,amssymb}
\usepackage{amsthm}
\usepackage[electronic]{ifsym}
\usepackage[cp1251]{inputenc}
\usepackage[matrix,arrow,curve,frame,poly,arc]{xy}
\usepackage[english, russian]{babel}
\usepackage[final]{graphicx}
\usepackage{mathrsfs}
\usepackage{color}
\usepackage{tikz}
\pagestyle{empty}
\begin{document}

\sum x

\end{document}`

Then i press on TeX button (Shift+Ctrl+T) and it says a lot of errors of the same type: "Undefined Control Sequence".

Then i press on DVI button and see something like this:

article amsmath amsfonts,amssymb amsthm [electronic]ifsym [cp1251]inputenc [matrix,arrow,curve,frame,poly,arc]xy [english, russian]babel [¯nal]graphicx mathrsfs color tikz empty document

x

What should i do? Whats the problem?

Anderson
  • 2,333
  • 4
  • 17
  • 19
Elensil
  • 113
  • Welcome to TeX.SX! I don't know WinEdt, but I suspect you're compiling with pdftex instead of pdflatex. The only error you should get from that code is missing $ inserted, because \sum must be in math mode, i.e. \[ \sum x \] or $ \sum x $. – Torbjørn T. Apr 06 '14 at 09:22
  • Or in addition to Torbjørn's solution: \( \sum x \) or \begin{math} \sum x \end{math} work too. –  Apr 06 '14 at 09:24
  • As a follow up to @ChristianH.'s comment: If you use \( .. \) then you should also add \usepackage{fixltx2e} (see http://tex.stackexchange.com/a/542/586), and the math environment is basically the same as $ .. $ I believe. – Torbjørn T. Apr 06 '14 at 09:40
  • @TorbjørnT. What does fixltx2e fix actually? I never heard of that before? –  Apr 06 '14 at 09:43
  • 2
    This and that, see the documentation. In this specific case it protects \( .. \) so they can be used in moving arguments, e.g. section titles and captions. Try for example \documentclass{book} \begin{document} \chapter{\( x \)} \newpage abc \end{document} which doesn't work with fixltx2e. – Torbjørn T. Apr 06 '14 at 09:49
  • @TorbjørnT. Good to know, but I recently switched over to use \( ... \) and try to prevent chapter (etc) titles with mathematical markup, but your proposition does even allow for using this style. –  Apr 06 '14 at 10:25

1 Answers1

1

The problem is simply that you try to compile with Plain TeX and you wrote a LaTeXdocument, that can be compiled with LaTeX (Shift+Ctrl+L) or pdfLaTeX (no shortcut, but you have an icon in the toolbar that lets you choose the compiler:

enter image description here

You also can use LaTeXify or pdfLaTeXify to automatically compile the right number of times if your document has cross-references, bibliography, index &c.

Btw, you should use usepackage[utf8]{inputenc} rather than cp1251: WinEdt is an utf8 editor, and it will make your document easily readable on any platform.

Bernard
  • 271,350
  • I tried LaTeX compiling, but it says that it failed to create a dvi file :( It says "for possible explanations start the command from the command prompt", but i don't know which command... – Elensil Apr 06 '14 at 09:40
  • This seems to be a miktex/latex problem. What does the .log file say? – Bernard Apr 06 '14 at 10:04
  • I forgot to answer your question: "starting from the command prompt" in its simplest form just means typing at the command prompt: latex file_name.tex. It will compile in LaTeX format, and you will see the .log file. But anyway you also see it in WinEdt console. – Bernard Apr 06 '14 at 10:32
  • Ok, i have installed the newest version of MiKTeX and it seems to work now) – Elensil Apr 06 '14 at 11:06