Search code examples
emacsorg-mode

How to give name to quotation blocks in emacs org-mode


I have created a quote with the following syntax

#+BEGIN_QUOTE
My quote....
#+END_QUOTE

The problem is that in the collapsed view (when only titles and top-level outlines are shown), I see

#+BEGIN_QUOTE...

Which does not properly inform of the content of the quote. Is there a way to give a name or label to the quote so that I can see something like the below instead:

Quote from Jack...

Thank you


Solution

  • You can give names to blocks, whether those blocks are quote blocks, source blocks or any other kind (you can also give names to tables). The advantage is that each quote block can have its own name (in contrast to tags, which apply to a headline, so if you have more than one block in a section, the tag will not disambiguate them). On the other hand, names are more intrusive and to some extent defeat the purpose of collapsing: they are always there whether the block is collapsed or not; tags are more discreet:

    * foo                                                                     :quotes:
    
    #+name: kennedy
    #+begin_quote
    Do not ask what your country can do for you...
    #+end_quote
    
    #+name: lincoln
    #+begin_quote
    Four score and seven years ago...
    #+end_quote
    

    Which one you want to use is up to you (and "both" is also a possibility).