Export embedded code in html in org-mode

What I want in org-mode is similar to the syntax of the built-in code block in Markdown X <- 3 . I googled and tried ( link ):

 src_R{X <- 3} 

inline in org-mode, but exporting to html (with Cc Ce h ) does not display inline code. Another code, such as #+begin_src R , works fine, but when exporting during export, a warning message appears:

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

Could this be the reason?

Update:

Thanks for the opinion of @LeVieuxGildas, I installed and downloaded the latest version of htmlize.el version 1.43 and did not receive any export error message. But still, the html export cannot display part of the embedded code.

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

+4
source share
2 answers

I think we are talking about two things here. If you just want to β€œshow the code” as the reverse steps in Markdown, surround your inline code with equal signs, as in:

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

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

+5
source

A quick and dirty solution is to change the header arguments in the 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 a Latex file.

+2
source

Source: https://habr.com/ru/post/1441171/


All Articles