使用emacs,我无法在高亮模式下将org文件中的源代码导出到html

时间:2013-09-11 16:57:02

标签: html emacs org-mode

我已经使用了htmlize,这是配置

(add-to-list 'load-path
         "~/.emacs.d/plugins/")
(require 'htmlize)
(setq org-src-fontify-natively t)   
(setq org-export-with-sub-superscripts nil)

使用此配置,导出下面的组织文件后:我得到的输出就像本页底部的图片一样。

#+STYLE: <style> pre.src { background-color:#1e3436; color: #eeeeec;}</style>
*tst code
#+BEGIN_SRC c
 extern struct list_head llc_sap_list;
  int a = 0;
#+END_SRC
#+begin_src c 
 #define LLC_DEST_INVALID         0      /* Invalid LLC PDU type */
 #define LLC_DEST_SAP             1      /* Type 1 goes here */
 #define LLC_DEST_CONN            2      /* Type 2 goes here */


 extern spinlock_t llc_sap_list_lock;

 extern int llc_rcv(struct sk_buff *skb, struct net_device *dev,
        struct packet_type *pt, struct net_device *orig_dev);

 extern int llc_mac_hdr_init(struct sk_buff *skb,
             const unsigned char *sa, const unsigned char *da);

 extern void llc_add_pack(int type, void (*handler)(struct llc_sap *sap,
                        struct sk_buff *skb));
 extern void llc_remove_pack(int type);

 extern void llc_set_station_handler(void (*handler)(struct sk_buff *skb));

 extern struct llc_sap *llc_sap_open(unsigned char lsap,
                 int (*rcv)(struct sk_buff *skb,
                        struct net_device *dev,
                        struct packet_type *pt,
                        struct net_device *orig_dev));
 static inline void llc_sap_hold(struct llc_sap *sap)
 {
     atomic_inc(&sap->refcnt);
 }

 extern void llc_sap_close(struct llc_sap *sap);

#+end_src 

输出html,代码的颜色全部为灰色。 我无法上传,但这个问题在这整个晚上真的阻止了我。谢谢你的帮助。

1 个答案:

答案 0 :(得分:0)

你为什么设置这个?

(setq org-src-fontify-natively t)

我认为你想要相反(这是默认的)。尝试将其设置为nilhtmlize应该启用。

事实上,我认为你甚至不需要

(require 'htmlize)

我已经从ELPA安装了它,所以可能设置了自动加载,但是我的htmlize中没有.emacs的任何引用,它只是有效。“

相关问题