I have an Overleaf project that contains multiple .tex files to create different PDF documents.
If I compile one of the .tex files and download it, it is named after the Overleaf project.
Currently, if I want the PDF file to have the same name as the corresponding .tex file, I have to rename the PDF file after downloading.
Is there a way to make Overleaf change the PDF filenames to the names of the .tex files they are created from?
Say, I have doc1.tex and doc2.tex.
My goal is that when I download the PDF file for doc1.tex the PDF file is named doc1.pdf and when I download the PDF file for doc2.tex the filename is doc2.pdf.
My approach is to create a custom latexmkrc file.
When I add the following line to Overleaf's default latexmkrc file, the compilation works.
$pdflatex = 'pdflatex -shell-escape -file-line-error --synctex=-1 %O %S ';
But appending -jobname=newfilename to this line does not change the name of the PDF file when I download it.
What is the problem here or is there a better approach?