emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Pretty org-entities in org-mode buffers


From: Daniel E. Doherty
Subject: Re: [Orgmode] Pretty org-entities in org-mode buffers
Date: Sat, 05 Jun 2010 13:36:15 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100423 Thunderbird/3.0.4

Eric and Carsten,

This is a really swell feature, Mr. Cleaver. Just a reminder to those who might be reading this list, enabling CDLateX and org-pretty-entities make typing greek characters *really* easy. Backquote a (`a) is enough to give you alpha, `b beta, etc.

These two features work really nicely together.

Regards,

====================================================
Daniel E. Doherty
7300 W. 110th Street, Suite 930
Overland Park, KS 66210
913.338.7182 (Phone)
913,338.7164 (FAX)

Up the airy mountain,
Down the rushy glen,
We daren't go a-hunting,
For fear of little men.
          --- William Allingham (Donegal, Ireland)

On 05/16/2010 12:51 AM, Carsten Dominik wrote:
Hi everyone,

a modified version of Eric's code is now included into Org, I just
pushed it
to the git repo.

You can use the command `C-c C-x \' to toggle this feature.

The variable `org-pretty-entities' determines if this mode is on by
default.

Finally, you can use

#+STARTUP: entitiespretty
#+STARTUP: entitiesplain

to change things on a per-file base.

Thanks to Eric for this great idea.

- Carsten

On May 5, 2010, at 6:19 PM, Eric Schulte wrote:

Hi,

Recently I've been making use of org-entites for exporting my greek/math
heavy class notes to HTML. I'm really loving the results.

This morning I've started playing around with the below function
`org-pretty-entities', which is adapted from Phil Hagelberg's
`pretty-lambdas'[1]. Calling this function in an org-mode buffer will
have the effect of fontifying all org-entities text strings as the
character which they represent, so \Delta is replaced with Δ, \lambda
with λ, \in with ∈, and so forth.

I've just started playing with this, and I make no guarantees as to it's
safety or utility, but I was very pleasantly surprised by the simplicity
of the function, and how nice it's been to see my special characters
appear in org-mode buffers as I type.

#+begin_src emacs-lisp :results silent
(defun org-pretty-entities ()
(interactive)
(font-lock-add-keywords
nil (mapcar
(lambda (el)
(list
(concat "(?\\(" (regexp-quote "\\") (nth 0 el) "[\s]" "\\)")
`(0 (progn (compose-region (match-beginning 1) (- (match-end 1) 1)
,(nth 6 el)) nil))))
org-entities)))

(org-pretty-entities)
#+end_src

To try this out, just evaluate the above code block inside of an
org-mode buffer, then starting typing out org-entities.

Hope others find this useful.

Best -- Eric

Footnotes:
[1]
http://github.com/technomancy/emacs-starter-kit/blob/master/starter-kit-defuns.el#L135



_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
address@hidden
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

- Carsten




_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
address@hidden
http://lists.gnu.org/mailman/listinfo/emacs-orgmode



reply via email to

[Prev in Thread] Current Thread [Next in Thread]