How to add some text between source code and results exports to PDF?

Whenver I want to export a source code block with it's results, I want to add some text in-between, e.g. "Output:", because otherwise is very hard for the reader to understand where the program ends and the output begins - how do I achieve adding "Output:" in-between?

Example:


* Test
  #+BEGIN_SRC python :results output :exports both
i = 5
print i
i = i + 1
print i

s = '''This is a multi-line string.
This is the second line.'''
print s
  #+END_SRC

  #+RESULTS:
  : 5
  : 6
  : This is a multi-line string.
  : This is the second line.

Answers


You need to name your source code block. Then, and only then, you can put your results part wherever you want, even before the source code block.

EDITED (add ECM):

#+name: my-block
#+begin_src emacs-lisp
(message "hello")
#+end_src

I can put paragraphs here...

#+results: my-block
: hello

Need Your Help

visual basic web browser links - perform action in program when clicked

html vba web

I have a web browser form inside my program, that displays a custom html page. When I click on the link, instead of going to another page, I would like it to do something in the program (tell the p...

Spring templates: how to execute multiple SQL statements?

mysql sql spring transactions spring-jdbc

I want to execute some SQL code (on MySQL) that looks like this (it's not a stored procedure):