Table of Contents

  1. Properties in org-mode
    1. Properties in org-mode
      1. Problem - the beggining
      2. Problem extension
    2. Solution
    3. Useful links:

TODO Properties in org-mode

Properties in org-mode

Problem - the beggining

Let’s say we’ve got the following org file

* Headline 1 with name taken from properties - src_elisp{(org-entry-get nil "Name")}
:PROPERTIES:
:Title:     Goldberg Variations
:Name:  J.S. Bach
:END:

** SubHeadline 

Since properties are not inherited by default we cannot add src_elisp{(org-entry-get nil "Name")} in the subheadline, because it ends with an error.

But we can turn the properties inheritance on like below (Do observe the usage of 'selective flag - without it the example wouldn’t work!):

# -*- mode: Org; org-use-property-inheritance: t -*- 
* Headline 1 with name taken from properties - src_elisp{(org-entry-get nil "Name")}
:PROPERTIES:
:Title:     Goldberg Variations
:Name:  J.S. Bach
:END:

** SubHeadline  - src_elisp{(org-entry-get nil "Name" 'selective)}
  1. How to selectively inherit properties?

Problem extension

Now we would like to keep properties in a different files and treat it as some kind of database

:PROPERTIES:
:Title: Some New Title
:Name:  Newman
:END:

:PROPERTIES:
:Title: Title22222
:Name:  Name22222
:END:
  1. Approach 1

    This won’t work:

    # -*- mode: Org; org-use-property-inheritance: t -*- 
    * Headline 1 with name taken from properties - src_elisp{(org-entry-get nil "Name")}
    #+INCLUDE: ./properties.txt
        
    ** SubHeadline  - src_elisp{(org-entry-get nil "Name" 'selective)}
    
  2. Approach 2

    This does work but it’s less convenient:

    # -*- mode: Org; org-use-property-inheritance: t -*- 
    * Headline 1 with name taken from properties - src_elisp{(org-entry-get nil "Name")}
    #+INCLUDE: ./properties.txt
        
    ** SubHeadline  - src_elisp{(org-entry-get nil "Name" 'selective)}
    #+INCLUDE: ./properties.txt
    

Solution

It seems that 1.1.2.1 does not work because Subheadline has no content. If we add any latex white space or subsubheadline inside subheadline everything works ok.

  1. Approach 4

    This does work but it’s less convenient:

    ,# -*- mode: Org; org-use-property-inheritance: t -*- 
    * Headline 1 with name taken from properties - src_elisp{(org-entry-get nil "Name")}
    #+INCLUDE: ./properties.txt
        
    ** SubHeadline  - src_elisp{(org-entry-get nil "Name" 'selective)}
    \nbsp{}
        
    # # The lines below wouldn't work
    #** SubHeadline  - src_elisp{(org-entry-get nil "Name" 'selective)}
    #** SubHeadline