8

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

9
  • You mean C-c C-e h, right ? (Not being sure, I didn't edit that) This footnote suggests you probably need to upgrade htmlize, and that upgrading org would do. Is that your answer ? (I have no idea how much the legacy exporter handles html inline code blocks, but maybe the new exporter does a better job with them.) Commented Oct 22, 2012 at 2:34
  • @LeVieuxGildas Yes. It's C-c C-e h. I edited and corrected it. As I understand from the footnote, htmlize package 1.34 version should be built in org. Commented Oct 22, 2012 at 2:44
  • Probably built-in in the most up-to-date version, maybe not in the bundled one you've got. Commented Oct 22, 2012 at 2:45
  • @LeVieuxGildas You are right. The built-in version is 7.8.11. And I upgraded org-mode to 7.9.2, the latest version, but it does not help. Same message about htmlize showed up. Commented Oct 22, 2012 at 3:07
  • It's in contrib, which for sure is added in your lisp path? Didn't forget to org-reload? I fall short of ideas at this point… Commented Oct 22, 2012 at 4:54

2 Answers 2

8

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.

Sign up to request clarification or add additional context in comments.

Comments

3

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.

1 Comment

You can make this the default for all inline code blocks by adding the following to the top of your org file: #+PROPERTY: header-args :exports code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.