From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Export tables as matrices (change tbl-export function on the fly) Date: Sun, 18 Nov 2012 20:12:52 +0100 Message-ID: <874nkmend7.fsf@gmail.com> References: <877gpojl2s.fsf@pank.iue.private> <87y5i4yx2w.fsf@gmail.com> <87sj888in4.fsf@pank.eu> <87haoont2g.fsf@gmail.com> <87d2zc84nk.fsf@pank.eu> <87fw48lyoj.fsf@gmail.com> <87ehjr6sgl.fsf@pank.eu> <878v9zdp3g.fsf@gmail.com> <87lidz3t24.fsf@pank.eu> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:48425) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TaAMi-00047M-4h for emacs-orgmode@gnu.org; Sun, 18 Nov 2012 14:17:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TaAMf-0002yS-2I for emacs-orgmode@gnu.org; Sun, 18 Nov 2012 14:17:12 -0500 Received: from mail-we0-f169.google.com ([74.125.82.169]:40400) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TaAMe-0002yO-Rt for emacs-orgmode@gnu.org; Sun, 18 Nov 2012 14:17:08 -0500 Received: by mail-we0-f169.google.com with SMTP id u3so1886026wey.0 for ; Sun, 18 Nov 2012 11:17:07 -0800 (PST) In-Reply-To: <87lidz3t24.fsf@pank.eu> (rasmus@gmx.us's message of "Sun, 18 Nov 2012 15:05:23 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Rasmus Cc: emacs-orgmode@gnu.org Rasmus writes: >> Then the backend can add the alignment as an optional argument in math >> mode only when the name of the environment ends with a star and the >> alignment string is one character long. > > In the LATEX_ATTR or as in the example above? The former I assume. Correct. >> To circumvent the problem, org-e-latex.el can use a defconst to store >> table/matrix environments requiring "\cr" instead of "\\" at the end of >> each row. It will, as a starter, only contain "bordermatrix". > > OK. How about just making a list of strings (with typical member > STRING) which are known to have the format > \STRING{matrix-like-output}? Then one can add whichever crazy > environment that might be needed to this list. And users can easily > add their favorite flavor of e.g. bordermatrix. That's the idea: a list of strings which are used as commands and not as environments, since environments use "\\". > A short experiment seems to suggest that \cr works in place of \\. "\\" is high-level, "\cr" is not. There are certainly drawbacks to use replace \\ with \cr. >> Also, instead of using a single `org-e-latex-default-table-environment', >> its value can be a plist like the following: >> >> (:table-mode "tabular" :math-mode "bmatrix" :inline-math-mode "smallmatrix") > > Yeah, that would be nice. Would it extend to the options in > ATTR_LATEX? I.e. would it be nice (?) to be able to specify > - environment > - math-environment > - inline-math-environment > in one option line s.t. I could easily switch from table to matrix to > inline matrix? E.g. > > #+ATTR_LATEX: :math-environment "Bmatrix" :math-mode t > prints a display matrix > but > #+ATTR_LATEX: :math-environment "Bmatrix" :math-mode nil > prints a table. > > I don't know whether this is just making things more confusing or > whether it would be useful. . . That would be too much properties to my liking. There are already many of them in tables. > Also, at least a prefix string would be very useful as that's how > matrices are usually named. E.g. > > #+ATTR_LATEX: :math-mode t :prefix "P=" > |1|2| > |3|4| > > is translated to > P=\begin{bmatrix}1&2\\3&4\end{bmatrix} Sure :math-prefix and :math-suffix seem like a good idea. Regards, -- Nicolas Goaziou