如何指定Emacs組織模式在將文件導出爲HTML時應使用的文本的顏色?將組織模式導出爲HTML:就地着色
例如
* Here is one bullet
** Here is another bullet
Here is some text that I want in BOLD RED
Here is some other text that I want in the default face
如何指定Emacs組織模式在將文件導出爲HTML時應使用的文本的顏色?將組織模式導出爲HTML:就地着色
例如
* Here is one bullet
** Here is another bullet
Here is some text that I want in BOLD RED
Here is some other text that I want in the default face
你不說,如果這是一個一次性的或沒有。如果你需要樣式,css樣式表是有意義的。只是做了什麼你描述一次,就可以包括紅在您的組織文件的HTML指令,如下所示:
Here is some text that I want in *@@html:<font color = "red">@@BOLD [email protected]@html:</font>@@*
請參閱部分引用HTML標籤在組織手冊。
您可以通過使用HTML HEAD選項鍊接到您導出的HTML文檔中的自定義CSS樣式表:
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="style1.css" />
看看導出HTML並獲得分配給不同的組織類水平,你應該能夠立刻把一個相當簡單的樣式表放在一起。有一個在這裏的一個很好的例子:https://gist.github.com/mowen/326524
這裏是一個參考:http://orgmode.org/manual/CSS-support.html#CSS-support
傑弗裏給出了答案。但是,要添加額外的信息,請知道我正忙於在GitHub上製作組織宏項目,目的是使此類行爲輕而易舉。
該項目仍處於草案狀態(宏將無法正確導出到LaTeX),完整的文檔尚不可用(雖然沒問題,但您應該查看組織的真實用法語法源),但是如果您克隆https://github.com/fniessen/org-macros,則應該能夠使用「bgcolor」,「color」或「highlight」宏(在組織文檔中包含org-macros.setup文件之後)。
你可以寫成:
INCLUDE: path/to/org-macros.setup
Here is some text that I want in *{{{color(red, BOLD RED)}}}*.
當我將在完成狀態的宏,他們會爲HTML和LaTeX(至少)工作。
另一種方式。
* Here is one bullet
** Here is another bullet
#+begin_html
Here is some text that I want in <span style='color:red'>BOLD RED</span>
#+end_html
Here is some other text that I want in the default face
此解決方案受限於您無法使用大塊文本代替'BOLD RED'。也許在宏中有一個參數長度限制。 –
我同意這不是大塊文本或幾段文字的最佳方式。 – fniessen
在這種情況下,您最好使用特殊塊,如#+ begin_bgcolor ..#+ end_bgcolor,並在LaTeX/HTML /等中定義它們。 – fniessen