Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suggestion: individual cell alignment in luamml/mtable #812

Open
nbeisert opened this issue Mar 6, 2025 · 2 comments
Open

suggestion: individual cell alignment in luamml/mtable #812

nbeisert opened this issue Mar 6, 2025 · 2 comments

Comments

@nbeisert
Copy link

nbeisert commented Mar 6, 2025

The alignment in the multline environment is adjusted using \UseTaggingSocket{math/luamml/mtable/aligncol}{...}. This ends up calling set_row_attribute to set the columnalign attribute for the present mtable mtr row. I wonder if the behaviour could be changed or extended to set the columnalign attribute for individual mtable mtd cells? This should not make a difference for the single-column environment multline, but it can come to use in, e.g., extended multi-column environments, where individual cells might want to get shoved around. At the level of the html / mathml representation, shifting the attribute from mtr to mtd tags worked fine in a manual test.

A related issue is that align cells are out of sync with the preset columnalign="right left" due to the presence of tags at the beginning of each row (and because "right left" apparently does not repeat as a pattern). With the above extension, one might explicitly feed in the desired alignment for each cell to resolve the issue (or change the mtable attribute columnalign="right right left right left right ..."). In all this, I assume that the html / mathml representation of an mtable matters not only in terms of content but also with regard to layout...?

\DocumentMetadata{testphase=latest}
\documentclass{article}
\tagpdfsetup{math/setup={mathml-SE}}

\begin{document}

\begin{align}
x&=\sin y
\\
\sin y&=x
\end{align}

\begin{multline}
\text{first}\\
\text{middle}\\
\text{last}
\end{multline}

\end{document}
@u-fischer
Copy link
Member

I wonder if the behaviour could be changed or extended to set the columnalign attribute for individual mtable mtd cells?

A lots of things can be done, and luamml will be extended, but one need real examples to test.

A related issue is that align cells are out of sync with the preset columnalign="right left" due

That will be handled with the next luamml update.

@nbeisert
Copy link
Author

nbeisert commented Mar 7, 2025

Thanks for the information. My package eqnlines provides a version of the gathered environment which allows several columns (essentially add a & to the preamble of \halign in gathered), and it allows to realign individual cells as left, center, right. Whether the combination of these features serves a purpose or whether someone will actually use it, can be debated with good reason. Not that likely. Nevertheless, that's what it currently offers and as the best approximation I can come up with at the moment, I shall use \UseTaggingSocket{math/luamml/mtable/aligncol} to indicate the alignment of an individual cell rather than the complete containing row. A release of the package with tagging support will enable concrete tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants