Syntax highlighting within #+begin_src block in emacs orgmode not working

danske picture danske · May 17, 2012 · Viewed 14k times · Source

I have tried many different languages and copied various examples, but none of my code blocks within orgmode get syntax highlighting. 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.

I am using the newest org (7.8.10). Am I missing something here?

Answer

bzg picture bzg · May 17, 2012

Do you have this?

(setq org-src-fontify-natively t)