# Easiest way to render an overline in org mode?

Org mode has support for showing unicode in place of latex commands through org-pretty-entities. Org mode also has support for underlining through font locks that are activated through the _ character. If everything fails then I can directly input unicode characters through the character viewer (on OSX).

However, I have never been able to get emacs to render overlines or characters with bars on top, e.g. ̅B , using any of the above three methods. Is there a way to show such characters in org-mode? Can font-lock automatically render code like \bar{B} as ̅B ?

UPDATE: Thanks to the comment I made partial progress. By adding ("̅" (:overline t)) to org-emphasis-alist barber is rendered with a bar/overline when I enter C-x 8 RET 0 3 0 5 RET barber C-x 8 RET 0 3 0 5 RET .

But what I'd really like is to just enter, \bar{barber} to toggle its overline attribute. Is this possible?

I hadn't read the update completely. It seems as though you might be able to get \bar{ to start the fontification, but to get } to stop it might be harder.

As an alternative (if you would like latex support), you might be able to control the export to LaTeX to output \bar{ and }.

Old answer (just the formatting): You provided everything needed: just add the item

("!" (:overline t) verbatim))


to your org-emphasis-alist. This makes !barber! appear with overline.

Example from .emacs

(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(org-emphasis-alist
(quote
(("*" bold)
("/" italic)
("_" underline)
("=" org-verbatim verbatim)
("~" org-code verbatim)
("+"
(:strike-through t))
("!"
(:overline t)
verbatim)))))