Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

LateX error : ! I can't write on file 'Rapport.pdf'

  1. Jul 11, 2017 #1
    I am trying to compile my lateX document but errors appear:

    ! I can't write on file 'Rapport.pdf'.
    Please type another file name for output
    ! Emergency stop
    l.55 ... obj {<< /pgfprgb (/Pattern /DeviceRGB] >>
    ! Fatal error occurred, no output pdf file produced!
    Transcript written on Rapport.log

    One of the solution is to close pdf file before compilation. I have already tried it and I have the same errors.

    My script is:

    \usepackage {hyperref}
    colorlinks= true,
    linkcolor = black,
    anchorcolor = black,
    citecolor = black,
    filecolor = black,
    urlcolor = black,
    pdfpagemode= UseOutlines,
    pdfstartview={XYZ 0 1000 1.0}








    \newcommand{\tab}{\ \ \ \ }
    \newcommand{\etal}{\textsl{et al.} }

    \renewcommand{\listfigurename}{Liste des Figures}
    \renewcommand{\listtablename}{Liste des Tableaux}

    \widowpenalty=10000 % empeche au maximum la coupure avant la derniere ligne
    \clubpenalty=10000 % empeche au maximum la coupure apres la premiere ligne
    \raggedbottom % empeche l'etirement des ressorts verticaux

    {0.2cm \@plus 0ex \@minus .0ex}%
    {0.0ex \@plus .0ex}

    {0.2cm \@plus 0.ex \@minus .0ex}%
    {0.0ex \@plus .0ex}

    \renewcommand{\chaptermark}[1]{\markboth{{\chaptername~\thechapter{}.\quad #1}}{}}
    \renewcommand{\sectionmark}[1]{\markright{\thesection{}.\quad #1}}
    \addtocontents{toc}{\protect\chaptermark{Table des matières}}
    \addtocontents{toc}{\protect\sectionmark{Table des matières}}


    % \input{chapitres/pgde.tex}
    % \date\today
    % \input{chapitres/Thankly.tex}




    Thank you for your help.
  2. jcsd
  3. Jul 11, 2017 #2


    User Avatar
    2017 Award

    Staff: Mentor

    What happens if you move the file away before you compile the code?
  4. Jul 11, 2017 #3


    Staff: Mentor

    There may be another process holding the file open like a pdf viewer maybe on a secondary desktop (if you're using multiple desktops).

    Sometimes when I've run into this kind of problem, I will terminate the pdf viewer via the kill command (linux, MacOSX) or via the Windows Task Manager and if that doesn't work, I will open a completely unrelated pdf file to clear the old one from the pdf viewer's list.

    Other possibilities are the file rapport.pdf is read protected or in a read protected directory or in a directory not owned by you...
  5. Jul 12, 2017 #4
    I solve my problem. It is because of anti-virus. If I compile the project during anti-virus starting, I obtain this error. To solve it, I am oblige to deactivate it.
    Think you for your answer.
  6. Jul 12, 2017 #5


    Staff: Mentor

    That sounds real bad. I wouldn't deactivate antivirus to compile anything.
  7. Jul 12, 2017 #6
    I use only one computer. Exactly file rapport.pdf is in a read protected directory. I have deactive this option so it ok.
    Thank you for your contribution.
  8. Jul 12, 2017 #7


    Staff: Mentor

    But still you open yourself up to a whole slew of attacks by doing that. Why not build it in another directory or even on a USB stick to avoid turning off the anti-virus.

    Also you could consider getting another anti-virus program if you think thats the real issue.
  9. Jul 12, 2017 #8
    Anti-virus is active but I would like to deactive directory protected. I am agree It's not a good solution. Now I use USB stick and it's ok.
    Thank you.
  10. Jul 12, 2017 #9
    Excluding folders from realtime antivirus scanning is common for heavy I/O files like those for databases and VMs. It sounds like the AV was locking the file for inspection while still being written, causing an access violation. The important thing is to never exclude temp or user home directories.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted