emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [ANN] e-latex back-end: changes to attributes syntax
@ 2012-11-21 16:35 Nicolas Goaziou
  2012-11-21 17:40 ` Rasmus
                   ` (4 more replies)
  0 siblings, 5 replies; 21+ messages in thread
From: Nicolas Goaziou @ 2012-11-21 16:35 UTC (permalink / raw)
  To: Org Mode List

Hello,

I've changed the attribute syntax for tables, images and lists in
e-latex back-end (new exporter). New this back-end conforms to the
syntax used by Babel and every other back-end.

I've also added support for matrix editing.

Here's an excerpt from the documentation in org-e-latex.el:

    Table export can be controlled with a number of attributes (through
    ATTR_LATEX keyword).
    
    - The main one is the `:mode' attribute, which can be set to
      `table', `math', `inline-math' and `verbatim'.  In particular,
      when in `math' or `inline-math' mode, every cell is exported
      as-is and the table will be wrapped in a math environment.  Also,
      horizontal rules are ignored.  These modes are particularly
      useful to write matrices.  Default mode is stored in
      `org-e-latex-default-table-mode'.
    
    - The second most important attribute is `:environment'.  It is the
      environment used for the table and defaults to
      `org-e-latex-default-table-environment' value.  It can be set to
      anything, including "tabularx", "longtable", "array",
      "bmatrix"...
    
    - `:float' attribute defines a float environment for the table.
      Possible values are `sidewaystable', `multicolumn' and `table'.
    
    - `:width' and `:align' attributes set, respectively, the width of
      the table and its alignment string.
    
    - `:booktabs', `:center' and `:rmlines' values are booleans.  They
      toggle, respectively "booktabs" usage (assuming the package is
      properly loaded), table centering and removal of every horizontal
      rule but the first one (in a "table.el" table only).
    
    - `:math-prefix', `:math-suffix' and `:math-arguments' are string
      which will be inserted, respectively, before the table within the
      math environment, after the table within the math environment,
      and between the macro name and the contents of the table.  The
      latter attribute is necessary to matrix macros that require more
      than one argument (i.e. "qbordermatrix").
    
    Plain lists accept two optional attributes: `:environment' and
    `:options'.  The first one allows to use a non-standard environment
    (i.e. "inparaenum").  The second one allows to specify optional
    arguments for that environment (square brackets are not mandatory).
    
    Images accept `:float', `:placement' and `:options' as attributes.
    `:float' accepts a symbol among `wrap', `multicolumn', and
    `figure', which defines the float environment for the table (if
    unspecified, an image with a caption will be set in a "figure"
    environment).  `:placement' is a string that will be used as
    argument for the environment chosen.  `:options' is a string that
    will be used as the optional argument for "includegraphics" macro.

Here are some example to illustrate the changes, in particular in the
table area:

#+begin_src org
#+LATEX_HEADER: \usepackage{amsmath}\usepackage{booktabs}\usepackage{mathtools}\usepackage{rotating}

* Tables

  #+NAME: my-matrix
  #+attr_latex: :mode math :environment array
  #+attr_latex: :math-prefix "\\left(" :math-suffix "\\right)"
  | <l> | <r> |
  | a   |   b |
  |-----+-----|
  | c   |   d |

  This is a reference to matrix [[my-matrix]].

  #+attr_latex: :mode math :environment matrix
  #+attr_latex: :math-prefix "M = \\left(" :math-suffix "\\right)"
  | a | b |
  |---+---|
  | c | d |

  #+attr_latex: :mode verbatim
  | a | b |
  |---+---|
  | c | d |


  #+attr_latex: :booktabs nil :align |r|l| :float sidewaystable
  | 123 | 123 |
  |-----+-----|
  |   1 |   1 |

  Some inlined matrix
  #+attr_latex: :mode inline-math :environment bsmallmatrix
  | a | b |
  |---+---|
  | c | d |
  . As you can see.


  Eventually some bordered matrix:

  #+attr_latex: :mode math :environment bordermatrix
  |     | C_1 | C_2 |
  |-----+-----+-----|
  | L_1 | a   | b   |
  | L_2 | c   | d   |

* Images (from manual)

  #+caption: The black-body emission of the disk around HR 4049
  #+name: fig:SED-HR4049
  #+attr_latex: :options "5cm,angle=90"
  [[./img/sed-hr4049.pdf]]

  #+attr_latex: :float wrap :placement "{r}{0.4\\textwidth}" :options "width=0.38\\textwidth"
  [[./img/hst.png]]
#+end_src


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2012-11-28 15:27 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-21 16:35 [ANN] e-latex back-end: changes to attributes syntax Nicolas Goaziou
2012-11-21 17:40 ` Rasmus
2012-11-21 18:00   ` Nicolas Goaziou
2012-11-25 15:31   ` Nicolas Goaziou
2012-11-25 16:41     ` Rasmus
2012-11-22 16:29 ` Alan Schmitt
2012-11-22 16:48   ` Nicolas Goaziou
2012-11-22 19:02     ` Alan Schmitt
2012-11-22 23:02 ` Thomas S. Dye
2012-11-25 15:24   ` Nicolas Goaziou
2012-11-25 18:13     ` Thomas S. Dye
2012-11-23  9:00 ` Alan Schmitt
2012-11-23 11:59   ` Nicolas Goaziou
2012-11-23 12:37     ` Alan Schmitt
2012-11-23 12:59       ` Nicolas Goaziou
2012-11-23 13:13       ` Giovanni Ridolfi
2012-11-23 13:42       ` Gregor Zattler
2012-11-26  0:39 ` [ANN] " Suvayu Ali
2012-11-28 12:58   ` Nicolas Goaziou
2012-11-28 13:27     ` Suvayu Ali
2012-11-28 15:23       ` Nicolas Goaziou

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).