This question introduced a idea that instead of generating pdf file every time, we may use xdv file as the target for intermediate processes, and only convert to pdf file once with
xdvipdfmx at the final step, and this is expected to save us a lot of processing time.
And also quote from the manual of latexmk:
-pdfxe Generate pdf version of document using xelatex. Note that to optimize processing time, latexmk uses xelatex to generate an xdv file rather than a pdf file directly. Only after possibly multiple runs to generate a fully up-to-date xdv does latexmk then call xdvipdfmx to generate the final pdf file.
(Note: When the document includes large graphics files, especially png files, the last step can be quite time consuming, even when the creation of the xdv file by xelatex is fast. So the use of the intermediate xdv file can result in substantial gains in procesing time, since the pdf file is produced once rather than on every run of xelatex.)
I am thinking of if there is way to fully utilize this feature. Currently when I edit a tex file, I would always have
latexmk -xelatex -pvc run somewhere so that I can see the updated file immediately. But this command would still generate the pdf file at each run(after each time I saved the file). So are there actually ways that let latexmk generate only the
xdv file? And I would manually convert the xdv file to pdf after I finish editing.
But of course I am just searching for a more efficient workflow, what I am suggesting here may not be the optimal as well. If there are other ways to save the processing time, please let me know!