MOre insights inline

On 22/11/26 7:57, Ihor Radchenko wrote:
"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}

Then, you need to do something like

#+name: two
#+attr_latex: :environment subequations
#+begin_quote

#+attr_latex: :mode math* :environment align
| f(x) | = (x+1)^2       \label{l1} |
|      | = x^2 + 2*x + 1 \label{l2} |

#+end_quote

With the side effect that captions are not shown...

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.

If you directly apply #+name: to an align or align* you'll get a PDF that may crash some readers when clicking on the reference (my painful experience).



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}")))


Maybe adding the example above should be enough... WDYT?

--
Pedro A. Aranda
ox-latex & ox-beamer maintainer

Sagen's Paradeiser! (ORF: Als Radiohören gefährlich war) => write BE!
IA: onomatopeya del rebuzno
2nd year of the New Koprocracy


Reply via email to