emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Matthew Fidler <matthew.fidler@gmail.com>
To: emacs-org <emacs-orgmode@gnu.org>
Subject: orgtbl in languages that do not support block comments
Date: Thu, 13 Jan 2011 13:37:04 -0600	[thread overview]
Message-ID: <AANLkTik-nHPLHtBRUwrUJYwmQAEdTj9=masNOOcGZ4QR@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 2187 bytes --]

All,

I have written org-table-comment.el (at
http://www.emacswiki.org/emacs/download/org-table-comment.el) which should
allows you to create org-tables in languages that do not have
block comments.  For example in elisp:

;; |------+----------------+----+-------|
;; |      |                |    | <5>   |
;; | This | is             | a  | table |
;; | that | may be created | in | orgtbl-comment-mode |
;; |------+----------------+----+-------|

or

;; |------+----------------+----+---------------------|
;; | This | is             | a  | table               |
;; | that | may be created | in | orgtbl-comment-mode |
;; |------+----------------+----+---------------------|

It also supports single-comment radio tables, for example in LaTeX
the following now works if you are using the overlays driver for
org-table-comment:

% BEGIN RECEIVE ORGTBL salesfigures
% END RECEIVE ORGTBL salesfigures

% #+ORGTBL: SEND salesfigures orgtbl-to-latex
% |-------+------+---------+---------|
% | Month | Days | Nr sold | per day |
% |-------+------+---------+---------|
% | Jan   |   23 |      55 |     2.4 |
% | Feb   |   21 |      16 |     0.8 |
% | March |   22 |     278 |    12.6 |
% |-------+------+---------+---------|
% #+TBLFM: $4=$3/$2;.1f

When editing the table, pressing C-c C-c produces the LaTeX table, as
follows:

% BEGIN RECEIVE ORGTBL salesfigures
\begin{tabular}{lrrr}
\hline
Month & Days & Nr sold & per day \\
\hline
Jan & 23 & 55 & 2.4 \\
Feb & 21 & 16 & 0.8 \\
March & 22 & 278 & 12.6 \\
\hline
\end{tabular}
% END RECEIVE ORGTBL salesfigures

% #+ORGTBL: SEND salesfigures orgtbl-to-latex
% |-------+------+---------+---------|
% | Month | Days | Nr sold | per day |
% |-------+------+---------+---------|
% | Jan   |   23 |      55 |     2.4 |
% | Feb   |   21 |      16 |     0.8 |
% | March |   22 |     278 |    12.6 |
% |-------+------+---------+---------|
% #+TBLFM: $4=$3/$2;.1f

NOTE: This requires `comment-region' and `uncomment-region' to work
properly in the mode you are using.  Also filling/wrapping in the
mode needs to not wrap the orgbls.

If anyone is interested in testing this and letting me know if it works on
other platforms, let me know.

Matt.

[-- Attachment #1.2: Type: text/html, Size: 7833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

                 reply	other threads:[~2011-01-13 19:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='AANLkTik-nHPLHtBRUwrUJYwmQAEdTj9=masNOOcGZ4QR@mail.gmail.com' \
    --to=matthew.fidler@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).