Take the 2-minute tour ×
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 trying to figure out a way to cleanly separate the TEX files from all of the intermediate and output files. Various approaches I've tried, including the one described by ‘Bundle’ TeX output in a directory don't seem to work. I'm using TexMaker + MikTex (portable). Ideally, I would like my file/directory structure to look something like this:

  • texproject
    • texfiles
      • 1.tex
      • 2.tex
    • intfiles
      • 1.out
      • 1.log
      • 1.aux
      • 2.out
      • 2.log
      • 2.aux
    • pdffiles
      • 1.pdf
      • 2.pdf

Instead, what I have, is the jumbled-up mess where all of these files live in the same directory. I've tried setting the ouput-directory, for example, on pdflatex but this doesn't work. The pdf file still gets created in the same place but now it doesn't show up in the previewer. This should be pretty easy to solve but I've so far been unsuccessful. How can I set up my environment to use the above structure when compiling?

Update: I believe I have narrowed this down to something specific to TexMaker. If the desired aux and out directories are passed via the command line to pdflatex, everything builds as it should. Yet, I get numerous message boxes popping up saying that files can't be found and the PDF doesn't display in the internal viewer. I can't see any obvious options within TexMaker to change to address this. So, has anyone been able to make the scenario I'm describing work with TexMaker?

share|improve this question
    
Have you tried -aux_directory=../intfiles and -output-directory=../pdffiles? That should work with MikTeX. –  Peter Grill Nov 16 '11 at 16:41
    
@PeterGrill Well, it partially works; I've tried passing these parameters to PDFLATEX but there are still things that seem to be looking in the current directory for the output and intermediate files. Although build succeeds, numerous "can't find file" message boxes pop up and the internal pdf viewer can't seem to find the file –  3Sphere Nov 16 '11 at 17:36
    
Wondering if that has anything to do with .aux files from previous runs? I will try to test this later today when I am on my PC that has MikTeX. –  Peter Grill Nov 16 '11 at 17:48
    
@PeterGrill No, even when all aux files everywhere are cleared out it has this problem. Something (TexMaker?) is trying to write to a log file and can't find the file and the internal PDF viewer can't find the PDF; I'm thinking this is something TexMaker-specific because MikTex seems to build the files properly. –  3Sphere Nov 16 '11 at 17:58
    
Just tried that as well (using Win7+MikTex+Texmaker). Texmaker invokes pdflatex, which writes all files to the folders specified. Writing works and all files are created as they should. But then Texmaker tries to read and display the log in the integrated Messages/Log viewer and the pdf in the integrated pdf viewer and does not find the files. –  matth Nov 16 '11 at 18:27
show 2 more comments

3 Answers

up vote 5 down vote accepted

As suggested by lockstep, I write a short answer: AFAIK, this is currently not possible, because the path cannot be changed for the messages / log viewer and for the pdf viewer from within the Texmaker GUI. There is a feature request on the Texmaker issue list to make the path configurable: http://code.google.com/p/texmaker/issues/detail?id=97 Maybe you are lucky and in a later release this will be available. I personally would also use this new feature (and only backup the input folder, not the output folder).

share|improve this answer
add comment

Since Texmaker 3.4, you can specify the option "Use a build directory for output", which creates a "build" folder in your project folder, and saves everything but the .tex file there. See the manual Now you can also specify the output directory as an option to pdflatex as e.g. -output-directory pdf. But you will also have a copy of the pdf in the build folder no matter what. And I haven't found a straight-forward way to have the output file in the root folder, either.

(And I also have a .gz file in the folders, but that might be an option you can turn off.)

share|improve this answer
add comment

For TeXstudio (since a fork from texmaker, it might be similar there):

  1. Add the options -aux_directory and -output-directory to the latex pdflatex and other commands, if needed.
  2. Change the appropriate lines (160 and 161 in my case) in the texstudio.ini file, in W7 usually located under

C:\Users\username\AppData\Roaming\texstudio

Modify the path for the two varables accordingly.

Tools\Log%20Paths=C:\\\Users\\\username\\\AppData\\\Local\\\Temp

Tools\PDF%20Paths=D:\\\repos\\\pdf

(double-backslashes by intention)

Enjoy!

share|improve this answer
    
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. A suggestion: Do us a favour and change your username to something more telling than "user1234". –  Martin Schröder Jan 22 at 9:40
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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