TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm having problems building a book file (using the memoir class) in the latest version of TeXnicCenter on Windows 7:

  1. I have a main file which uses \includefrom{} to include each chapter; TeXnicCenter only lets me build from that main file, otherwise it gives a long string of errors. I tried writing %!TEX root = ../realbook.tex at the top of each chapter file, but that doesn't help...

  2. I'm building a PDF directly. When I select "Build and view current file," after it builds, TeXnicCenter opens Adobe Acrobat Reader (without opening the newly-built file) and then freezes for ~15 seconds. Is there any way to fix this?

  3. I cannot build while the PDF is open. It gives me this error: \newcommand{\blank}[1]{\rule{#1}{0.4pt}} Is there something else I can use, maybe a PDF synchronization package for Windows?

share|improve this question
Under Build > Define Output Profiles..., select the profile you are using on the left. Then click the Viewer tab on the right. It should show the PDF Viewer options. Under the Close document before running (La)TeX section, you need to activate the DDE command radio button and specify the "Command" [DocClose("%bm.pdf")]. Since I'm using Adobe Reader, my "Server" is acroview and "Topic" is control. – Werner Dec 2 '11 at 21:01
The reason you cannot build when the PDF is open, is that Adobe Reader locks the file for editing. Other PDF viewers, such as Sumatra, will not lock the file, but update it if the viewer detects changes. – Torbjørn T. Dec 2 '11 at 21:20
+1 for replacing Adobe Reader with Sumatra, at least for TeXnicCenter uses. – Mike Renfro Dec 3 '11 at 2:07
Also, I think %TEX root = is a TeXworks-specific feature, and not something that TeXnicCenter supports. – Mike Renfro Dec 3 '11 at 2:11
Have you tried creating a project? – cmhughes Dec 3 '11 at 5:54
up vote 10 down vote accepted

As commented to the question the last two problems are Adobe Acrobat specific and due to the fact that Adobe Reader locks the file for editing, hence the file cannot be changed. But some other PDF readers lead by the recent Sumatra PDF can do this seamlessly. WinEdt 6, in fact, looks for Sumatra PDF and uses it as default. Conversely, SumatraPDF also recognize a limited number of editors.

Since your problems except No.1 is solved, the remaining fix/trick/shortcut is to select Build Menu -> Build and View Output instead of Build Menu -> Current View -> Build and View which assumes that you have defined a project and indicated your main file.

Their respective keyboard shortcuts are Ctrl+F5 and Ctrl+Shift+F5 and the first one is the one you might want to use.

share|improve this answer
Exactly what I was doing wrong--thank you precusse! – jamaicanworm Dec 3 '11 at 21:35

Your Answer


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.