If it doesn't exist, I would like to automatically create the subfolder ./temp where to put the auxiliary files with -aux-directory=temp.
Can this be done in Texstudio 2.10.2?
(see here and the links there to check how to change the directory of the auxiliary files and/or output).
EDIT:
The accepted answer works just fine in case there is no bibliography.
However, Texstudio returns error if a bibliografy in included (Error: Could not start the command: sh -c "mkdir ...).
Any idea why this happens?
pdflatexwith the-shell-escapeoption, with\immediate\write18{mkdir -p ./temp}as the first line of the document (if you're on a Unix system). But it seems much more complicated than just creating the folder when the document is first set up. – egreg Oct 18 '15 at 10:48