From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: Arbitrary colouration of words/sentences etc. in HTML export? Date: Tue, 21 Aug 2012 10:05:46 -0600 Message-ID: <87obm4w7qd.fsf@gmx.com> References: <44B0EAE8544C834188E8790873CDE1CC226BF8F8@ARCEXCHANGE.arc.local> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:39502) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T3qz2-0005DX-AU for emacs-orgmode@gnu.org; Tue, 21 Aug 2012 12:07:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T3qz0-00052B-SF for emacs-orgmode@gnu.org; Tue, 21 Aug 2012 12:07:12 -0400 Received: from mailout-us.gmx.com ([74.208.5.67]:57843) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1T3qz0-00051x-Lg for emacs-orgmode@gnu.org; Tue, 21 Aug 2012 12:07:10 -0400 In-Reply-To: <44B0EAE8544C834188E8790873CDE1CC226BF8F8@ARCEXCHANGE.arc.local> (Jos'h Fuller's message of "Tue, 21 Aug 2012 15:38:52 +0000") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Jos'h Fuller Cc: "emacs-orgmode@gnu.org" Jos'h Fuller writes: > Hi! > > Is there any good quick and /simple/ way to drop an arbitrary colour on a sequence of characters that will show up in the exported HTML page? > > I have introduced a colleague to org-mode for generating > documentation, however they want to use multiple colours to highlight > different terms. Adding a CSS style rule for *bold* is OK, but it > would be nice to do other colours without rendering the other common > styles (/i/, _underscore_, etc.) useless. Something like: > > #+HTML: > Greenword > #+HTML: > > or even this: > > @ Greenword @ > > is far too clumsy. Especially since they're using it partly so they don't have to deal with HTML. > > Any better way to do this? > Hi Jos'h, Add the following to your Emacs config, ;; -*- emacs-lisp -*- (org-add-link-type "color" (lambda (path) (message (concat "color " (progn (add-text-properties 0 (length path) (list 'face `((t (:foreground ,path)))) path) path)))) (lambda (path desc format) (cond ((eq format 'html) (format "%s" path desc)) ((eq format 'latex) (format "{\\color{%s}%s}" path desc))))) and then you can use [[color:red][in red]] for colored export. Best, -- Eric Schulte http://cs.unm.edu/~eschulte