From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: BUG: example/src blocks and latex export Date: Fri, 19 Aug 2011 07:49:13 -0600 Message-ID: <8739gxo39e.fsf@gmail.com> References: <6977.1313748571@alphaville.dokosmarshall.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:60965) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QuQYZ-0000hL-3O for emacs-orgmode@gnu.org; Fri, 19 Aug 2011 11:00:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QuQYT-0006Nw-Mi for emacs-orgmode@gnu.org; Fri, 19 Aug 2011 11:00:23 -0400 Received: from mail-yw0-f41.google.com ([209.85.213.41]:43500) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QuQYT-0006Nk-KE for emacs-orgmode@gnu.org; Fri, 19 Aug 2011 11:00:17 -0400 Received: by ywm13 with SMTP id 13so2433946ywm.0 for ; Fri, 19 Aug 2011 08:00:17 -0700 (PDT) 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: nicholas.dokos@hp.com Cc: emacs-orgmode@gnu.org Nick Dokos writes: > Consider the following org file: > > > * foo > > Verbiage to begin the paragraph > #+begin_src shell > get-config.py var section [section ...] > #+end_src > and verbiage to end the same paragraph. > > * bar > > Verbiage to begin the paragraph > #+begin_example > get-config.py var section [section ...] > #+end_example > and verbiage to end the same paragraph. > > > When exported to latex with current git (Org-mode version 7.7 (release_7.7.120.g2edd.dirty)), > I get: > > Verbiage to begin the paragraph > > \begin{verbatim} > get-config.py var section [section ...] > \end{verbatim} > > > > and verbiage to end the same paragraph. > \section{bar} > \label{sec-2} > > > Verbiage to begin the paragraph > > \begin{verbatim} > get-config.py var section [section ...] > \end{verbatim} > > > and verbiage to end the same paragraph. > > so both instances of "verbiage to end the same paragraph" actually end > up being in a different paragraph, with three empty lines after a > source block and two empty lines after an example block, where none > existed before. LaTeX indents the newly created paragraph and it > looks ugly. Of course, just a single empty line is enough to do > the damage, but the fact that there is more than one and that there > are different numbers, indicates multiple places where a gratuitous > newline is inserted. > If you want results embedded into a paragraph, then I would suggest using an inline code block. Regular code blocks are "blocks" in that they will break paragraphs and are treated (in my mind) more like figures than inline elements. > > I get sane behavior with the attached patch, but I'm wondering if it > breaks other backends, so if somebody is willing to test, I'd appreciate > it (and of course, I'll test as well). For the time being at least, this > is a trial balloon, not a real patch. > Thanks for the patch, I would not want this behavior on by default because I think the results in the Org-mode file are less visually pleasing than when results are padded with spaces. Perhaps this behavior could be controlled through a new header argument which would default to the current behavior. > ISTR this issue coming up on the list recently: did I imagine it? A similar issue regarding the insertion of spaces through repeated evaluation and removal of results of a code block has been discussed recently. I'm pushing up a small fix for that issue now. Cheers -- Eric -- Eric Schulte http://cs.unm.edu/~eschulte/