emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Preservation of white space in babel blocks, exporting to PDF


From: John Hendy
Subject: Re: [O] Preservation of white space in babel blocks, exporting to PDF
Date: Fri, 31 Jan 2014 16:16:09 -0600

On Fri, Jan 31, 2014 at 2:09 AM, Nicolas Goaziou <address@hidden> wrote:
> Hello,
>
> John Hendy <address@hidden> writes:
>
>> The closest I found in my googling for a solution/setting/variable was
>> the variable =org-src-preserve-indentation=, but that seems to only
>> have to do with tangling.
>
> The first line of its docstring is:
>
>   If non-nil preserve leading whitespace characters on export.

Just tried this and it's still not working. I started emacs with
`emacs -Q` and then did `M-x load-file` with this minimal config:

#+begin_src min-config

(add-to-list 'load-path "~/.elisp/org.git/lisp/")
(add-to-list 'load-path "~/.elisp/org.git/contrib/lisp")
(add-to-list 'load-path "~/.elisp/site-lisp/ess/lisp/")

;; setup babel languages
(org-babel-do-load-languages
 'org-babel-load-languages
 '((R . t)))

(require 'ox-latex)
(require 'ox-beamer)

(add-to-list 'org-latex-classes
             '("beamer"
               "\\documentclass\[presentation\]\{beamer\}"
               ("\\section\{%s\}" . "\\section*\{%s\}")
               ("\\subsection\{%s\}" . "\\subsection*\{%s\}")
               ("\\subsubsection\{%s\}" . "\\subsubsection*\{%s\}")))

(setq org-src-preserve-indentation t)

#+end_src

Here's the test file:

#+begin_src org

#+latex_class: beamer
#+options: toc:nil latex:t tex:t H:1
#+latex_class_options: [presentation]

* Slide

#+begin_src R
a <- "Test of whitespace preservation"

b <- cat("Let's see what happens when we spill",
         "onto multiple lines but want the text",
         "being passed to cat() to be aligned")

#+end_src

#+end_src

It doesn't show up that well, but with fixed-font, the quotation is
aligned for all three lines passed to cat().

I also checked (from the emacs -Q session) on org-src-preserve-indentation:

#+begin_src M-x help RET v RET org-src-preserve-indentation RET

org-src-preserve-indentation is a variable defined in `org-src.el'.
Its value is t
Original value was nil

#+end_src

I attached the resultant output.


Best regards,
John

>
>
> Regards,
>
> --
> Nicolas Goaziou

Attachment: test.pdf
Description: Adobe PDF document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]