11

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.

doncherry
  • 54,637
lowndrul
  • 5,323

3 Answers3

3

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.

Willie Wong
  • 24,733
  • 8
  • 74
  • 106
  • 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 01 '11 at 19:54
3

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.

  • This tex option no longer seems to be supported for texify. Running texify with the option results in : "TeX option "--output-directory" is not supported." – Steve Aug 16 '20 at 15:10
2

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.

Ulrike Fischer
  • 327,261