emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* orgtbl in languages that do not support block comments
@ 2011-01-13 19:37 Matthew Fidler
  0 siblings, 0 replies; only message in thread
From: Matthew Fidler @ 2011-01-13 19:37 UTC (permalink / raw)
  To: emacs-org


[-- 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-01-13 19:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-13 19:37 orgtbl in languages that do not support block comments Matthew Fidler

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).