I'm trying to execute latexmk from my web application and need to specify the path of its output directory. (I'm on Linux CentOS 6.9)
I have my .tex files in the directory /home/(the path) (this is the absolute path relative to root of the web app) and need to generate the .pdf in the same directory with the same name as the original .tex file.
The entire command I use goes as follows:
latexmk -pdf -jobname=/home/(the path)/filename /home/(the path)/filename.tex
This however, does not work; latexmk starts execution and stops with a message
I can't write on file filename.aux
Instead, if I run a similar command from terminal window with relative and not absolute paths of the files (suppose I'm in the parent directory of the target folder), such as
latexmk -pdf -jobname= target_dir/filename target_dir/filename.tex
then it works as expected. Also, skipping the jobname and using the absolute path to .tex file works fine, but the problem there is that the output goes into the root directory.
I am aware of this question, but still the problem with absolute paths remains.
How is it possible to give the absolute path of the output to latexmk?
latexmk -cd /home/(the path)/filename.tex
.