How to avoid a new paragraph after a block of code in Org mode?

When Org-mode exports to LaTeX, it creates a new paragraph after blocks of code. How can i avoid this?

Consider the following example:

#+TITLE: Example #+BEGIN_SRC emacs-lisp (setq foo "bar") #+END_SRC A paragraph contains some text and this text only serves as example text. #+BEGIN_SRC emacs-lisp (setq bar "foo") #+END_SRC 

It is exported to the next LaTeX

 \begin{verbatim} (setq foo "bar") \end{verbatim} A paragraph contains some text and this text only serves as example text. \begin{verbatim} (setq bar "foo") \end{verbatim} 

which is displayed as

The output I get

Please note that the text after the first code block is set as a new paragraph. I do not want it to be set as a new paragraph. I want it to be set as

The output I want

which is the result of:

 \begin{verbatim} (setq foo "bar") \end{verbatim} A paragraph contains some text and this text only serves as example text. \begin{verbatim} (setq bar "foo") \end{verbatim} 

I am running Org-mode 7.6 on Emacs 23.3.1.

+6
source share
2 answers

This does not seem to be a problem in Org 7.8.03 . Testing your exact code block provides the following output

organization
 #+TITLE: Example #+BEGIN_SRC emacs-lisp (setq foo "bar") #+END_SRC A paragraph contains some text and this text only serves as example text. #+BEGIN_SRC emacs-lisp (setq bar "foo") #+END_SRC 
Latex
 \begin{verbatim} (setq foo "bar") \end{verbatim} A paragraph contains some text and this text only serves as example text. \begin{verbatim} (setq bar "foo") \end{verbatim} 
Conclusion

Output result

+2
source

I'm afraid this is not the solution you want, but in any case, you can set the indentation manually using

 #+BEGIN_SRC emacs-lisp (setq foo "bar") #+END_SRC #+LATEX:\noindent A paragraph contains some text and this text only serves as example text. #+BEGIN_SRC emacs-lisp (setq bar "foo") #+END_SRC 
+2
source

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


All Articles