From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: Export tables as matrices (change tbl-export function on the fly) Date: Sat, 17 Nov 2012 19:29:03 +0100 Message-ID: <87d2zc84nk.fsf@pank.eu> References: <877gpojl2s.fsf@pank.iue.private> <87y5i4yx2w.fsf@gmail.com> <87sj888in4.fsf@pank.eu> <87haoont2g.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:38081) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TZn8g-0008Dd-BX for emacs-orgmode@gnu.org; Sat, 17 Nov 2012 13:29:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TZn8d-00020U-A0 for emacs-orgmode@gnu.org; Sat, 17 Nov 2012 13:29:10 -0500 Received: from mailout-eu.gmx.com ([213.165.64.43]:53238) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1TZn8c-00020D-WB for emacs-orgmode@gnu.org; Sat, 17 Nov 2012 13:29:07 -0500 In-Reply-To: <87haoont2g.fsf@gmail.com> (Nicolas Goaziou's message of "Sat, 17 Nov 2012 16:32:39 +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: n.goaziou@gmail.com Cc: emacs-orgmode@gnu.org Nicolas Goaziou writes: >> I didn't manage to get your (Nicolas') or my own attempt working >> correctly for exporting matrices. I still think it would be nice. > It's hard to fix this since you're not very explicit here. Sorry; you posted a code first which didn't work at all for me; I tried to fix it, and I posted a code which I though worked but in the end it didn't. Thus, I though it would be fair to post another message stating this, if nothing else than for future viewers. >> I tried to use the regexp=20 >> (not (string-match "|[\\+-]+|" table)) >> to identify tables without heading separators, but it didn't work >> properly. > > It cannot work in filters. These are applied on back-end ouput, in > this case LaTeX code, not on Org code. Aha, that explains a lot. At some point when I don't have so many assignments I really need to get to know the details of your work. It's has so many cool features.=20 > There is no TBLOPTIONS affiliated keyword, but it could go in > ATTR_LATEX That a lot more clever. I just made up TBLOPTIONS since I couldn't think of anywhere better. But you are of right. Such an option would fit perfectly into ATTR_LATEX. > If you provide a full description of options and their effect, I > might try to implement it. Okay I'll try. I don't know whether something like the below is what you are thinking of. I use matrices all of the time so it would be nice for me. - PROPOSAL: New option(s)for ATTR_LATEX - :type :: options a lisp translation function or key words associated with a lisp list translation function. - Default keyword: table; other known keywords: matrix - table: current exporter - matrix: exports to LaTeX matrix determined by the variable org-export-latex-tables-matrix-default-type or :matrix-type. Default is: bmatrix or pmatrix (probably bmatrix). - in general array requires more configuration, but for me array need not be supported. - Matrix relevant keywords :: are the following - If the additional variable ALIGN is set to k =E2=88=88 {l,r,c} use the starred version of org-export-latex-tables-matrix-default-type or :matrix-type - If the additional keyword :bordered is t use the typeset the matrix as \borderedmatrix{&col1& ... &colN\\row1&...\\...\\rowN}. A better example is here=C2=A0=C2=B9. Also, the default bordermatrix macro is determined via org-export-latex-tables-matrix-bordered-type s.t. one can specify kbordermatrix=C2=A0=C2=B2 or qbordermatrix=C2=A0=C2=B3. = Perhaps Org automatically add the respective usepackage if this option is set to something different from bordermatrix (i.e. org-export-latex-tables-matrix-bordered-type is a list of lists where the first element of a list is the macro name and the second is the needed package). - If :matrix-pre "string" is set "string" is typeset before the matrix - If :matrix-post "string" is set then "string" is typeset after the matrix. - Alternatively, CAPTION could be used, but it seems weird. Are they written before or after the matrix? I'd prefer CAPTIONs to be ignored typeset when matrices are typeset. - If the table has a name the matrix is typeset using equation and given an label. If not it may be typeset using equation* or \[=C2=B7\]. - Potentially: an :inline exists s.t. if inline is t the matrix is typeset inline [i.e. with \(\)]. Perhaps, it should be smart and use the small verison of org-export-latex-tables-matrix-default-type. I.e. if bmatrix use bsmallmatrix. This could be set via org-export-latex-tables-matrix-inline-small. Thanks, Rasmus Footnotes:=20 =C2=A0=C2=B9 http://www.math.harvard.edu/texman/node25.html =C2=A0=C2=B2 https://www.hss.caltech.edu/~kcb/LaTeX.shtml =C2=A0=C2=B3 https://code.google.com/p/qbordermatrix/ --=20 When the facts change, I change my mind. What do you do, sir?