If I write something like *shrug* in org mode, it will be automatically fontified as bold text. How can I prevent that, i.e. actually having *shrug* appear verbatim when exported?


I still want to be able to use bold fontification (without having to change the default star-syntax for bold text), and it should not matter to what file format my org file is exported, e.g. it should work for Markdown as well as HTML export.

This is some important stuff, that is why it is written in bold. But for something else, I have no Idea *shrug*.

  • 1
    If you are exporting this to LaTeX later, you could try \ast{}shrug\ast{} or \star{}shrug\star{}, similar, with HTML you could use entity encoding: &#2a;, or if adding spaces before or after the asterisk is an option, that would work too.
    – wvxvw
    Commented Sep 17, 2015 at 8:41
  • It seems like suvayu's answer of just wrapping it in verbatim markers is what you want. Alternatively, you could modify org-emphasis-alist so that another character is used to bold text.
    – user2699
    Commented Sep 17, 2015 at 15:56
  • Not exactly. =*shrug*= results in the exported HTML to be wrapped in a code-tag, and in markdown has backticks. I want it to be not formatted in any way at all.
    – timor
    Commented Sep 17, 2015 at 16:08
  • Edited question to reflect that changing org-emphasis-alist is not really an option. I don't want to change everything bold that already exists in my .org file.
    – timor
    Commented Sep 17, 2015 at 16:14
  • 2
    The \ast{}shrug\ast{} mentioned by wvxvw is probably your best option. it exports to html as ∗shrug∗ and to latex as $\ast$shrug$\ast$ using the appropriate character entities. org-toggle-pretty-entities displays them as UTF8 characters in the org buffer.
    – mutbuerger
    Commented Sep 17, 2015 at 16:49

4 Answers 4


Using the ZERO WIDTH SPACE unicode char

You can fail the bold emphasis parsing by adding a zero-width space character (indicated by [ZWS] in the below snippets) before the first asterisk or after the second asterisk.

Both of the below snippets exported fine to HTML in my testing:

  • [ZWS] before the first asterisk

    This is some *bold* test and this is ​[ZWS]*not bold*.
  • [ZWS] after the second asterisk

    This is some *bold* test and this is *not bold*​[ZWS].

You can enter the ZERO WIDTH SPACE (unicode name) by doing C-x 8 RET 200b RET.
I use this very often, so I have bound this to C-x 8 0.


As per the discussion on the emacs-org-mode mailing list, using non-ASCII characters for escaping is not recommended; instead org-entities should be used if applicable. I too agreed with that and came up with this another solution that makes inserting org-entities really easy (C-u * in this case).

  • 1
    Technically that is a pretty quick way to solve the problem. Does it rely on org-mode not interpreting the ZWS as whitespace? Also, I fear the solution is non-obvius for other people editing the org file...
    – timor
    Commented Sep 18, 2015 at 7:43
  • 1
    @timor I have brought up this discussion on the [email protected] mailing list. If interested, you can follow/add to the discussion here. Commented Sep 18, 2015 at 18:47
  • @timor, it isn't obvious, but of all the solutions given here it's the only one that works without modifying emacs configuration, so it is the most obvious if you want to share your files.
    – user2699
    Commented Sep 22, 2015 at 14:41
  • @user2699 FWIW, use of org entities in the files will work right away without any user config.. it's just the use of plain ascii \ast{} in the files. My other solution simply makes entering \ast{} faster and easier to remember. Commented Sep 22, 2015 at 14:47
  • The zero width space escape doesn't seem to be working anymore. At least it doesn't stop the bold from being rendered in emacs, which is all I care about. I haven't checked export to HTML.
    – Rob N
    Commented Oct 2, 2022 at 4:20

This answer is inspired after collective suggestions on the emacs-org-mode GNU list to use the org-entity ( C-h i g (org) Special symbols ) \ast{} instead of zero width space characters (which I suggested in my other answer here).

Below is a generic solution where the user does not need to remember the org entities for various symbols. It inserts the org entity (if available) when user does C-u SYMBOL; works for C-u *, C-u /, C-u =, etc.

