Nicolas Goaziou <n.goaz...@gmail.com> writes: > Hello, > > zwz <zhangwe...@gmail.com> writes: > >> So here what I mean by "locally" is to adjust the org-latex-pdf-process >> by some keywords, instead of binding it with some specific code/value >> (which is difficult for modification) > > `org-latex-pdf-process' can be a function. You could send it a message > telling it what functions to use. For example, a hook could find out > what LaTeX class you're using and send the appropriate message to the > function. >
Thank you, Nicolas. Can you give me some example code? >> However I found it does not work in asyn export. > > Is is not related to async export. I am not sure if I get you totally. Here is what I put in my org-export-async-init-file: (defun ox-xetex-setup () (if (member "XeTeX" org-todo-keywords-1) (setq org-latex-default-packages-alist (remove '("AUTO" "inputenc" t) org-latex-default-packages-alist) org-latex-pdf-process '("latexmk -xelatex -pdf -silent -f %f")))) (add-hook 'org-mode-hook (lambda () (ox-xetex-setup))) ;; instead of add-hook as above, you can just put ;; (ox-xetex-setup) ;; but again, it still calls pdflatex when export asynchronously And in some test.org: #+TODO: XeTeX * test blah blah When I export it asynchronously, org-export calls pdflatex rather than xelatex to generate pdf. And even I put (ox-xetex-setup) directly in org-export-async-init-file, it still does not work as expected. > > A few variables live outside the scope of BIND keywords. > `org-latex-pdf-process' is one of them. Though, you can always define it > as a file local variable. > > > Regards,