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

* Re: [ANN] e-latex back-end: changes to attributes syntax
  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-22 16:29 ` Alan Schmitt
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 21+ messages in thread
From: Rasmus @ 2012-11-21 17:40 UTC (permalink / raw)
  To: n.goaziou; +Cc: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

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

Super cool!  I eagerly looking forward to using this for real world
tasks! 

Thank you so much.  

BTW: on the lists:  very good idea.  I have often been bothered by
only having one type of (LaTeX) lists.  Can I set it per list type?
I.e. plain lists are inlined and enumerated are 'normal'?

Again, thanks for this improvement to the already very nice LaTeX
exporter!

–Rasmus

-- 
C is for Cookie

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

* Re: [ANN] e-latex back-end: changes to attributes syntax
  2012-11-21 17:40 ` Rasmus
@ 2012-11-21 18:00   ` Nicolas Goaziou
  2012-11-25 15:31   ` Nicolas Goaziou
  1 sibling, 0 replies; 21+ messages in thread
From: Nicolas Goaziou @ 2012-11-21 18:00 UTC (permalink / raw)
  To: Rasmus; +Cc: emacs-orgmode

Rasmus <rasmus@gmx.us> writes:

> BTW: on the lists:  very good idea.  I have often been bothered by
> only having one type of (LaTeX) lists.  Can I set it per list type?
> I.e. plain lists are inlined and enumerated are 'normal'?

No. Attributes only apply on a single list not on a whole list type.
Though, it's easy to implement with filters. For example:

#+begin_src emacs-lisp
(defun my-latex-inline-plain-lists (plain-list backend info)
  (when (org-export-derived-backend-p backend 'e-latex)
    (replace-regexp-in-string
     "\\`\\\\begin{\\(itemize\\)}" "inparaitem"
     (replace-regexp-in-string
      "\\\\end{\\(itemize\\)}\\'" "inparaitem" plain-list nil nil 1)
     nil nil 1)))

(add-to-list 'org-export-filter-plain-list-functions
             'my-latex-inline-plain-lists)
#+end_src


Regards,

-- 
Nicolas Goaziou

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

* Re: [ANN] e-latex back-end: changes to attributes syntax
  2012-11-21 16:35 [ANN] e-latex back-end: changes to attributes syntax Nicolas Goaziou
  2012-11-21 17:40 ` Rasmus
@ 2012-11-22 16:29 ` Alan Schmitt
  2012-11-22 16:48   ` Nicolas Goaziou
  2012-11-22 23:02 ` Thomas S. Dye
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 21+ messages in thread
From: Alan Schmitt @ 2012-11-22 16:29 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Org Mode List

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.

Hello,

I think this has broken beamer export (new exporter). When I get back to
commit 359b10b3070588e8b751935b3fbcc2c9d8885a6a everything works, but
with this commit I have some error messages about the wrong number of
arguments for (item contents info) or (headline contents info) (for a
minimal test file).

Alan

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

* Re: [ANN] e-latex back-end: changes to attributes syntax
  2012-11-22 16:29 ` Alan Schmitt
@ 2012-11-22 16:48   ` Nicolas Goaziou
  2012-11-22 19:02     ` Alan Schmitt
  0 siblings, 1 reply; 21+ messages in thread
From: Nicolas Goaziou @ 2012-11-22 16:48 UTC (permalink / raw)
  To: Alan Schmitt; +Cc: Org Mode List

Alan Schmitt <alan.schmitt@polytechnique.org> writes:

> I think this has broken beamer export (new exporter). When I get back to
> commit 359b10b3070588e8b751935b3fbcc2c9d8885a6a everything works, but
> with this commit I have some error messages about the wrong number of
> arguments for (item contents info) or (headline contents info) (for a
> minimal test file).

Actually, this is due to a more recent commit. It should be fixed now.

Thanks for the report.


Regards,

-- 
Nicolas Goaziou

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

* Re: [ANN] e-latex back-end: changes to attributes syntax
  2012-11-22 16:48   ` Nicolas Goaziou
@ 2012-11-22 19:02     ` Alan Schmitt
  0 siblings, 0 replies; 21+ messages in thread
From: Alan Schmitt @ 2012-11-22 19:02 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Org Mode List

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Alan Schmitt <alan.schmitt@polytechnique.org> writes:
>
>> I think this has broken beamer export (new exporter). When I get back to
>> commit 359b10b3070588e8b751935b3fbcc2c9d8885a6a everything works, but
>> with this commit I have some error messages about the wrong number of
>> arguments for (item contents info) or (headline contents info) (for a
>> minimal test file).
>
> Actually, this is due to a more recent commit. It should be fixed now.

Yes, it now works. Thanks a lot.

Alan

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

* Re: [ANN] e-latex back-end: changes to attributes syntax
  2012-11-21 16:35 [ANN] e-latex back-end: changes to attributes syntax Nicolas Goaziou
  2012-11-21 17:40 ` Rasmus
  2012-11-22 16:29 ` Alan Schmitt
@ 2012-11-22 23:02 ` Thomas S. Dye
  2012-11-25 15:24   ` Nicolas Goaziou
  2012-11-23  9:00 ` Alan Schmitt
  2012-11-26  0:39 ` [ANN] " Suvayu Ali
  4 siblings, 1 reply; 21+ messages in thread
From: Thomas S. Dye @ 2012-11-22 23:02 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Org Mode List

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

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

* Re: [ANN] e-latex back-end: changes to attributes syntax
  2012-11-21 16:35 [ANN] e-latex back-end: changes to attributes syntax Nicolas Goaziou
                   ` (2 preceding siblings ...)
  2012-11-22 23:02 ` Thomas S. Dye
@ 2012-11-23  9:00 ` Alan Schmitt
  2012-11-23 11:59   ` Nicolas Goaziou
  2012-11-26  0:39 ` [ANN] " Suvayu Ali
  4 siblings, 1 reply; 21+ messages in thread
From: Alan Schmitt @ 2012-11-23  9:00 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Org Mode List

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> * 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]]

