emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: tsd@tsdye.com (Thomas S. Dye)
To: Nicolas Goaziou <n.goaziou@gmail.com>
Cc: Org Mode List <emacs-orgmode@gnu.org>
Subject: Re: [ANN] e-latex back-end: changes to attributes syntax
Date: Thu, 22 Nov 2012 13:02:43 -1000	[thread overview]
Message-ID: <m1haohnsvg.fsf@tsdye.com> (raw)
In-Reply-To: <87haoiewwr.fsf@gmail.com> (Nicolas Goaziou's message of "Wed, 21 Nov 2012 17:35:48 +0100")

Aloha Nicolas,

Nicolas Goaziou <n.goaziou@gmail.com> 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

  parent reply	other threads:[~2012-11-22 23:03 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=m1haohnsvg.fsf@tsdye.com \
    --to=tsd@tsdye.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=n.goaziou@gmail.com \
    /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).