emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [ANN] e-latex back-end: changes to attributes syntax


From: Thomas S. Dye
Subject: Re: [O] [ANN] e-latex back-end: changes to attributes syntax
Date: Thu, 22 Nov 2012 13:02:43 -1000

Aloha Nicolas,

Nicolas Goaziou <address@hidden> writes:

> 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

I think this is an improvement.  Thanks!

Would it be possible to add a :font attribute for tables? I'd like to be
able to say, e.g., :font "\\footnotesize" and have \footnotesize appear
between the float and table environments, near \centering in the LaTeX
output.

All the best,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com



reply via email to

[Prev in Thread] Current Thread [Next in Thread]