From mboxrd@z Thu Jan 1 00:00:00 1970 From: zwz Subject: Re: org-todo-keywords-1 detection in asyn export Date: Fri, 18 Apr 2014 22:21:54 +0800 Message-ID: <87d2ged8fx.fsf@gmail.com> References: <87ppl1o9ok.fsf@gmail.com> <87sipc8me6.fsf@bzg.ath.cx> <87ha5scjdx.fsf@gmail.com> <87a9bj3e1a.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42110) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WbA2P-0006oI-Hv for emacs-orgmode@gnu.org; Fri, 18 Apr 2014 10:45:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WbA2H-0006Uo-M4 for emacs-orgmode@gnu.org; Fri, 18 Apr 2014 10:45:09 -0400 Received: from plane.gmane.org ([80.91.229.3]:41308) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WbA2H-0006U6-GQ for emacs-orgmode@gnu.org; Fri, 18 Apr 2014 10:45:01 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WbA2E-000149-Gp for emacs-orgmode@gnu.org; Fri, 18 Apr 2014 16:44:58 +0200 Received: from 39.181.7.250 ([39.181.7.250]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 18 Apr 2014 16:44:58 +0200 Received: from zhangweize by 39.181.7.250 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 18 Apr 2014 16:44:58 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Nicolas Goaziou writes: > Hello, > > zwz 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,