Exporting inline code to html in org-mode

只谈情不闲聊 提交于 2019-12-06 01:54:22

问题


What I want in org-mode is like the inline code block syntax in Markdown language X <- 3. I googled and attempted (reference):

src_R{X <- 3}

inline in org-mode, but exporting to html (with C-cC-eh) did not show the inline code. Other code block like #+begin_src R stuff works fine, but anyhow there is a warning message while exporting:

htmlize.el 1.34 or later is needed for source code formatting [14 times]

Could that be the reason ?

Update:

Thanks for @LeVieuxGildas opinion, I installed and loaded the latest htmlize.el version 1.43 now and did not get any error message when exporting. But still exporting html can not show inline code part.

system: OS X 10.8.2 ; emacs mac port https://github.com/railwaycat/emacs-mac-port ; built-in org-mode


回答1:


I think we are talking about two things here. If you want to just "show code" like the backticks in Markdown, surround your inline code with equal signs, as in:

Write messages in JavaScript using: =console.log(x, y)=

However, using the src_XYZ{abc} attempts to evaluate that as code and return the results.




回答2:


Fast and dirty solution is to modify the header arguments in your previous inline code.

src_R[:exports code]{X <- 3}

In my opinion, inline code is much better than =code= or ~code~ because it can be syntax highlighted if you output your org file as Latex file.



来源:https://stackoverflow.com/questions/13003895/exporting-inline-code-to-html-in-org-mode

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!