emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: Eric Schulte <schulte.eric@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [babel] using #+call for inline results
Date: Thu, 23 Jun 2011 21:55:17 +0200	[thread overview]
Message-ID: <871uykgw62.fsf@gmail.com> (raw)
In-Reply-To: <87r56k78wm.fsf@ucl.ac.uk> (Eric S. Fraga's message of "Thu, 23 Jun 2011 18:30:17 +0100")

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

>> I see no difference between the paragraph and the list item: in both
>> cases, the table doesn't appear, as it has been moved right after the
>> headline by `org-export-blocks-preprocess' during export.
>>
>> Are we observing the same phenomenon?
>
> No, I don't believe so.  Nothing to do with the table; all to do with
> the two inline babel evaluations.  The latex I get exported by this
> snippet of org code:
>
>   The relative volatility is src_octave[:var it=benzene-chlorobenzene-relative-volatility :results output raw]{disp(it);}.
>
>   If I put the result in a list:
>   - it does not work as the result is src_octave[:var it=benzene-chlorobenzene-relative-volatility :results output raw]{disp(it);} and the list processing is confused.
>
> is
>
>   The relative volatility is   7.8578
> .
>
>   If I put the result in a list:
>
> \begin{itemize}
> \item it does not work as the result is   7.8578
> \end{itemize}
>  and the list processing is confused.
> ORG-LIST-END-MARKER

Again, we get different outputs. *sighs*

> The in-paragraph processing is "fine" (modulo a spurious newline).
> However, the list item is terminated prematurely immediately after the
> result of the babel code evaluation *and* there is an
> =ORG-LIST-END-MARKER= left over!

Both are directly related anyway.

>  I guess the problem is due to babel moving things around during the
> list processing?
>
> From the recent messages, it sounds like there is a sort of race
> condition being caused by some list processing followed by babel
> processing and then again by list processing during the export process?
> Or have I misunderstood the problems?

Not really. The problem is that babel doesn't pay much attention to its
output. It may add blank lines, put text to column 0, etc.

Thus, list processing is done in two parts. Before expanding babel
blocks, list endings are marked with that ORG-LIST-END-MARKER string, in
order to ignore blank lines that might have been added. After the
expanding, lists are read again and stuffed with text properties, mainly
for line by line exporters (which lack context understanding to
properly export lists, but that's another topic).

Even with that extra care, problems arise (often due to text put at
column 0). One solution would be for babel to properly set the
indentation of its output, or set the `original-indentation' property of
that output to the indentation of the original block (which is usually
done, but, looking at the recent problems, not always).

Well, all this babbling doesn't quite help to solve the issue at hand...

Regards,

-- 
Nicolas Goaziou

  reply	other threads:[~2011-06-23 19:55 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-22 11:07 [babel] using #+call for inline results Eric S Fraga
2011-06-22 16:23 ` Eric Schulte
2011-06-22 18:22   ` Eric S Fraga
2011-06-23  5:32     ` Eric Schulte
2011-06-23  8:10       ` Eric S Fraga
2011-06-23 13:49         ` Nicolas Goaziou
2011-06-23 15:39           ` chris.m.malone
2011-06-23 17:30           ` Eric S Fraga
2011-06-23 19:55             ` Nicolas Goaziou [this message]
2011-06-24  8:11               ` Eric S Fraga
2011-06-23  9:25       ` Christian Moe
2011-06-24 22:36         ` Eric Schulte
2011-06-25 19:33           ` Eric S Fraga
2011-06-26 11:56           ` Christian Moe
2011-06-27  0:14             ` Eric Schulte
2011-06-27  6:16               ` Christian Moe
2011-06-27 17:43                 ` Eric Schulte
2011-06-27 19:01                   ` Christian Moe
2011-06-28  8:04                   ` Sebastien Vauban
2011-06-28 20:31                     ` Eric Schulte
2011-06-29  7:40                       ` Sebastien Vauban
2011-06-29 17:12                         ` Eric Schulte
2011-06-29 17:25                           ` Eric Schulte
2011-06-27 17:09           ` Eric S Fraga
2011-06-27 18:45             ` Eric Schulte
2011-06-29 16:38               ` Eric S Fraga
2011-06-29 17:59                 ` Eric Schulte
2011-06-22 17:53 ` Juan Pechiar

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=871uykgw62.fsf@gmail.com \
    --to=n.goaziou@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=schulte.eric@gmail.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).