(defun modi/org-entity-get-name (char)
  "Return the entity name for CHAR. For example, return \"ast\" for *."
  (let ((ll (append org-entities-user
        e name utf8)
    (catch 'break
      (while ll
        (setq e (pop ll))
        (when (not (stringp e))
          (setq utf8 (nth 6 e))
          (when (string= char utf8)
            (setq name (car e))
            (throw 'break name)))))))

(defun modi/org-insert-org-entity-maybe (&rest args)
  "When the universal prefix C-u is used before entering any character,
    insert the character's `org-entity' name if available.

    If C-u prefix is not used and if `org-entity' name is not available, the
    returned value `entity-name' will be nil."
  ;; It would be fine to use just (this-command-keys) instead of
  ;; (substring (this-command-keys) -1) below in emacs 25+.
  ;; But if the user pressed "C-u *", then
  ;;  - in emacs 24.5, (this-command-keys) would return "^U*", and
  ;;  - in emacs 25.x, (this-command-keys) would return "*".
  ;; But in both versions, (substring (this-command-keys) -1) will return
  ;; "*", which is what we want.
  ;; http://thread.gmane.org/gmane.emacs.orgmode/106974/focus=106996
  (let ((pressed-key (substring (this-command-keys) -1))
    (when (and (listp args) (eq 4 (car args)))
      (setq entity-name (modi/org-entity-get-name pressed-key))
      (when entity-name
        (setq entity-name (concat "\\" entity-name "{}"))
        (insert entity-name)
        (message (concat "Inserted `org-entity' "
                         (propertize entity-name
                                     'face 'font-lock-function-name-face)
                         " for the symbol "
                         (propertize pressed-key
                                     'face 'font-lock-function-name-face)

;; Run `org-self-insert-command' only if `modi/org-insert-org-entity-maybe'
;; returns nil.
(advice-add 'org-self-insert-command :before-until #'modi/org-insert-org-entity-maybe)

So when the user types C-u *, \ast{} is inserted and the below message is displayed in the echo area,

Inserted ‘org-entity’ \ast{} for the symbol *.

If org-pretty-entities is set to t above, the inserted \ast{} will be displayed as *.

If an org-entity does not exist for a character X and if the user does C-u X, X is simply inserted 4 times (as C-u would usually do).

  • 1
    This looks really convenient. The one drwaback (in my opinion) that remains, is that the .org file, which does not contain any LaTeX constructs so far, now has bits of non-org-mode syntax (LaTeX) scattered throughout the file. By the way, is there a reason that no construct like \*thisisnotbold\* exists?
    – timor
    Commented Sep 23, 2015 at 7:36
  • 1
    This is org syntax too. Check out the org-entities documentation. Commented Sep 23, 2015 at 10:17

By verbatim, if you actually mean use some markup in the exported LaTeX, then you can just use =*shrug*=. However if you just want it to be exported as *shrug*, and you want to do this all the time, I would recommend filters. If however, you only need this for some instances of *shrug*, you should use the alternative suggested by @wvxvw. You could do this cleanly using macros. Some examples follow.


(defun my-bold (contents backend info)
  (when (org-export-derived-backend-p backend 'latex)
    (replace-regexp-in-string "\\`\\\\textbf{\\(.+\\)}"
                              "\\\\ast{}\\1\\\\ast{}" contents)))

(add-to-list 'org-export-filter-bold-functions 'my-bold)

Essentially the above filter looks for the \textbf{..} markup in the transcoded string, and replaces it with \ast{}..\ast{}, without changing whatever was wrapped inside {..}. I have not tested the regular expression and the replacement string, so there could be mistakes, but you get the idea. Similarly to cover other backends, one can include extra snippets like this:

(when (org-export-derived-backend-p backend 'html)
   (replace-regexp-in-string "<b>\\(.+\\)</b>" "\&#2a;\\1\&#2a;" contents))

Same caveat holds for the regular expression above.


Org source:

#+macro: nobold @@latex:\ast{}$1\ast{}@@ @@html:&#2a;$1&#2a;@@

This text is *bold* this is nobold{{{not}}}

exports to LaTeX as:

This text is \textbf{bold} this is \ast{}not\ast{}

and to HTML as:

This text is <b>bold</b> this is  &#2a;not&#2a;

You can of course add as many backends as you wish to the macro.

Edit: as Kaushal points out in the comments, the export snippet for latex is optional in this case. I however prefer to use them whenever bare latex is involved, since I find it rather difficult to keep track of the list of org-entities and the specific rules behind identifying bare latex in Org source.


  • the filter examples are untested,
  • I don't know any HTML, so there might be some mistakes in the respective bits.
  • Shouldn't this macro definition suffice: #+macro: nobold \ast{}$1\ast{}? ast is one of the members of org-entities list, that specifies what the latex, html, ascii, etc exports should look like: ("ast" "\\ast" t "&lowast;" "*" "*" "*"). The order of elements in that list is "name, LaTeX replacement, LaTeX mathp, HTML replacement, ASCII replacement, Latin1 replacement, utf-8 replacement". Commented Sep 21, 2015 at 3:21
  • @kaushalmodi Yes it would be, however since we already know it is LaTeX, there is no harm in putting it inside a latex snippet. In my experience using snippets is much more robust because of its unambiguity.
    – suvayu
    Commented Sep 21, 2015 at 9:49

This is controlled by the variable org-emphasis-alist, and can be easily modified.

  • Put point over bold text, use command what-cursor-position C-u C-x = to find the face, note that it has property org-emphasis.
  • Call customize-group and search for org-emphasis
  • org-emphasis-alist should show up, with various options for marking text.
  • Delete the entry corresponding to *
  • Apply changes, and restart org-mode or emacs

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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