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?

Have you tried -aux_directory=../intfiles and -output-directory=../pdffiles? That should work with MikTeX.
–
Peter GrillNov 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
–
3SphereNov 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 GrillNov 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.
–
3SphereNov 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.
–
matthNov 16 '11 at 18:27

5 Answers
5

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).

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öderJan 22 '14 at 9:40

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.)

In Texstudio, if you want to save outputs of latex in a directory (and thereby have the directory that contains your source files uncluttered, set the -output-directory option of pdflatex command in Tools → Configure TextStudio → Commands
Change the value of PdfLatex the -output-directory option and output is the directory you need the output files to be stored. It can be any name and in any location, but make sure you give is the full path (or relative path).