"Pedro A. Aranda" <[email protected]> writes:

> In "13.10.5 Tables in LaTeX export" in the manual 
> (https://orgmode.org/org.html#Tables-in-LaTeX-export to be precise), I read:
>
> <quote>
> ':mode'
> ...
> A failing example:
>
> #+attr_latex: :mode math :environment align*
> | f(x) = | x^3 + 3*x^2 + 3*x + 1   |
> |      = | (x^2 + 2*x + 1) * (x+1) |
>
> produces:
>
> \[
> \begin{align*}
>   f(x) = & x^3 + 3*x^2 + 3*x + 1 \\
>   = & (x^2 + 2*x + 1) * (x+1) \\
> \end{align*}
> \]
>
> as promised in the manual. Replace math with inline-math and you'll see 
> the environment wrapped in \(\).

I understand the problem you are trying to solve.
What I am confused about with your approach is the following:

When I am looking at

#+attr_latex: :mode math :environment <something>

I read this as "produce my table in LaTeX math mode, wrapping into
environemnt <something> that is usable in math mode".

#+attr_latex: :environment <something>

is for environments in ordinary LaTeX mode, outside math.

>From this perspective, align and align* are the environments that do not
belong to LaTeX math mode. So, when you propose :mode math* I feel that
something is off and I can't make sense of it.

On the other hand, in ox-latex, we also introduce :mode verbatim and
:mode tabbing that are pretty alien to LaTeX's concept of modes.
AFAIU, they are implemented the way they are simply because the table
should be formatted differently - either without any processing of
syntax (verbatim), or with special processing (tabbing).

That's why I suggested :mode align and :mode align*

Another logical approach could be simply allowing

#+attr_latex :environment align/align* (no :math)
to be handled specially.

> The only enhancement I see is to narrow the use of :mode math* to 
> :environments like align and align* and warn that other attributes may 
> not be exported.

I think the key problem I have is that we do not have a clear logic
behind what :mode means in tables. Something users can intuitively
understand.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to