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: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: Preservation of white space in babel blocks, exporting to PDF
Date: Fri, 31 Jan 2014 16:46:28 -0600	[thread overview]
Message-ID: <CA+M2ft_0cPNzRpbucsmCygT21_O1HKL34jp2zaG7g-13sW5rpw@mail.gmail.com> (raw)
In-Reply-To: <87y51vhjq6.fsf@gmail.com>

On Fri, Jan 31, 2014 at 4:25 PM, Nicolas Goaziou <n.goaziou@gmail.com> wrote:
> John Hendy <jw.hendy@gmail.com> writes:
>
>> 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.
>
> I cannot reproduce the problem.

In the .tex file or in the .pdf?

>
> Please look at the TeX source instead of the PDF. What did you expect
> instead?

If it's not straightforward, I expect the phrase "preserve whitespace"
to  mean that the PDF (or whatever final exported output) look like
the actual code block. Perhaps some are interested purely in the .tex
file looking correct, but I would think most folks who read
"org-src-preserve-indentation preserves whitespace upon export or
tangling" would read that to mean "the appearance of the exported
document," not simply the base file. If the raw .html or .tex code
preserves whitespace but the rendered documents don't, then I don't
consider whitespace to have been preserved.

I know that #+begin/end_example works properly, so I took a look at
the difference between them:

\begin{frame}[fragile,label=sec-1]{begin src}
 \begin{verbatim}
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{verbatim}
\end{frame}

\begin{frame}[fragile,label=sec-2]{begin example}
 \begin{verbatim}
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{verbatim}
\end{frame}
\end{document}

Source blocks are exported with what appears to be some sort of tab
character; the cursor jumps from the line beginning to the first word
in the line. I don't know what character it is, and you can see from
above that pasting into this email shows no effect of any such
character.

Example blocks use literal spaces, and indeed the whitespace is
preserved, both in the .tex file as well as the resultant .pdf.


John

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

  reply	other threads:[~2014-01-31 22:46 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 [this message]
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
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+M2ft_0cPNzRpbucsmCygT21_O1HKL34jp2zaG7g-13sW5rpw@mail.gmail.com \
    --to=jw.hendy@gmail.com \
    --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).