Change text color in html export from org-mode

It is very easy to specify text modifiers like bold, italic, strikethrough, etc. in the .org file ( see link ).

Likewise, is there a way to specify the text color for only a small section of the .org file so that the text is colored appropriately in the exported html file? I think this would be very helpful when quickly highlighting a note.

Expected Behavior:

This is a sample sentence in normal text color.
<font color="red">
This is a sample sentence in red text color.
</font>
<font color="green">
This is a sample sentence in green text color.
</font>
      

Run code


+3


source to share


1 answer


You can use macro :

#+MACRO: color @@html:<font color="$1">$2</font>@@

* This is a test

This is a sample sentence in normal text color.

{{{color(red,This is a sample sentence in red text color.)}}}

{{{color(green,This is a sample sentence in green text color.)}}}

      



with the restriction that the second argument cannot contain a comma (and possibly some other characters).

+4


source







All Articles