Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/85.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用emacs,我可以';t以突出显示模式将组织文件中的源代码导出为html_Html_Emacs_Org Mode - Fatal编程技术网

使用emacs,我可以';t以突出显示模式将组织文件中的源代码导出为html

使用emacs,我可以';t以突出显示模式将组织文件中的源代码导出为html,html,emacs,org-mode,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) 通过这种配置,在我导出下面的org文件后:我得到的输出如本页底部的图片所示 #+STYLE: <style> pre.src { ba

我已经使用了htmlize,下面是配置

(add-to-list 'load-path
         "~/.emacs.d/plugins/")
(require 'htmlize)
(setq org-src-fontify-natively t)   
(setq org-export-with-sub-superscripts nil)
通过这种配置,在我导出下面的org文件后:我得到的输出如本页底部的图片所示

#+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 
#+样式:pre.src{背景色:#1e3436;颜色:#EEEEE C;}
*tst代码
#+开始
外部结构清单\u head llc\u sap\u清单;
int a=0;
#+结束(SRC)
#+开始
#定义LLC_DEST_无效0/*无效LLC PDU类型*/
#定义LLC_DEST_SAP 1/*此处为类型1*/
#定义LLC_DEST_CONN 2/*此处为类型2*/
extern spinlock\u t llc\u sap\u list\u lock;
extern int llc_rcv(结构sk_buff*skb、结构网络设备*dev、,
结构数据包类型*pt,结构网络设备*orig\U dev);
extern int llc_mac_hdr_init(结构sk_buff*skb,
常量无符号字符*sa,常量无符号字符*da);
extern void llc_add_pack(整型,void(*handler)(结构有限责任公司_sap*sap,
结构sk_buff*skb);
extern void llc_移除_包装(内部型);
extern void llc_set_station_handler(void(*handler)(结构sk_buff*skb));
extern struct llc_sap*llc_sap_open(未签名字符lsap,
int(*rcv)(结构sk_buff*skb,
结构网络设备*dev,
结构包类型*pt,
结构网络(设备*源设备);
静态内联void llc_sap_hold(struct llc_sap*sap)
{
原子公司(sap->refcnt);
}
extern void llc_sap_close(struct llc_sap*sap);
#+结束(src)
输出html时,代码的颜色全部为灰色。
我不能上传,但这个问题真的阻止了我,整个晚上。谢谢你在这方面的帮助

为什么要设置此选项

(setq org-src-fontify-natively t)
我想你想要相反的结果(这是默认值)。尝试将其设置为
nil
,并且
htmlize
应该生效

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

(require 'htmlize)

我从ELPA安装了它,因此可能设置了自动加载,但我在
.emacs
中没有任何对
htmlize
的引用,它“正常工作。”

您是在运行非GUI版本的emacs时偶然导出它的吗?因为在这种情况下,字体化级别是最小的,而且从不着色。你使用的是什么版本的组织模式?事实上,在我向谷歌寻求帮助并获得htmlize的需求之前,我没有在我的.emacs中添加anthing,突出显示不起作用,所以我去谷歌寻求帮助。然后我将这些配置添加到.emacs中。