2017-08-09 83 views
3

可以很容易地在.org文件中指定文本修飾符,如粗體,斜體,刪除線等(see link)。在組織模式中更改html導出文本的顏色

同樣,有沒有什麼方法可以爲.org文件的一小部分指定文本顏色,以便文本在導出的html文件中被適當着色?我認爲這在快速突出顯示的筆記中會非常有用。

預期的行爲:

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>

回答

3

你可以使用一個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.)}}} 

與限制,即第二個參數不能包含逗號(,也許一些其他字符)。

+0

大把戲!它也適用於[org-reveal](https://github.com/yjwen/org-reveal)。 –

+0

我剛剛發現的一大串宏(顏色,高光,...)在這裏:https://github.com/fniessen/org-macros/blob/master/README.org –