org-e-latex: Implement math table clusters
commit755af2357729b15996d44d5d177a3b0caff072ff
authorNicolas Goaziou <n.goaziou@gmail.com>
Sun, 25 Nov 2012 15:16:29 +0000 (25 16:16 +0100)
committerNicolas Goaziou <n.goaziou@gmail.com>
Sun, 25 Nov 2012 15:16:29 +0000 (25 16:16 +0100)
tree7a9d7ea632b8bf3842f0c3d36180f65331328c7f
parentfe3f1a0026e993410d67b13ae1932afcd361a6df
org-e-latex: Implement math table clusters

* contrib/lisp/org-e-latex.el (org-e-latex--math-table): Contiguous
  tables sharing the same math mode are wrapped within the same
  environment.

This patch will allow to write:

  #+label: I_2
  #+attr_latex: :mode math :environment bmatrix
  | a | b |
  |---+---|
  | c | d |
  #+attr_latex: :mode math :environment bmatrix :math-prefix "\\times"
  | 1 | 0 |
  |---+---|
  | 0 | 1 |
  #+attr_latex: :mode math :environment bmatrix :math-prefix "="
  | 1 | 0 |
  |---+---|
  | 0 | 1 |
  #+attr_latex: :mode math :environment bmatrix :math-prefix "\\times"
  | a | b |
  |---+---|
  | c | d |
  #+attr_latex: :mode math :environment bmatrix :math-prefix "="
  | a | b |
  |---+---|
  | c | d |

and get:

  \begin{equation}
    \label{I_2}
    \begin{bmatrix}
      a & b \\
      c & d \\
    \end{bmatrix}
    \times\begin{bmatrix}
      1 & 0 \\
      0 & 1 \\
    \end{bmatrix}
    =\begin{bmatrix}
      1 & 0 \\
      0 & 1 \\
    \end{bmatrix}
    \times\begin{bmatrix}
      a & b \\
      c & d \\
    \end{bmatrix}
    =\begin{bmatrix}
      a & b \\
      c & d \\
    \end{bmatrix}
  \end{equation}
contrib/lisp/org-e-latex.el