emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: Rasmus <rasmus@gmx.us>
Cc: emacs-orgmode@gnu.org
Subject: Re: Export tables as matrices (change tbl-export function on the fly)
Date: Sun, 18 Nov 2012 20:12:52 +0100	[thread overview]
Message-ID: <874nkmend7.fsf@gmail.com> (raw)
In-Reply-To: <87lidz3t24.fsf@pank.eu> (rasmus@gmx.us's message of "Sun, 18 Nov 2012 15:05:23 +0100")

Rasmus <rasmus@gmx.us> 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

      reply	other threads:[~2012-11-18 19:17 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
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 [this message]

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=874nkmend7.fsf@gmail.com \
    --to=n.goaziou@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=rasmus@gmx.us \
    /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).