Hey there.
I am using LaTeX for the first time, and i am wondering if there is a text-editor or compiler (i know they are two different things) out there (for OS X 10.6) that lets me specify the destination folder for the different files?
I got the task of stitching together the document on a project, and i think latex is a wonderful tool to do this.
I am currently using the MacTex "system" together with texmaker/texshop as editors.
THanks a bunch for a great forum with LOTS of usefull tips!
General ⇒ Specify path of generated files
NEW: TikZ book now 40% off at Amazon.com for a short time.

Specify path of generated files
One way would be to use a master document and use \include command for including documents from their respective folders. Same goes for images. For example, you may define custom commands for including files from Files folder and images from Images folder:
In the attachment you may find an example of this.
NOTE: This code works on Linux. It is possible that on Mac you'll have to use another syntax for relative paths (something like :Files:#1). I hope someone here who's using a Mac will help you in case you have any problems with paths.
Also, import package may be useful in this case.
Code: Select all
\newcommand{\myinclude}[1]{\include{Files/#1}}
\newcommand{\mygraphic}[2][]{\includegraphics[#1]{Images/#2}}
NOTE: This code works on Linux. It is possible that on Mac you'll have to use another syntax for relative paths (something like :Files:#1). I hope someone here who's using a Mac will help you in case you have any problems with paths.
Also, import package may be useful in this case.
- Attachments
-
- Main.zip
- (1.92 KiB) Downloaded 129 times
Specify path of generated files
Are you trying to specify where the output (i.e., the documents created during compilation and/or the auxiliary files) go, or where the compiler looks for files it needs while compiling (like images and included subdocs)? I think Meho_r was thinking the latter, but I gather from the title you meant the former.
You can compile using the --output-directory= option, e.g.:
You could configure your editor to add this flag to its compilation command.
Theoretically, you're supposed to be able to use the first line of a file to pass arguments to the compiler, e.g.:
I just tested this, however, and it's not working for me.
You could certainly write a script that moved the output for you, and customize the output routines of TeXworks or Texmaker or other editor to call the script, but I do worry, especially with TeXworks, that this would interfere with the proper functioning of the previewer and its SyncTeX features (jumping from source to the corresponding part of the output and vice-versa).
But this is an interesting topic and I hope it gets some further discussion and possible solutions.
You can compile using the --output-directory= option, e.g.:
Code: Select all
pdflatex --output-directory=/Users/me/texout filename.tex
Theoretically, you're supposed to be able to use the first line of a file to pass arguments to the compiler, e.g.:
Code: Select all
%& --output-directory=/path/to/pdfout
You could certainly write a script that moved the output for you, and customize the output routines of TeXworks or Texmaker or other editor to call the script, but I do worry, especially with TeXworks, that this would interfere with the proper functioning of the previewer and its SyncTeX features (jumping from source to the corresponding part of the output and vice-versa).
But this is an interesting topic and I hope it gets some further discussion and possible solutions.
Specify path of generated files
Thanks for two good replies
I love when forum works...
@frabjous: U were right. I was aiming for a sollution like you are discussing here.
My goal is to be able to use LaTeX as a more collaborative tool than it is today. I allready use \input to include documents that i have in nested folders to get a better overview. Each chapter has its own file.
I could create a script that customizes the workflow so it suits my needs, but in a worst case scenario it would have to be distributed to all the different users and made sure that they used it.
We use dropbox (not GIT or SVN for this small project) to synchronize files between us, and the main issue is that the other users feel that it is a cluttered enviroment to work in (navigating through .log files etc to find the correct document to work on.)
I know these are minor issues, but i would still like to see a sollution to them
Any other thoughts?

@frabjous: U were right. I was aiming for a sollution like you are discussing here.
My goal is to be able to use LaTeX as a more collaborative tool than it is today. I allready use \input to include documents that i have in nested folders to get a better overview. Each chapter has its own file.
I could create a script that customizes the workflow so it suits my needs, but in a worst case scenario it would have to be distributed to all the different users and made sure that they used it.
We use dropbox (not GIT or SVN for this small project) to synchronize files between us, and the main issue is that the other users feel that it is a cluttered enviroment to work in (navigating through .log files etc to find the correct document to work on.)
I know these are minor issues, but i would still like to see a sollution to them
