在组织模式中更改html导出文本的颜色
问题描述:
可以很容易地在.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>
答
你可以使用一个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.)}}}
与限制,即第二个参数不能包含逗号(,也许一些其他字符)。
大把戏!它也适用于[org-reveal](https://github.com/yjwen/org-reveal)。 –
我刚刚发现的一大串宏(颜色,高光,...)在这里:https://github.com/fniessen/org-macros/blob/master/README.org –