2

I am using org-mode to make a Beamer LaTeX presentation, which then gets rendered to PDF.

Here is the part I am having trouble with:

* Vectors in Ruby (components)
- a Vector can be added to another vector
- a Vector can be multiplied by a scalar
#+begin_src ruby
class Vector
  def +(vector)
    Vector.new(components.zip(vector.components).map {|(vi,wi)| vi+wi })
  end

  def *(scalar)
    Vector.new(components.map{|c| scalar*c })
  end
end
#+end_src

When I run org-export-dispatch and render to PDF, here's what the methods look like:

enter image description here

I checked in the intermediate .tex file and the Vector lines have a tab indentation instead of space. It is inside a \begin{minted} block.

How can I fix this indentation?

2

In order to ensure that source code formatting is preserved in exports from Org-mode, set the variables org-src-preserve-indentation to 't', and indent-tabs-mode to 'nil' using customize-variable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.