emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: John Hendy <jw.hendy@gmail.com>
To: Nicolas Goaziou <n.goaziou@gmail.com>
Cc: Andreas Leha <andreas.leha@med.uni-goettingen.de>,
	emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: Preservation of white space in babel blocks, exporting to PDF
Date: Sat, 1 Feb 2014 11:54:18 -0600	[thread overview]
Message-ID: <CA+M2ft9z0DYLZVbGTJnJyGb0J+7cfACA1XG433SNXaEwQbXg8A@mail.gmail.com> (raw)
In-Reply-To: <87a9ebs0dn.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2217 bytes --]

On Sat, Feb 1, 2014 at 2:28 AM, Nicolas Goaziou <n.goaziou@gmail.com> wrote:
> Hello,
>
> John Hendy <jw.hendy@gmail.com> writes:
>
>> I'd still like to understand the src vs. example block discrepancy if
>> possible. It's really odd, especially since Nicholas isn't able to
>> reproduce even with the same minimal config.
>
> There is no discrepancy. You indent your code with tabs and these tabs
> appear in the TeX file, but Beamer cannot handle them properly. The same
> problem will arise in an example block.

From whence comes this assumption? In the previous emails, I mentioned
the different treatment between src and example blocks with the same
code. I don't know why I'd complain about the .tex containing "some
sort of tab character" if I'd put it there myself!

> I couldn't reproduce it because I only indent with spaces.

This doesn't compute with me. If we're talking about reproduction, it
means that you ran my code as posted, with the same min config. What
you typically intent with wouldn't come into play. Feedback would be
provided on what my code produced on your system, as-is. You appear to
be highlighting that we indent differently instead (which I don't
think is the case).

To attempt to get at the root of this, find attached the exact .org
file (no confusion on tabs vs. spaces), and the outpuy .tex/.pdf
created (I renamed the .tex and .pdf so others don't have to worry
about them being overwritten with local export). My process, again, is
the following:
- $ emacs -Q
- M-x load-file ~/path/to/min-config
- C-x C-f ~/path/to/test.org
- C-c C-e l P (output to Beamer)

- M-x org-version
Org-mode version 8.2.5h (release_8.2.5h-576-gca0c77 @
/home/jwhendy/.elisp/org.git/lisp/)

- $ emacs --version
GNU Emacs 24.3.1

Check the .org file; no tabs. The latex output contains tabs for the
exported src block, but spaces for the example block. On a whim, I
added two more headlines to the .org file; they only use 2 or 3 spaces
vs. the first two headlines which contain 9. They export properly in
both cases. Could it be possible that there's some sort of
substitution of a tab for 5 spaces going on somewhere?

Thanks for any suggestions.


John

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

[-- Attachment #2: test.org --]
[-- Type: application/octet-stream, Size: 1160 bytes --]

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

* src block

- Only spaces here, but tabs will appear in .tex

#+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

#+RESULTS:

* example block

- Only spaces here, which will be unchanged in .tex

#+begin_example
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_example


* src block

- Idea to play with less spaces (< 5)

#+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

#+RESULTS:

* example block

#+begin_example
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_example

[-- Attachment #3: jw-text.tex --]
[-- Type: application/x-tex, Size: 1977 bytes --]

[-- Attachment #4: jw-test.pdf --]
[-- Type: application/pdf, Size: 60988 bytes --]

[-- Attachment #5: min-config --]
[-- Type: application/octet-stream, Size: 645 bytes --]

(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)

  reply	other threads:[~2014-02-01 17:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-31  5:58 Preservation of white space in babel blocks, exporting to PDF John Hendy
2014-01-31  8:09 ` Nicolas Goaziou
2014-01-31 22:16   ` John Hendy
2014-01-31 22:25     ` Nicolas Goaziou
2014-01-31 22:46       ` John Hendy
2014-01-31 23:04         ` Nicolas Goaziou
2014-01-31 23:16           ` John Hendy
2014-01-31 23:25             ` Andreas Leha
2014-02-01  4:08               ` John Hendy
2014-02-01  8:28                 ` Nicolas Goaziou
2014-02-01 17:54                   ` John Hendy [this message]
2014-02-01 20:27                     ` Nicolas Goaziou
2014-02-01 21:02                       ` Nicolas Goaziou
2014-02-02  1:33                       ` John Hendy
2014-02-02  8:45                         ` Nicolas Goaziou
2014-02-02 15:59                           ` John Hendy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+M2ft9z0DYLZVbGTJnJyGb0J+7cfACA1XG433SNXaEwQbXg8A@mail.gmail.com \
    --to=jw.hendy@gmail.com \
    --cc=andreas.leha@med.uni-goettingen.de \
    --cc=emacs-orgmode@gnu.org \
    --cc=n.goaziou@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).