I have this in my org-mode file:
This is how we define a function:
#+BEGIN_SRC ruby :tangle hello.rb
def hello
puts 'Hello world!'
end
#+END_SRC
And this is how we call it:
#+BEGIN_SRC ruby :tangle hello.rb
hello
#+END_SRC
However, when I use org-babel-tangle
it appears like this in the file:
[blank line]
def hello
puts 'Hello world!'
end
[blank line]
hello
[blank line]
How do I get it so all the blank lines do not appear?
The way to suppress the extra blank lines that appear around the exported source code is to use the header argument
padline
. Set it tono
and it will not add blank lines.With the above example, you would do this:
If you are within a heading, you can use the
#+PROPERTY
setting to set this up for all source code blocks within the buffer or for just the sub-heading with the following: