emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org text color highlights fails
@ 2010-11-04 15:13 Marvin Doyley
  2010-11-04 15:29 ` Christian Moe
  0 siblings, 1 reply; 3+ messages in thread
From: Marvin Doyley @ 2010-11-04 15:13 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 933 bytes --]

Hi there,

There have been some useful discussions on changing text color in org mode,
a very useful feature when editing manuscripts.
Anyway, I tried the following function without any success. No change in
color, it just behave like a normal link (i.e, underlined). Could someone
shed some light on what I am doing wrong ?

Cheers,

M

;; 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]]

[-- Attachment #1.2: Type: text/html, Size: 1171 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: org text color highlights fails
  2010-11-04 15:13 org text color highlights fails Marvin Doyley
@ 2010-11-04 15:29 ` Christian Moe
  2010-11-04 16:04   ` Marvin Doyley
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Moe @ 2010-11-04 15:29 UTC (permalink / raw)
  To: Marvin Doyley; +Cc: emacs-orgmode

Hi,

You are not doing anything wrong.

The below solution only changes color in exported text (HTML, Latex).

It doesn't put different faces on different link types in the Org 
buffer. So it's not a great help in editing.

Yours,
Christian Moe

On 11/4/10 4:13 PM, Marvin Doyley wrote:
> Hi there,
>
> There have been some useful discussions on changing text color in org
> mode, a very useful feature when editing manuscripts.
> Anyway, I tried the following function without any success. No change
> in color, it just behave like a normal link (i.e, underlined). Could
> someone shed some light on what I am doing wrong ?
>
> Cheers,
>
> M
>
> ;; 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]]
>
>
>
>
> _______________________________________________
> 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


-- 

Christian Moe
E-mail:  mail@christianmoe.com
Website: http://christianmoe.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: org text color highlights fails
  2010-11-04 15:29 ` Christian Moe
@ 2010-11-04 16:04   ` Marvin Doyley
  0 siblings, 0 replies; 3+ messages in thread
From: Marvin Doyley @ 2010-11-04 16:04 UTC (permalink / raw)
  To: mail; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 2117 bytes --]

I see,

Does anybody know how to change text color in the Org buffer ?

for what it is worth I currently use the following for marking up my
students latex file

#+Latex_header:\newcommand{\insertt}[1]{\textcolor{blue}{#1} }     ; Insert
the following text
#+Latex_header:\newcommand{\delete}[1]{\sout{\textcolor{red}{#1}} }; delete
the following

thanks
M

On Thu, Nov 4, 2010 at 11:29 AM, Christian Moe <mail@christianmoe.com>wrote:

> Hi,
>
> You are not doing anything wrong.
>
> The below solution only changes color in exported text (HTML, Latex).
>
> It doesn't put different faces on different link types in the Org buffer.
> So it's not a great help in editing.
>
> Yours,
> Christian Moe
>
>
> On 11/4/10 4:13 PM, Marvin Doyley wrote:
>
>> Hi there,
>>
>> There have been some useful discussions on changing text color in org
>> mode, a very useful feature when editing manuscripts.
>> Anyway, I tried the following function without any success. No change
>> in color, it just behave like a normal link (i.e, underlined). Could
>> someone shed some light on what I am doing wrong ?
>>
>> Cheers,
>>
>> M
>>
>> ;; 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]]
>>
>>
>>
>>
>> _______________________________________________
>> 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
>>
>
>
> --
>
> Christian Moe
> E-mail:  mail@christianmoe.com
> Website: http://christianmoe.com
>
>

[-- Attachment #1.2: Type: text/html, Size: 3205 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-11-04 16:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-04 15:13 org text color highlights fails Marvin Doyley
2010-11-04 15:29 ` Christian Moe
2010-11-04 16:04   ` Marvin Doyley

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).