emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rasmus Pank Roulund <rasmus@gmx.us>
To: n.goaziou@gmail.com
Cc: emacs-orgmode@gnu.org
Subject: Re: Export tables as matrices (change tbl-export function on the fly)
Date: Sat, 17 Nov 2012 14:26:55 +0100	[thread overview]
Message-ID: <87sj888in4.fsf@pank.eu> (raw)
In-Reply-To: <87y5i4yx2w.fsf@gmail.com> (Nicolas Goaziou's message of "Wed, 14 Nov 2012 17:21:27 +0100")

Nicolas Goaziou <n.goaziou@gmail.com> writes:

>> I'm doing some stuff where the natural output of my tables are
>> matrices.  I found a decent translation function here ¹.  However,
>> I'm not very successful in making org use it. 
>
> Using the new exporter, something like should replace any table using
> default environment (i.e. no special attribute) and without horizontal
> rules with bmatrix environment. It should also insert it in math mode
> automatically.

I didn't manage to get your (Nicolas') or my own attempt working
correctly for exporting matrices.  I still think it would be nice.

I tried to use the regexp 
   (not (string-match "|[\\+-]+|"  table))
to identify tables without heading separators, but it didn't work
properly. 

Thinking about it, it might be nice to be able to specify table export
function more generally.  For instance, I might have a matrix with
labels (in LaTeX a bordermatrix or kbordermatrix).  Likewise, it might
also be nice to specify a header argument to tables s.t. I can specify
a name, e.g.

#+NAME: P 
#+TBLOPTIONS: :prefix "P=" :type matrix
| a| b|
| c| d|

would export to 
\[P=\begin{bmatrix}a&b\\c&d\end{bmatrix}\]

–Rasmus

-- 
May the Force be with you

  parent reply	other threads:[~2012-11-17 13:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-14 14:49 Export tables as matrices (change tbl-export function on the fly) Rasmus
2012-11-14 16:21 ` Nicolas Goaziou
2012-11-14 18:05   ` Rasmus
2012-11-17 13:26   ` Rasmus Pank Roulund [this message]
2012-11-17 15:32     ` Nicolas Goaziou
2012-11-17 18:29       ` Rasmus
2012-11-18  8:53         ` Nicolas Goaziou
2012-11-18 11:50           ` Rasmus
2012-11-18 13:20             ` Nicolas Goaziou
2012-11-18 14:05               ` Rasmus
2012-11-18 19:12                 ` 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=87sj888in4.fsf@pank.eu \
    --to=rasmus@gmx.us \
    --cc=emacs-orgmode@gnu.org \
    --cc=n.goaziou@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).