16

Given the following is intended to generate C++ code:

#+BEGIN_SRC python :exports both :results output code
print "struct Whatever{};"
#+END_SRC

The result is inserted as follows:

#+RESULTS:
#+BEGIN_SRC python
struct Whatever{};
#+END_SRC

Which is clearly not formatted as C++. How could I get it so that org generates the following:

#+RESULTS:
#+BEGIN_SRC c++
struct Whatever{};
#+END_SRC

Thanks

1 Answer 1

18

Figured it out:

#BEGIN_SRC python :exports both :results output code :wrap "SRC c++"
1
  • 1
    The documentation about this is now at orgmode.org/manual/… Commented Dec 7, 2021 at 16:44

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.