5

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?

Pushpendre
  • 351
  • 2
  • 7
  • There is an [overline face attribute](http://www.gnu.org/software/emacs/manual/html_node/elisp/Face-Attributes.html), but you'd need to extend `org` with [more markups](http://emacs.stackexchange.com/questions/12814/extending-org-mode-with-more-markups) to get it to work. [This answer](http://emacs.stackexchange.com/a/12822/253) appears to offer a roadmap to doing so. – Dan Feb 16 '16 at 16:01

1 Answers1

1

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)))))
serv-inc
  • 816
  • 6
  • 26