I just tried this (using current head on master), but the following

#+begin_src org
#+attr_latex: :options "0.9\linewidth"
[[./objets.pdf]]
#+end_src

yields

#+begin_src latex
\includegraphics[(:options 0.9linewidth)]{./prototype.pdf}
#+end_src latex

The problem is that even if I remove the ":option", then I get
"(0.9linewidth)" with extra parentheses and the backslash removed.

This is for a beamer file.

Is this a bug?

Alan

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

* Re: [ANN] e-latex back-end: changes to attributes syntax
  2012-11-23  9:00 ` Alan Schmitt
@ 2012-11-23 11:59   ` Nicolas Goaziou
  2012-11-23 12:37     ` Alan Schmitt
  0 siblings, 1 reply; 21+ messages in thread
From: Nicolas Goaziou @ 2012-11-23 11:59 UTC (permalink / raw)
  To: Alan Schmitt; +Cc: Org Mode List

Alan Schmitt <alan.schmitt@polytechnique.org> writes:

> Nicolas Goaziou <n.goaziou@gmail.com> writes:
>
>> * 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]]
>
> I just tried this (using current head on master), but the following
>
> #+begin_src org
> #+attr_latex: :options "0.9}\linewidth"
> [[./objets.pdf]]
> #+end_src
>
> yields
>
> #+begin_src latex
> \includegraphics[(:options 0.9linewidth)]{./prototype.pdf}
> #+end_src latex
>
> The problem is that even if I remove the ":option", then I get
> "(0.9linewidth)" with extra parentheses and the backslash removed.
>
> This is for a beamer file.
>
> Is this a bug?

This is a bug which I fixed some hours ago. Though, you need to escape
the backslash.


Regards,

-- 
Nicolas Goaziou

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

* Re: [ANN] e-latex back-end: changes to attributes syntax
  2012-11-23 11:59   ` Nicolas Goaziou
@ 2012-11-23 12:37     ` Alan Schmitt
  2012-11-23 12:59       ` Nicolas Goaziou
                         ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Alan Schmitt @ 2012-11-23 12:37 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Org Mode List

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> This is a bug which I fixed some hours ago. Though, you need to escape
> the backslash.

