14

I'm using Miktex 2.9 on windows 7 x32, texniccenter as IDE. I encounter an error for a project that worked few days ago: when I compile, I get the message:

! I can't write on file `../preamble1.aux'.

The beginning of the .tex file is:

\documentclass[xcolor=dvipsnames]{beamer}
\include{../preamble1}
\begin{document}

What should I do?

Thanks.

lmsasu
  • 851

3 Answers3

19

Why did you put \include in the preamble?

Please change to \input.

Display Name
  • 46,933
  • Thanks, it worked, but I do not understand: few days ago, the \include worked fine... I upgraded from Miktex 2.8 to 2.9 (uninstall/reinstall), this might be the cause? – lmsasu Dec 26 '10 at 16:43
  • 1
    @Imsasu, I haven't seen \include in the preamble. Even though you use \documentclass{book}, you can use \includeonly only and not \include in the preamble. It is what I know. :-) If you feel my answer is the final solution, kindly mark it with green check :-) – Display Name Dec 26 '10 at 16:47
12

See this answer for an explanation of why \input works and why \include does not, why this has changed with recent tex distributions, and how to work around it for old documents, if necessary.

Lev Bishop
  • 45,462
1

This is not related to the question directly, but one can get this same error for a different reason, and since this question is ranked first on google, I thought it might help others:

Note that you can also get this error if you try to create a file in a subfolder that does not exists.

tobiasBora
  • 8,684