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

后端 未结 2 1640
醉话见心
醉话见心 2020-12-24 06:37

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:



        
相关标签:
2条回答
  • 2020-12-24 07:19

    I had a similar problem where despite adding htmlize.el, I couldn't get the code syntax highlighting when exporting to html. I then found this very useful post and just followed the steps:

    Syntax highlighting R code in WordPress using Emacs

    Just to reiterate the steps:

    1. I copied the htmlize.el in ~/.emacs.d/ directory
    2. In org mode, typed M-x byte-compile-file and navigate to the directory where the htmlize.el is located, select it and press enter. This will compile the htmlize.el file.
    3. Restart emacs and export a file with code block in it. The exported html file will now have syntax highlighted code.
    0 讨论(0)
  • 2020-12-24 07:21

    Do you have this?

    (setq org-src-fontify-natively t)
    
    0 讨论(0)
提交回复
热议问题