OK, it's working now.

By the way, do I need to fully restart emacs after installing a new
version of org-mode, or is there a simpler way to load it?

Thanks,

Alan

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

* Re: [ANN] e-latex back-end: changes to attributes syntax
  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
  2 siblings, 0 replies; 21+ messages in thread
From: Nicolas Goaziou @ 2012-11-23 12:59 UTC (permalink / raw)
  To: Alan Schmitt; +Cc: Org Mode List

Alan Schmitt <alan.schmitt@polytechnique.org> writes:

> Nicolas Goaziou <n.goaziou@gmail.com> writes:
>
>> This is a bug which I fixed some hours ago. Though, you need to escape
>> the backslash.
>
> OK, it's working now.
>
> By the way, do I need to fully restart emacs after installing a new
> version of org-mode, or is there a simpler way to load it?

Most of the time, M-x org-reload should do it. Though, when some
oddities happen afterwards, I restart Emacs nonetheless.


Regards,

-- 
Nicolas Goaziou

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

* Re: [ANN] e-latex back-end: changes to attributes syntax
  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
  2 siblings, 0 replies; 21+ messages in thread
From: Giovanni Ridolfi @ 2012-11-23 13:13 UTC (permalink / raw)
  To: Alan Schmitt, Nicolas Goaziou; +Cc: Org Mode List

Da: Alan Schmitt <alan.schmitt@polytechnique.org>

A: Nicolas Goaziou <n.goaziou@gmail.com>
Inviato: Venerdì 23 Novembre 2012 13:37

> Nicolas Goaziou <n.goaziou@gmail.com> writes:

>> This is a bug which I fixed some hours ago. Though, you need to escape
> > the backslash.

> OK, it's working now.

> By the way, do I need to fully restart emacs after installing a new
> version of org-mode, or is there a simpler way to load it?

I think M-x org-reload should suffice.

Giovanni


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

* Re: e-latex back-end: changes to attributes syntax
  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
  2 siblings, 0 replies; 21+ messages in thread
From: Gregor Zattler @ 2012-11-23 13:42 UTC (permalink / raw)
  To: emacs-orgmode

Hi Alan,
* Alan Schmitt <alan.schmitt@polytechnique.org> [23. Nov. 2012]:
> Nicolas Goaziou <n.goaziou@gmail.com> writes:
>> This is a bug which I fixed some hours ago. Though, you need to escape
>> the backslash.
> 
> OK, it's working now.
> 
> By the way, do I need to fully restart emacs after installing a new
> version of org-mode, or is there a simpler way to load it?

There is:

(org-reload &optional UNCOMPILED)

Reload all org lisp files.
With prefix arg UNCOMPILED, load the uncompiled versions.


Ciao, Gregor
-- 
 -... --- .-. . -.. ..--.. ...-.-

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

* Re: [ANN] e-latex back-end: changes to attributes syntax
  2012-11-22 23:02 ` Thomas S. Dye
@ 2012-11-25 15:24   ` Nicolas Goaziou
  2012-11-25 18:13     ` Thomas S. Dye
  0 siblings, 1 reply; 21+ messages in thread
From: Nicolas Goaziou @ 2012-11-25 15:24 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: Org Mode List

Hello,

tsd@tsdye.com (Thomas S. Dye) writes:

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

This is now possible. Thanks for suggesting it.


Regards,

-- 
Nicolas Goaziou

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

* Re: [ANN] e-latex back-end: changes to attributes syntax
  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
  1 sibling, 1 reply; 21+ messages in thread
From: Nicolas Goaziou @ 2012-11-25 15:31 UTC (permalink / raw)
  To: Rasmus; +Cc: emacs-orgmode

Rasmus <rasmus@gmx.us> writes:

> Nicolas Goaziou <n.goaziou@gmail.com> writes:
>
>> 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.
>
> Super cool!  I eagerly looking forward to using this for real world
> tasks!

I added another related feature that may come handy: math table
clusters. Contiguous math tables sharing the same mode are enclosed
within the same math environment. It allows to type, for example:

--8<---------------cut here---------------start------------->8---
  #+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 |
--8<---------------cut here---------------end--------------->8---

and get:

--8<---------------cut here---------------start------------->8---
  \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}
--8<---------------cut here---------------end--------------->8---


Regards,

-- 
Nicolas Goaziou

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

* Re: [ANN] e-latex back-end: changes to attributes syntax
  2012-11-25 15:31   ` Nicolas Goaziou
