Bastien <b...@gnu.org> writes: > Julien Cubizolles <j.cubizol...@free.fr> writes: > >> Can this be achieved, maybe with :completion-function? > > Maybe, but I never tried. Let us know if you can get it work!
It works! I'm the first surprised here. I defined the following functions to manipulate the filenames. I suspect my code is clumsy and error prone but it works in the cases tested so far. --8<---------------cut here---------------start------------->8--- (defun remove-org-suffix (name) "Remove the .org from a file name" (if (string-match "\\(.*\\)\\.org" name) (substring name (match-beginning 1) (match-end 1)) name)) (defun jc-org-publish-rename-pdf (suffix) "Rename file.pdf to file-beamer.pdf when buffer is visiting file.org" (let* ((file-base-name (remove-org-suffix (buffer-file-name))) (file-pdf-name (concat file-base-name ".pdf")) (file-beamer-pdf-name (concat file-base-name "-" suffix ".pdf"))) (if (file-exists-p file-pdf-name) (rename-file file-pdf-name file-beamer-pdf-name 1)) ) ) (defun jc-org-publish-rename-notes-pdf () "Rename file.pdf to file-notes.pdf when buffer is visiting file.org" (jc-org-publish-rename-pdf '"notes")) (defun jc-org-publish-rename-beamer-pdf () "Rename file.pdf to file-beamer.pdf when buffer is visiting file.org" (jc-org-publish-rename-pdf '"beamer")) --8<---------------cut here---------------end--------------->8--- Then this block in the beginning of a "master" .org file takes care of : * calling the beamer export with different class/ class options according to the project (beamer/notes) chosen * renaming the pdf file according to the project (-beamer.pdf or -notes.pdf) * you can also use the "cours" project which publish both subprojects --8<---------------cut here---------------start------------->8--- #+begin_src emacs-lisp :tangle yes :exports none (setq org-publish-project-alist '(("beamer" :base-directory "./" :publishing-directory "./" :publishing-function org-beamer-publish-to-pdf :exclude ".*" :latex-class "mpsi_beamer" :include ("1er-principe.org") :completion-function jc-org-publish-rename-beamer-pdf ) ("notes" :base-directory "./" :publishing-directory "./" :publishing-function org-beamer-publish-to-pdf :exclude ".*" :latex-class "mpsi_beamer" :include ("1er-principe.org") :latex-class-options "[NotesCours]" :completion-function jc-org-publish-rename-notes-pdf ) ("cours" :components ("beamer" "notes")))) #+end_src --8<---------------cut here---------------end--------------->8--- Thanks for guiding me. Julien.