emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to export an org file, to 2 different locations (in to different


From: Uwe Brauer
Subject: Re: how to export an org file, to 2 different locations (in to different formats)
Date: Sat, 28 May 2022 08:21:51 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

> Hi Uwe,
> Uwe Brauer writes:


> One (pedestrian) way to achieve it, with this function:

> (defun my-org/export-to-path (backend export-path extension)
>   (org-element-map (org-element-parse-buffer) 'keyword
>     (lambda (k)
>       (when (string= (org-element-property :key k) "EXPORT_FILE_NAME")
>       (let ((value (org-element-property :value k)))
>         (org-export-to-file backend
>             (format
>              "%s%s.%s"
>              export-path
>              value extension)))))))

> And then you could evaluate it inside a block in your document, with the
> chosen arguments. For example:

> #+EXPORT_FILE_NAME: myfile

> #+begin_src emacs-lisp :exports none :eval never-export :results silent
>   (my-org/export-to-path 'html "~/Desktop/" "html")
> #+end_src

Very nice I run a test with 

#+begin_src emacs-lisp :exports none :eval never-export :results silent
  (my-org/export-to-path 'html "~/Desktop/" "html")
#+end_src



#+begin_src emacs-lisp :exports none :eval never-export :results silent
  (my-org/export-to-path 'latex "./" "tex")
#+end_src

And it works nicely, thanks a lot, simplifies my workflow quite a bit.


Uwe 

Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]