Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

org-mode how to hide tag name when exporting

Tags:

emacs

org-mode

I have an org document with tags. However, when exporting it, the tag name is also exported. Is there a way to hide the tag name in the exported document?

    #+TITLE:     tag issue
    #+AUTHOR:    someone


    * First section
    ** sub
    bla bla bla
    ** second                                                                :incomplete:
    bla        

Exported document: enter image description here

like image 671
GP. Avatar asked May 25 '18 14:05

GP.


1 Answers

You can define how you want to export tags thanks to the org-export-with-tags variable:

org-export-with-tags is a variable defined in ‘ox.el’. Its value is t

This variable is safe as a file local variable if its value
satisfies the predicate which is a byte-compiled expression.

Documentation: If nil, do not export tags, just remove them from headlines.

If this is the symbol ‘not-in-toc’, tags will be removed from table of contents entries, but still be shown in the headlines of the document.

This option can also be set with the OPTIONS keyword, e.g. "tags:nil".

In your case if you do not want to export tags, simply use the option:

#+OPTIONS: tags:nil

Your complete example is thus:

#+OPTIONS: tags:nil
#+TITLE:     tag issue
#+AUTHOR:    someone


* First section
** sub
   bla bla bla
** second                                                        :incomplete:
   bla     

(before exporting with C-e C-c p o, do not forget to type C-c C-c over the line #+OPTIONS: ... to tell to emacs to refresh the setting)

You will get:

enter image description here


note: you can find other useful options here

like image 79
Picaud Vincent Avatar answered Sep 25 '22 04:09

Picaud Vincent