I have a lot of different files stored in a lot of different folders.
My ultimate goal would be to get all the final PDF files copied or stored automatically to another folder, so that I could have a single folder containing all the PDF files from my various folders.
So far I have a directory looking like this
C:Exams
\Subject 1
Exam A.pdf
Exam B.pdf
\Subject 2
Exam C.pdf
Exam D.pdf
\Subject 3
Exam E.pdf
Exam F.pdf
...
Now, what I would like is a new folder, containing all of these PDF files. Is this possible?
I also have other folders, such as notes and so on. So it is not preferable that Texmaker or some other program blindly places all of the PDF outputs from Texmaker in a single folder.
The ultimate goal would be an alternative script or program, that checks through the exam folder for PDFs and copies them to the chosen folder. Alas, I have no experience customizing Texmaker, or using any programming language whatsoever.
Best Answer
I made a little script using the built in tools of Windows, so you don't have to install a thing. It is basically recursively scanning the
source
directory forpdf
files and then copying them in thedestination
folder.I work with TeXStudio, that is a different version of Texmaker. However, I think that you can run the script within the IDE in the same way. In the
quickbuild
part there should be an option for a user command there you can write your own compilation, for example forpdflatex
:In this case, you need the absolute path of the script, and also you will need to input the directories.
To execute the script manually, you need to call it in a command line:
move-pdf.bat source destination
(assuming that you named the scriptmove-pdf.bat
). For example if you want to run it in your current directory just execute:move-pdf.bat . pdfs
. If you want to run it in several directories it is a good idea to put it in a place where your system can find it, or add the path where you place the script to the system variables. Else, you can place it in every directory. Moreover, if you want to avoid passing the parameters all the time and just to execute for a default source and destination, put those paths in the two variablessrc
anddst
.