@ 2012-11-25 16:41     ` Rasmus
  0 siblings, 0 replies; 21+ messages in thread
From: Rasmus @ 2012-11-25 16:41 UTC (permalink / raw)
  To: n.goaziou; +Cc: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Rasmus <rasmus@gmx.us> writes:
>
>> Nicolas Goaziou <n.goaziou@gmail.com> writes:
>>
>>> 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.
>>
>> Super cool!  I eagerly looking forward to using this for real world
>> tasks!
>
> I added another related feature that may come handy: math table
> clusters. Contiguous math tables sharing the same mode are enclosed
> within the same math environment. It allows to type, for example:

I actually needed that the other day, and 'defected' to pure LaTeX.
Thanks this will be very useful!

–Rasmus

-- 
A page of history is worth a volume of logic

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

* Re: [ANN] e-latex back-end: changes to attributes syntax
  2012-11-25 15:24   ` Nicolas Goaziou
@ 2012-11-25 18:13     ` Thomas S. Dye
  0 siblings, 0 replies; 21+ messages in thread
From: Thomas S. Dye @ 2012-11-25 18:13 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Org Mode List

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Hello,
>
> tsd@tsdye.com (Thomas S. Dye) writes:
>
>> 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.
>
> This is now possible. Thanks for suggesting it.
>
>
> Regards,

Very nice.  Thank you!

All the best,
Tom
-- 
Thomas S. Dye
http://www.tsdye.com

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

* Re: [ANN] e-latex back-end: changes to attributes syntax
  2012-11-21 16:35 [ANN] e-latex back-end: changes to attributes syntax Nicolas Goaziou
                   ` (3 preceding siblings ...)
  2012-11-23  9:00 ` Alan Schmitt
@ 2012-11-26  0:39 ` Suvayu Ali
  2012-11-28 12:58   ` Nicolas Goaziou
  4 siblings, 1 reply; 21+ messages in thread
From: Suvayu Ali @ 2012-11-26  0:39 UTC (permalink / raw)
  To: emacs-orgmode

Hi Nicolas,

On Wed, Nov 21, 2012 at 05:35:48PM +0100, Nicolas Goaziou wrote:
>     
>     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).
>     

Are these available for org-e-beamer too?  I tried without success.  It
would be a great addition (along with the options for images below).  :)

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

Cheers,

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: [ANN] e-latex back-end: changes to attributes syntax
  2012-11-26  0:39 ` [ANN] " Suvayu Ali
@ 2012-11-28 12:58   ` Nicolas Goaziou
  2012-11-28 13:27     ` Suvayu Ali
  0 siblings, 1 reply; 21+ messages in thread
From: Nicolas Goaziou @ 2012-11-28 12:58 UTC (permalink / raw)
  To: Suvayu Ali; +Cc: emacs-orgmode

Hello,

Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:

> On Wed, Nov 21, 2012 at 05:35:48PM +0100, Nicolas Goaziou wrote:
>>     
>>     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).
>>     
>
> Are these available for org-e-beamer too?  I tried without success.  It
> would be a great addition (along with the options for images
> below).  :)
>
>>     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.
>> 

Since Beamer back-end doesn't redefine how images are handled, you can
use the same properties as above, within an attr_latex keyword.

About special environments for plain lists, I'm unsure if this is a good
idea. AFAIK many don't support overlay specifications so it would lead
to errors when one provides both a special environment and an overlay,
i.e.:

--8<---------------cut here---------------start------------->8---
#+attr_beamer: :environment inparaenum :overlay "+-"
- item 1
- item 2
--8<---------------cut here---------------end--------------->8---

