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

>> except that you also drop erasing #+name and #+caption
>> 
>>   (org-element-put-property table :name nil)
>>   (org-element-put-property table :caption nil)
>> 
>> done in `org-latex--wrap-latex-matrices'.
>
> Yes, because that would go in an outer environment in documents. In 
> presentations, mainly with ltx-talk, that's not needed.

But we are talking about ox-latex-wide changes, right?
In LaTeX, documents, is there a possibility that users *want* to keep
caption or label/name?

I am thinking about something like

\begin{subequations}\label{lorenz}
        \begin{align}
                \dot x &= \sigma(y-x)   \label{l1} \\
                \dot y &= x(\rho-z) - y \label{l2} \\
                \dot z &= xy - \beta z  \label{l3}
        \end{align}
\end{subequations}

>> Or do I miss something?
>
> Basically the last email. In the final version, I'm wrapping the math* 
> tables in
> {
> }
>
> to support :math-prefix and other attributes. For example:
>
> #+attr_latex: :mode math* :environment align
> #+attr_latex: :math-prefix \addtolength{\jot}{6pt
> | f(x) | = (x+1)^2       |
> |      | = x^2 + 2*x + 1 |
>
> will be translated into
>
> {
> \addtolength{\jot}{6pt}\begin{align*}
> f(x) & = (x+1)^2 \\
>   & = x^2 + 2*x + 1
> \end{align*}
> }

I understand. My main concern is when you have

#+name: one
#+attr_latex: :mode math* :environment align
| f(x) | = (x+1)^2       |
|      | = x^2 + 2*x + 1 |

#+name: two
#+attr_latex: :mode math* :environment align
| f(x) | = (x+1)^2       |
|      | = x^2 + 2*x + 1 |

Equation [[one]] and [[two]], two tables in the row.

> To go back to the dropping of :name and :caption, yes, I do drop them, 
> because these environments don't support them.

Environment not supporting align should not stop us. Just as it does not
stop captions to be honored in :mode math.
I am referring to
:markup
                                  (cond ((string= mode "inline-math") 'inline)
                                        ((or caption name) 'equation)
                                        (t 'math))

and then

(`equation
     (let ((caption (org-latex--caption/label-string matrices info))
           (caption-above? (org-latex--caption-above-p matrices info)))
       (concat "\\begin{equation}\n"
               (and caption-above? caption)
               contents
               (and (not caption-above?) caption)
               "\\end{equation}")))

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