I have a basic capture template:
("a" "Article" entry
(file+headline "~/GitLab/Reports/Bibliography/references.org" "Article")
"* %^{Title} \n%?")
that asks you to fill the Title field.
Now, my question is how to automatically fill this using the title of the original document (the original #+TITLE my title). One must certainly use sexp with something like:
("a" "Article" entry
(file+headline "~/GitLab/Reports/Bibliography/references.org" "Article")
"* %(...some elisp instructions...) \n%?")
The problem is that I do not find/know a function returning the title.
I mean:
("a" "Article" entry
(file+headline "~/GitLab/Reports/Bibliography/references.org" "Article")
"* %(org-capture-get :original-file-nondirectory) \n%?")
fills with the original file name, but the equivalent for title:
%(org-capture-get :title)
does not exist.
I also try, from an org-mode file:
#+TITLE: Titi Toto
#+BEGIN_SRC emacs-lisp
(plist-get (org-export-get-environment) ':title)
#+END_SRC
#+RESULTS:
| Titi Toto |
but
(plist-get (org-export-get-environment) ':title)
does not work anymore when used in the capture template.
Any help is welcome