Also, Beamer has its own way to render standard lists (through themes)
and it could cause problems with foreign packages.

On the other hand, I can still make it easy for an user to shoot himself
in the foot: code-wise, it is cheap. What do you think?


Regards,

-- 
Nicolas Goaziou

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

* Re: [ANN] e-latex back-end: changes to attributes syntax
  2012-11-28 12:58   ` Nicolas Goaziou
@ 2012-11-28 13:27     ` Suvayu Ali
  2012-11-28 15:23       ` Nicolas Goaziou
  0 siblings, 1 reply; 21+ messages in thread
From: Suvayu Ali @ 2012-11-28 13:27 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

On Wed, Nov 28, 2012 at 01:58:09PM +0100, Nicolas Goaziou wrote:
> Hello,
> 
> Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:
> >
> >>     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.
> >> 
> 
> Since Beamer back-end doesn't redefine how images are handled, you can
> use the same properties as above, within an attr_latex keyword.
> 

Okay thanks.  :)

> About special environments for plain lists, I'm unsure if this is a good
> idea. AFAIK many don't support overlay specifications so it would lead
> to errors when one provides both a special environment and an overlay,
> i.e.:
> 
> --8<---------------cut here---------------start------------->8---
> #+attr_beamer: :environment inparaenum :overlay "+-"
> - item 1
> - item 2
> --8<---------------cut here---------------end--------------->8---
> 
> Also, Beamer has its own way to render standard lists (through themes)
> and it could cause problems with foreign packages.
> 
> On the other hand, I can still make it easy for an user to shoot himself
> in the foot: code-wise, it is cheap. What do you think?
> 

Personally I think having the option to shoot myself in the foot is
preferable over not being able to configure.  But then others may not
agree.  Is it possible to disallow :overlay when :environment is
provided?  If so you could generate a warning during export.

That said, the way I see it, most widely used list-like environments are
of the "new item on a new line" kind (which are supported by overlays).
I wanted to use inparaenum for ease of editing, in my slide I wanted an
inline list (where overlays aren't really needed).  So setting the two
attributes simultaneously is probably very unlikely.

I am quoting my use case below in case that helps the discussion.
Something like item (1) would have been nice, however I ended up using
(2).


  1) Asymmetries can be constructed that are,
     #+attr_beamer: :environment "inparaenum" :options "i)"
     1. CP-odd,
     2. CPT-odd and
     3. T-odd

  2) Asymmetries can be constructed that are, i) CP-odd, ii) CPT-odd and
     iii) T-odd.


Anyone else have any thoughts on this?

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: [ANN] e-latex back-end: changes to attributes syntax
  2012-11-28 13:27     ` Suvayu Ali
@ 2012-11-28 15:23       ` Nicolas Goaziou
  0 siblings, 0 replies; 21+ messages in thread
From: Nicolas Goaziou @ 2012-11-28 15:23 UTC (permalink / raw)
  To: Suvayu Ali; +Cc: emacs-orgmode

Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:

> Personally I think having the option to shoot myself in the foot is
> preferable over not being able to configure.  But then others may not
> agree.  Is it possible to disallow :overlay when :environment is
> provided?  If so you could generate a warning during export.
>
> That said, the way I see it, most widely used list-like environments are
> of the "new item on a new line" kind (which are supported by overlays).
> I wanted to use inparaenum for ease of editing, in my slide I wanted an
> inline list (where overlays aren't really needed).  So setting the two
> attributes simultaneously is probably very unlikely.
>
> I am quoting my use case below in case that helps the discussion.
> Something like item (1) would have been nice, however I ended up using
> (2).
>
>
>   1) Asymmetries can be constructed that are,
>      #+attr_beamer: :environment "inparaenum" :options "i)"
>      1. CP-odd,
>      2. CPT-odd and
>      3. T-odd
>
>   2) Asymmetries can be constructed that are, i) CP-odd, ii) CPT-odd and
>      iii) T-odd.

Case 1 should now be supported.


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