From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jos'h Fuller Subject: Re: Arbitrary colouration of words/sentences etc. in HTML export? Date: Tue, 21 Aug 2012 16:28:13 +0000 Message-ID: <44B0EAE8544C834188E8790873CDE1CC226BF91F@ARCEXCHANGE.arc.local> References: <44B0EAE8544C834188E8790873CDE1CC226BF8F8@ARCEXCHANGE.arc.local> <87obm4w7qd.fsf@gmx.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:47262) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T3rHB-0002YL-Nn for emacs-orgmode@gnu.org; Tue, 21 Aug 2012 12:25:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T3rHA-0002IQ-77 for emacs-orgmode@gnu.org; Tue, 21 Aug 2012 12:25:57 -0400 Received: from mail.arcproductions.com ([206.191.120.230]:43877) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T3rHA-0002Hl-1X for emacs-orgmode@gnu.org; Tue, 21 Aug 2012 12:25:56 -0400 In-Reply-To: <87obm4w7qd.fsf@gmx.com> Content-Language: en-US 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: Eric Schulte Cc: "emacs-orgmode@gnu.org" Perfect! Thanks /very/ much! ___________________________________________________________________________= ____ Jos'h Fuller, Production Programmer Arc Productions Ltd. =20 p: 416.682.5237 | f: 416.682.5209 | http://www.arcproductions.= com=20 230 Richmond Street East | Toronto, ON M5A 1P4 | > -----Original Message----- > From: Eric Schulte [mailto:eric.schulte@gmx.com] > Sent: Tuesday, August 21, 2012 12:06 PM > To: Jos'h Fuller > Cc: emacs-orgmode@gnu.org > Subject: Re: [O] Arbitrary colouration of words/sentences etc. in HTML > export? >=20 > Jos'h Fuller writes: >=20 > > 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? > > >=20 > Hi Jos'h, >=20 > Add the following to your Emacs config, >=20 > ;; -*- 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))))) >=20 > and then you can use [[color:red][in red]] for colored export. >=20 > Best, >=20 > -- > Eric Schulte > http://cs.unm.edu/~eschulte