2

i have the following template

(add-to-list 'org-capture-templates
               '("un" "resturant"
                 entry
                (file+headline "/home/zeltak/org/files/agenda/travel.org" "NYC")
"* TOVISIT %^{Description}   
%u
  :PROPERTIES:
  :Rating: %^{rating?|-|1|2|3|4|5}
  :price: %^{price in local currancy?|-|0-10|10-20|20-30|30-50|50+}
  :Source: %^{Source?}
  :Type: %^{Type?|meal|breakfeast|dessert|street}
  :Cuisine:   
%^{Cuisine?|-|Indian|Thai|Vietnamese|Asian|Chinese|Israeli|Italian|American|EastEuro|Mexican|French|Persian|Austrian|Japan}
  :Fav: %^{Fav|yes|no}
  :END:

%^{prompt|** My Review}
%?
    "
       ))

note the last entry where i try and add a sub header. when i finzalize the capture it dosent create a header but rather just add the 2 starts.

is there a way to make the capture template add a proper sub header?

  • This is quite an elaborated capture template. I tried and it works fine. At the prompt to ask for review title, you just type ** <title>. If it is a general fixed title, you can omit the prompt there. – biocyberman Oct 1 '16 at 15:51
  • hmm here it just add a ** (with a space before) the two ** and dosent create a sub header. i have to manually go and delete blank spaces before the **..weird – zeltak Oct 1 '16 at 17:44
  • A banal idea: maybe reload the template to make sure you got the correct one in place. And if that does not work, remove the prompt, just leave a straight sub header there and see if it works first. – biocyberman Oct 1 '16 at 20:15
  • thx. i reloaded without the prompt but with a *** entry. what this does when the template is executed is to have a *** text yet not an actual header. i need to manually go and change each subheader to a header by deleting the white space before the ***. – zeltak Oct 2 '16 at 6:02
  • Three asterisks are correct: * NYC => ** TOVISIT ... => *** Sub-header (review title). I just don't understand why you would get that space before the asterisks. I suggest you to try with a minimum template with only the headers (without the PROPERTIES parts). – biocyberman Oct 2 '16 at 8:57
1

I think I found the answer for you. Make sure you have no space(s) before this part in the template definition: %^{prompt|** My Review}. This is because orgmode will retain exact whitespace structure like you instructed in the template. Furthermore, avoid using multiple character in the shortcut key "un" "restaurant" should be something like "u" "restaurant". Actually I could not use that two letters shortcut myself.

  • 1
    thx that worked for me :) – zeltak Oct 2 '16 at 10:48
  • Great to know it worked :) – biocyberman Oct 2 '16 at 10:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.