From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Hendy Subject: Re: Preservation of white space in babel blocks, exporting to PDF Date: Fri, 31 Jan 2014 16:46:28 -0600 Message-ID: References: <87eh3od13z.fsf@gmail.com> <87y51vhjq6.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60808) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9Mr0-0001vX-T0 for emacs-orgmode@gnu.org; Fri, 31 Jan 2014 17:46:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W9Mqz-0002Pz-VC for emacs-orgmode@gnu.org; Fri, 31 Jan 2014 17:46:30 -0500 Received: from mail-ob0-x22c.google.com ([2607:f8b0:4003:c01::22c]:37463) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9Mqz-0002Pt-Na for emacs-orgmode@gnu.org; Fri, 31 Jan 2014 17:46:29 -0500 Received: by mail-ob0-f172.google.com with SMTP id vb8so5702107obc.17 for ; Fri, 31 Jan 2014 14:46:28 -0800 (PST) In-Reply-To: <87y51vhjq6.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nicolas Goaziou Cc: emacs-orgmode On Fri, Jan 31, 2014 at 4:25 PM, Nicolas Goaziou wrote: > John Hendy 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