1

Open your EMACS -Q, enter org mode, and

#+begin_src emacs-lisp

  (setf x '(a b c
              d e f))

#+end_src             

This is how it will be aligned after org-edit-special (C-c ').

Now export to an ASCII buffer with C-c C-e t A. You will see

,----
| 
| (setf x '(a b c
|           d e f))
| 
`----

Clearly, the indentation has changed. How does one get indentation as in the source?


P.S.

This does not happen when exporting to a LaTeX buffer. It seems to be a bug resulting from the use of tab characters and the insertion of two extra characters at the beginning of each source line. I suppose plain-text export isn't used that much.

1 Answer 1

0

Just see to it that the whole buffer is free of tabulators before you export it. To avoid untabbing the original, use a hook.

    (defun org*-export-untabify (backend)
      (untabify 0 (point-max)))

    (add-hook 'org-export-before-parsing-hook 'org*-export-untabify)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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