I'd like to tell texify to place compiled output (i.e., .pdf in my case) in the parent directory (I'm using MikTeX 2.8 on Vista32). I run the following:

texify --pdf --clean --tex-option=--output-directory=".." main.tex

I keep getting an error reading:

texify: Windows API Error: The system cannot find the file specified

Things work fine without --tex-option=--output-directory="..". Omitting --pdf doesn't improve the situation

Q: How can I get texify to place compiled output in the parent directory using the --tex-option (or other) switch?

I have very little experience on the command line, so I suspect the answer may be a simple one.

  • If instead of using "..", you used the full path to the parent directory, does it work? – Willie Wong Mar 1 '11 at 17:06
  • Same question but about latexmk instead: "Specify -output-directory when using latexmk". – Martin Scharrer Mar 1 '11 at 17:06
  • @brianjd Do you use a batch file in order to execute texify, or do you call it manually on the command line? – diabonas Mar 1 '11 at 17:09
  • @diabonas: I'm calling it from the command line – lowndrul Mar 1 '11 at 17:30
  • @Martin: seems that at least with latexmk there's a jobname switch specifically built to handle this sort of thing. There doesn't seem to be anything like that for texify. Guess that's what the --tex-option switch is for but it just doesn't seem to be working in my case. – lowndrul Mar 1 '11 at 17:34

How'bout if you add the switch -I ".." to the list of options passed to texify? (I'm groping around blindly here because I don't use the util myself.)

The reason for breakage, I think, is that --tex-option is only passed to pdflatex, which now deposits all output files, including the *.aux files required to run bibtex, in a different directory. So after the first pass, the program tries to run bibtex on main.aux to resolve any citation references, but since main.aux now sits in ../, it cannot be found and Windows throw an error.

The -I switch tells texify to search that directory first for input files, at least that's how I read the manual. So it may help in this instance.

If that doesn't work, your best bet is to write a batch file to first call texify and then mv the final PDF into the parent directory.

  • Just tried it and it didn't work. Good suggestion though. It's sounding like writing a batch file is my only option here. – lowndrul Mar 1 '11 at 19:54

I'm using MikTeX 2.9 on XP, and with a bit help of your post (I've learned about --tex-option= option) I was able to solve my (and yours) problem - use this: --tex-option="-output-directory=.." to have output in a parent directory.


For security reasons it is not possible to write to locations which use a absolute path or includes the parent directory (..). You can change this security setting through an environment variable (I think MIKTEX_ALLOWUNSAFEOUTPUTFILES=1) but I advise you strongly not to do it.

  • I'm using the aux-directory option with a downstream folder, but I still get this error. Any thoughts? – Ali Mehrizi Jun 18 '12 at 1:49

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.