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 22:08:55 -0600 Message-ID: References: <87eh3od13z.fsf@gmail.com> <87y51vhjq6.fsf@gmail.com> <87ppn7hhwt.fsf@gmail.com> <87lhxv7mym.fsf@med.uni-goettingen.de> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c329a2fcbd8704f150729a Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47757) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9Rt5-0001Aa-Te for emacs-orgmode@gnu.org; Fri, 31 Jan 2014 23:09:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W9Rt2-0004Bp-Qd for emacs-orgmode@gnu.org; Fri, 31 Jan 2014 23:08:59 -0500 Received: from mail-ob0-x233.google.com ([2607:f8b0:4003:c01::233]:52567) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9Rt2-0004BZ-JW for emacs-orgmode@gnu.org; Fri, 31 Jan 2014 23:08:56 -0500 Received: by mail-ob0-f179.google.com with SMTP id wo20so5863745obc.24 for ; Fri, 31 Jan 2014 20:08:55 -0800 (PST) In-Reply-To: <87lhxv7mym.fsf@med.uni-goettingen.de> 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: Andreas Leha Cc: emacs-orgmode --001a11c329a2fcbd8704f150729a Content-Type: text/plain; charset=UTF-8 On Jan 31, 2014 5:26 PM, "Andreas Leha" wrote: > > Hi, > > John Hendy writes: > > > On Fri, Jan 31, 2014 at 5:04 PM, Nicolas Goaziou wrote: > >> John Hendy writes: > >> > >>>> I cannot reproduce the problem. > >>> > >>> In the .tex file or in the .pdf? > >> > >> Both. > > > > Weird. > > > >> > >>> 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} > >> > >> I don't know why or how you get this, but this has nothing to do with > >> `org-src-preserve-indentation' since there in no global indentation in > >> your code (i.e., a line starts at column 0). > >> > >>> \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; > >> > >> You can use C-u C-x = in order to know what it is. > >> > > > > Here's what I get: > > > > position: 754 of 1188 (63%), column: 0 > > character: TAB (displayed as TAB) (codepoint 9, #o11, #x9) > > preferred charset: ascii (ASCII (ISO646 IRV)) > > code point in charset: 0x09 > > syntax: which means: whitespace > > to input: type "C-x 8 RET HEX-CODEPOINT" or "C-x 8 RET NAME" > > buffer code: #x09 > > file code: #x09 (encoded by coding system utf-8-unix) > > display: no font available > > > > I checked my locale, and it's set to en_US.utf8 (Arch Linux) > > > >> What happens if you run (org-export-execute-babel-code) on your Org > >> buffer? > > > > I'm not used to running functions. I placed this in the document, > > selected the text, and did `M-x eval-region`. Nothing appears to have > > happened, but the *Messages* buffer printed out: "org-babel-exp > > process R at line 9..." > > > > Does that help any? > > > > > > John > > > > > I have not been following this thread. So please scratch this in case > it is not relevant here. But I once had problems concerning tabs and > source blocks in beamer documents. So, this is what I have in my .emacs > (quite crude): > > --8<---------------cut here---------------start------------->8--- > (defun my-e-beamer-final-filter (contents backend info) > (replace-regexp-in-string "\t" " " contents)) > (add-to-list 'org-export-filter-final-output-functions 'my-e-beamer-final-filter) > --8<---------------cut here---------------end--------------->8--- > Certainly looks like it would do what needs to be done based on my issue. I'll try it this weekend. 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. Thanks for posting your solution, John > Regards, > Andreas > > --001a11c329a2fcbd8704f150729a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Jan 31, 2014 5:26 PM, "Andreas Leha" <andreas.leha@med.uni-goettingen.de>= wrote:
>
> Hi,
>
> John Hendy <jw.hendy@gmail.co= m> writes:
>
> > On Fri, Jan 31, 2014 at 5:04 PM, Nicolas Goaziou <n.goaziou@gmail.com> wrote:
> >> John Hendy <jw.hendy= @gmail.com> writes:
> >>
> >>>> I cannot reproduce the problem.
> >>>
> >>> In the .tex file or in the .pdf?
> >>
> >> Both.
> >
> > Weird.
> >
> >>
> >>> I know that #+begin/end_example works properly, so I took= a look at
> >>> the difference between them:
> >>>
> >>> \begin{frame}[fragile,label=3Dsec-1]{begin src}
> >>> =C2=A0\begin{verbatim}
> >>> a <- "Test of whitespace preservation"
> >>>
> >>> b <- cat("Let's see what happens when we spil= l",
> >>> "onto multiple lines but want the text",
> >>> "being passed to cat() to be aligned")
> >>> \end{verbatim}
> >>> \end{frame}
> >>
> >> I don't know why or how you get this, but this has nothin= g to do with
> >> `org-src-preserve-indentation' since there in no global i= ndentation in
> >> your code (i.e., a line starts at column 0).
> >>
> >>> \begin{frame}[fragile,label=3Dsec-2]{begin example}
> >>> =C2=A0\begin{verbatim}
> >>> a <- "Test of whitespace preservation"
> >>>
> >>> b <- cat("Let's see what happens when we spil= l",
> >>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"onto multiple lin= es but want the text",
> >>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"being passed to c= at() to be aligned")
> >>> \end{verbatim}
> >>> \end{frame}
> >>> \end{document}
> >>>
> >>> Source blocks are exported with what appears to be some s= ort of tab
> >>> character;
> >>
> >> You can use C-u C-x =3D in order to know what it is.
> >>
> >
> > Here's what I get:
> >
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0position: 754 of = 1188 (63%), column: 0
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 character: TAB (display= ed as TAB) (codepoint 9, #o11, #x9)
> > =C2=A0 =C2=A0 preferred charset: ascii (ASCII (ISO646 IRV))
> > code point in charset: 0x09
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0syntax: = =C2=A0 which means: whitespace
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0to input: type &q= uot;C-x 8 RET HEX-CODEPOINT" or "C-x 8 RET NAME"
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 buffer code: #x09
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 file code: #x09 (encode= d by coding system utf-8-unix)
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 display: no font= available
> >
> > I checked my locale, and it's set to en_US.utf8 (Arch Linux)<= br> > >
> >> What happens if you run (org-export-execute-babel-code) on yo= ur Org
> >> buffer?
> >
> > I'm not used to running functions. I placed this in the docum= ent,
> > selected the text, and did `M-x eval-region`. Nothing appears to = have
> > happened, but the *Messages* buffer printed out: "org-babel-= exp
> > process R at line 9..."
> >
> > Does that help any?
> >
> >
> > John
> >
>
>
> I have not been following this thread. =C2=A0So please scratch this in= case
> it is not relevant here. =C2=A0But I once had problems concerning tabs= and
> source blocks in beamer documents. =C2=A0So, this is what I have in my= .emacs
> (quite crude):
>
> --8<---------------cut here---------------start------------->8--= -
> (defun my-e-beamer-final-filter (contents backend info)
> =C2=A0 (replace-regexp-in-string "\t" " =C2=A0 =C2=A0 = =C2=A0 =C2=A0" contents))
> (add-to-list 'org-export-filter-final-output-functions 'my-e-b= eamer-final-filter)
> --8<---------------cut here---------------end--------------->8--= -
>

Certainly looks like it would do what needs to be done based= on my issue. I'll try it this weekend.

I'd still like to understand the src vs. example block d= iscrepancy if possible. It's really odd, especially since Nicholas isn&= #39;t able to reproduce even with the same minimal config.

Thanks for posting your solution,
John

> Regards,
> Andreas
>
>

--001a11c329a2fcbd8704f150729a--