I get "undefined control sequence" error message for several lines: "undefined control sequence" (after "\pagebreak", where I pressed ENTER for an empty line), "undefined control sequence \section", and "undefined control sequence \end{document}".

It is the first time that I installed TeXstudio on Windows 7. I also installed MiKTeX prior to TeXstudio. Moreover, I tried the code on Windows XP and didn't get the error messages at all.

The complete code is below.

\usetikzlibrary{decorations.pathmorphing, patterns,shapes}

\title{the title}
\date{March 4, 2014}



This is the main text.

  • Drop the use of \usepackage{preview}... – Werner Mar 5 '14 at 7:28
  • Your document compiles without any complains from LaTeX under TexLive 2013 (Linux) – user31729 Mar 5 '14 at 8:43
  • What is the first error? Are you sure that you are running pdfLaTeX and not pdfTeX? – Jeroen Zuiddam Mar 5 '14 at 19:03
  • @Werner Does anyone know why preview is causing problems here? – Jeroen Zuiddam Mar 7 '14 at 8:18

The following minimal example replicates the problem:



This is the main text.


It's obviously a bad interaction (incompatibility) between tikz and preview. Either drop the loading of preview, or load it with the [active] package option.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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