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 09:53:22 +0100 Message-ID: <87fw48lyoj.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> 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]:47158) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ta0hC-0005jF-7H for emacs-orgmode@gnu.org; Sun, 18 Nov 2012 03:57:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ta0h9-0007OR-3m for emacs-orgmode@gnu.org; Sun, 18 Nov 2012 03:57:42 -0500 Received: from mail-wg0-f49.google.com ([74.125.82.49]:34447) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ta0h8-0007OJ-QB for emacs-orgmode@gnu.org; Sun, 18 Nov 2012 03:57:39 -0500 Received: by mail-wg0-f49.google.com with SMTP id gg4so1658978wgb.30 for ; Sun, 18 Nov 2012 00:57:37 -0800 (PST) In-Reply-To: <87d2zc84nk.fsf@pank.eu> (rasmus@gmx.us's message of "Sat, 17 Nov 2012 19:29:03 +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: > 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 meant: what is the exact problem with my code (with examples and expected output if possible)? It shouldn't be hard to fix. > - PROPOSAL: New option(s)for ATTR_LATEX > - :type :: options a lisp translation function or key words > associated with a lisp list translation function. Forget the lisp translation function. At this level, the function operates on parsed data. It doesn't use any orgtbl-to-* function. Also, even if the ATTR_LATEX keyword applies on the table, it also affects how `table-row' elements and `table-cell' objects are transcoded. The usual way to define a new transcoder in the new export API is to create a derived backed using an alternative translation table. It is easier than it sounds. > - 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. I suggest to use a :math-mode t. With this mode, all cells are treated as raw math code (no transformation is made on any cell). A global variable can also set it `org-export-latex-table-math-mode' (default to nil). Then, the :environment keyword can be set to "tabular", "longtable", "tabularx", "tabulary", "bmatrix", "pmatrix", "vmatrix", "kbordermatrix" or "qbordermatrix". "bordermatrix", "array"... It would default to `org-e-latex-default-table-environment' (default to "tabular"). > - 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 What is the variable ALIGN? You mean :align keyword? Do matrix environments accept alignment? Also I haven't heard about starred version of these. What do they do? > - 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 determi= ned > via org-export-latex-tables-matrix-bordered-type s.t. one > can specify kbordermatrix=C2=A0=C2=B2 or qbordermatrix=C2=A0=C2=B3= .=20=20 >From the syntax perspective, I see no difference between bordered matrices and the others: they just use a different environment, which can be provided through :environment keyword. Am I missing something? > 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). The backend never adds any usepackage automatically. It is a can of worms (incompatibilities, order of packages...). It's the responsibility of the user to do so. > - 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\]. Good idea. > - 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. Do all matrix environments accept a small counterpart? Regards, --=20 Nicolas Goaziou