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:46:28 -0600

On Fri, Jan 31, 2014 at 4:25 PM, Nicolas Goaziou <address@hidden> wrote:
> John Hendy <address@hidden> 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 via email to

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