[英]Syntax highlighting within #+begin_src block in emacs orgmode not working
I have tried many different languages and copied various examples, but none of my code blocks within orgmode get syntax highlighting. 我尝试了很多不同的语言并复制了各种示例,但orgmode中的代码块都没有得到语法高亮。 Here is what I'm trying:
这是我正在尝试的:
#+begin_src python
def main():
print "Hello %s" % ("what's the problem")
#+end_src
#+begin_src c++
for (int i = 0; i < 30; i++)
{
cout << "Hello" << endl;
}
#+end_src
When exported to HTML, it shows up in a source code block, but with no highlighting there either. 导出到HTML时,它会显示在源代码块中,但也没有突出显示。
I am using the newest org (7.8.10). 我正在使用最新的组织(7.8.10)。 Am I missing something here?
我在这里错过了什么吗?
你有这个吗?
(setq org-src-fontify-natively t)
I had a similar problem where despite adding htmlize.el, I couldn't get the code syntax highlighting when exporting to html. 我有一个类似的问题,尽管添加了htmlize.el,但是在导出到html时我无法获得代码语法突出显示。 I then found this very useful post and just followed the steps:
然后我发现这个非常有用的帖子,只是按照步骤:
Syntax highlighting R code in WordPress using Emacs 使用Emacs在WordPress中突出显示R代码的语法
Just to reiterate the steps: 只是重申一下步骤:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.