emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Nick Dokos <ndokos@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [RFC] Rewrite radio tables
Date: Mon, 25 Aug 2014 21:20:22 +0200	[thread overview]
Message-ID: <87sikkidft.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <87tx501riy.fsf@alphaville.bos.redhat.com> (Nick Dokos's message of "Mon, 25 Aug 2014 12:08:05 -0400")

Hello,

Nick Dokos <ndokos@gmail.com> writes:

> I tried it with one of Thorsten Grotte's examples:

Thanks for testing it out.

> \documentclass{article}
>
> \begin{document}
>
> I tried to export this table to latex:
>
> \begin{comment}
>   
> #+TBLNAME: Test
> #+ORGTBL: SEND Test orgtbl-to-latex :skip 1 :splice t
> | C |    A |    B |
> |---+------+------|
> |   |    6 |    2 |
> |   |    4 |    9 |
> |---+------+------|
> | _ | suma | sumb |
> |   |   10 |   11 |
> #+TBLFM: $suma=vsum(@I..@II)::$sumb=vsum(@I..@II)
> \end{comment}
>
>
> and got the following result:
>
> % BEGIN RECEIVE ORGTBL Test
> 10 & 11\\
> % END RECEIVE ORGTBL Test
>
> \end{document}
>
> It works fine without the :skip argument, but with it, it seems to
> skip to the second hline.

Actually it looks fine to me. :skip is applied first, so table becomes

  |---+------+------|
  |   |    6 |    2 |
  |   |    4 |    9 |
  |---+------+------|
  | _ | suma | sumb |
  |   |   10 |   11 |

Then :splice is applied, so header (first rowgroup) is dropped

  | _ | suma | sumb |
  |   |   10 |   11 |

Eventually, this table is exported.

The current implementation gives

  % BEGIN RECEIVE ORGTBL Test
  \hline
  6 & 2 \\
  4 & 9 \\
  \hline
  10 & 11 \\
  % END RECEIVE ORGTBL Test

This doesn't match the specs, though. According to the (current)
docstring

  :splice  When set to t, return only table body lines, don't wrap
           them into :tstart and :tend.  Default is nil.  When :splice
           is non-nil, this also means that the exporter should not look
           for and interpret header and footer sections.

So it should ignore table's header, but it isn't the case, as
demonstrated in the following example. The same table with only :splice
t as parameter gives

  % BEGIN RECEIVE ORGTBL Test
  C & A & B \\
  \hline
   & 6 & 2 \\
   & 4 & 9 \\
  \hline
  $\backslash$\(_\) & suma & sumb \\
   & 10 & 11 \\
  % END RECEIVE ORGTBL Test

I'm surprised no one noticed it. This may be a sign that this feature
should be removed (i.e., :splice should not skip header).

WDYT?


Regards,

-- 
Nicolas Goaziou

  parent reply	other threads:[~2014-08-25 19:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-24 19:25 [RFC] Rewrite radio tables Nicolas Goaziou
2014-08-24 20:18 ` Thorsten Jolitz
2014-08-24 20:51   ` Thorsten Jolitz
2014-08-25 16:08 ` Nick Dokos
2014-08-25 16:11   ` Nick Dokos
2014-08-25 19:20   ` Nicolas Goaziou [this message]
2014-09-13 13:23     ` Nicolas Goaziou
2014-08-27 14:50 ` AW
2014-08-27 23:33   ` Nicolas Goaziou

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=87sikkidft.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=ndokos@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).