I'd like to write a concluding email for this thread for future
searchers to find.  This easy solution is brought to you by Eric
Schulte and Christian Moe.

Place the following in your .emacs or init.el file:
;; org-mode color
(org-add-link-type
 "color" nil
 (lambda (path desc format)p
  (cond
   ((eq format 'html)
    (format "<span style=\"color:%s;\">%s</span>" path desc))
   ((eq format 'latex)
    (format "{\\color{%s}%s}" path desc)))))
;; org-mode highlight
(org-add-link-type
 "hl" nil
 (lambda (path desc format)
  (cond
   ((eq format 'html)
    (format "<font style=\"background-color:%s;\">%s</font>" path desc))
   ((eq format 'latex)
    (format "\\colorbox{%s}{%s}" path desc))))) ;; require \usepackage{color}

Examples:
[[color:blue][test this out]]
[[hl:yellow][highlighted text]]

Remarks:
* Pros
  - don't need to modify org-mode source (just edit your .emacs)
  - use the existing links syntax
* Cons
  - cannot be used concurrently or with other formatting
* To Do
  - Hopefully it will be implemented via extensible syntax in the
future ($[options mytext])
  - highlight and color paragraph or region


-- Vinh



On Thu, Aug 5, 2010 at 1:42 PM, Vinh Nguyen <vinhdi...@gmail.com> wrote:
> Dear list,
>
> I was wondering if there is an easy way to markup the color of the
> text for html output (and highlight as well).  When I prepare meeting
> minutes I'd like to color some things and highlight certain things.
> Right now, I am using emphasizing a major portion of the text.  It
> would be great to have colors and highlights to draw attention to
> certain items.
>
> Thanks.
> Vinh

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

Reply via email to