我正在使用org模式进行代码doc,文字编程等。
使用最近的org-mode(版本> = 9.1)我注意到导出的html页面发生了变化:
添加了一些水平线。
问题在于我发现这些额外的行非常难看,而且他们使代码的可读性降低。
我的问题:是否有可能删除这些行以获得旧样式?
要重现:
组织模式:
最小test.org
组织模式文件:
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="http://orgmode.org/worg/style/worg.css"/> #+HTML_HEAD: <style type="text/css">body{ max-width:80%; }</style> * Some code #+BEGIN_SRC cpp :eval never template <typename ELEMENT_TYPE, typename DERIVED> class Memory_Interface : public StaticInterface_Base<DERIVED> { public: using SelfType = Memory_Interface; using StaticInterface_Base<DERIVED>::impl; // ... }; #+END_SRC
从emacs使用通常的C-c C-e h o
导出html页面
答案 0 :(得分:3)
查看源代码:ox-html.el我找到了这个可自定义的变量:
(defcustom org-html-keep-old-src nil
"When non-nil, use <pre class=\"\"> instead of <pre><code class=\"\">."
:group 'org-export-html
:package-version '(Org . "9.1")
:type 'boolean)
当使用 org-mode version&gt; = 9.1 时,如果您仍想像以前一样导出代码块(没有所有这些水平线)解决方案是自定义此变量并设置它 true :
(setq org-html-keep-old-src t)