Tell me more ×
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.

I am using MiKTeX 2.9 on Windows 7.

I'm getting the error: "can't write on pdf file." The pdf doesn't reflect what I wrote. What did I do wrong?

My input:

\documentclass[12pt]{article}
\usepackage{epsf}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{setspace}
\usepackage{amsmath}
\usepackage{rotate}
\usepackage{endnotes}
%\usepackage{harvard}
\usepackage{vmargin}
\usepackage[nolists,noheads,tablesfirst,nomarkers]{endfloat}
\usepackage{natbib}
\bibliographystyle{apsr}

\oddsidemargin=1.0in\evensidemargin=0.in
\textheight=8.5in\textwidth=6.6 in \baselineskip=18pt \parskip=6pt

\begin{document}  % added, was missing

TEXT

\newpage \baselineskip=12pt
\doublespacing

\bibliographystyle{apsa}
\bibliography{Dissertation_Proposal}


\end{document}
share|improve this question
You're missing a \begin{document}. I'm guessing the log file will state this clearly or your editor. – Abdulhaq Elhouderi Oct 19 '12 at 20:38
No, I have: \oddsidemargin=1.0in\evensidemargin=0.in \textheight=8.5in\textwidth=6.6 in \baselineskip=18pt \parskip=6pt %opening \title{Title} \author{Author} \begin{document} \maketitle \begin{abstract} – user21127 Oct 19 '12 at 20:40
I can't see what you posted in the comment in the actual question. – Abdulhaq Elhouderi Oct 19 '12 at 20:43
4  
This can happen when the output PDF file is locked by another application, e.g. it is open in Adobe Reader. – cyberSingularity Oct 19 '12 at 20:54
You were right. The error was caused by the pdf already being open. Closing it fixed the problem. Thanks! – user21127 Oct 19 '12 at 21:07
show 2 more comments

closed as too localized by Joseph Wright Oct 22 '12 at 7:39

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.

1 Answer

The error message is generated by the prompt_file_name procedure in TeX.

Most likely causes:

A couple of things to note:

  • One cannot type x at this prompt to abort. That will write on a file called x.pdf.
  • In pdflatex, pressing ENTER without retyping the filename unhelpfully writes on a file called .pdf.
  • In lualatex, pressing ENTER without retyping the filename prompts again.
  • In xelatex, this prompt doesn't occur. Instead, one seems to get the message ** ERROR ** Unable to open ... and then it exits.
share|improve this answer

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