From mboxrd@z Thu Jan 1 00:00:00 1970 From: tsd@tsdye.com (Thomas S. Dye) Subject: Re: [ANN] e-latex back-end: changes to attributes syntax Date: Thu, 22 Nov 2012 13:02:43 -1000 Message-ID: References: <87haoiewwr.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:41225) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbfnZ-0006Wz-3q for emacs-orgmode@gnu.org; Thu, 22 Nov 2012 18:03:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TbfnU-0000Qx-Lg for emacs-orgmode@gnu.org; Thu, 22 Nov 2012 18:03:09 -0500 Received: from 173-254-64-10.unifiedlayer.com ([173.254.64.10]:49244 helo=oproxy11-pub.bluehost.com) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1TbfnU-0000QZ-DF for emacs-orgmode@gnu.org; Thu, 22 Nov 2012 18:03:04 -0500 In-Reply-To: <87haoiewwr.fsf@gmail.com> (Nicolas Goaziou's message of "Wed, 21 Nov 2012 17:35:48 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nicolas Goaziou Cc: Org Mode List Aloha Nicolas, Nicolas Goaziou 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)" > | | | > | 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