Michel Damiens <michel.dami...@gmail.com> writes:

> Hello,
>
> I would like to export and org file in such a way that :
> - only tagged subtrees are exported (for a specific tag)
> - the tree structure is "flattened"
>
> for example a file example.org containing :
> * heading 1                                   :tag:
>       ** subheading 1.1
>               content 1.1
>       ** subheading 1.2                       :tag:
>               content 1.2
> *heading 2
>       ** subheading 2.1                       :tag:
>               content 2.1
>         ** subheading 2.1.1           :tag:
>         ** subheading 2.1.2   :tag:
>          content 2.1.2
>       ** subheading 2.2
>       content 2.2
>
> would be exported to the file example.org.org containing :
> * heading 1
> * subheading 1.2
>       content 1.2
> * subheading 2.1
>       content 2.1
> * subheading 2.1.1
> * subheading 2.1.2
>       content 2.1.2
>
> (which in turn would be exported to latex, beamer or html for example)

The first part you can archive with these tags:

    #+SELECT_TAGS:, #+EXCLUDE_TAGS:
        These lines provide settings for exporting files. For more details see 
Export settings .

Flatting the file can be done by search and replace

(while (search-forward-regexp "^*+ " nil t)
    (replace-match "* "))

Rasmus

-- 
ツ


Reply via email to