latexmk -pdf
will look for a .tex file in your current directory. If it doesn't find any in the current directory, it doesn't recursively search for them anywhere else. After all, how does it know whether it should compile xx.tex
or yy.tex
, or how deep it should go?
You can provide a filename to it, though, telling it what file to compile, as latexmk -pdf subdir1/xx.tex
, and it will output the files in the current working directory.
Note: this is probably not the best practice, you might as well go into subdir1
and run the same command (latexmk -pdf xx.tex
) with the output-directory=..
command. I don't know why you would want all your tex compiles in the same folder, though, and separate the source codes.
On another note, while I see you're using Windows, you could recursively run all your texfiles in subdirs with the find
command in Linux, as this: find . -name *.tex -exec latexmk -pdf {} \;
. This might lead to issues if some texfiles have the same name. Omit the trailing -exec...
to run a dry-run to see which files you want.