emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <schulte.eric@gmail.com>
To: nicholas.dokos@hp.com
Cc: emacs-orgmode@gnu.org
Subject: Re: BUG: example/src blocks and latex export
Date: Fri, 19 Aug 2011 07:49:13 -0600	[thread overview]
Message-ID: <8739gxo39e.fsf@gmail.com> (raw)
In-Reply-To: 6977.1313748571@alphaville.dokosmarshall.org

Nick Dokos <nicholas.dokos@hp.com> 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/

  reply	other threads:[~2011-08-19 15:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-19 10:09 BUG: example/src blocks and latex export Nick Dokos
2011-08-19 13:49 ` Eric Schulte [this message]
2011-08-19 15:27   ` Nick Dokos
2011-08-19 19:59   ` Nick Dokos
2011-08-19 21:27 ` Bastien
2011-08-19 22:03   ` Nick Dokos
2011-08-19 23:11   ` Nick Dokos
2011-08-21 18:30     ` Eric Schulte
2011-08-21 18:28   ` Eric Schulte

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=8739gxo39e.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=nicholas.dokos@hp.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).