How to customize conversion from TeXmacs to LaTeX?

Dear Team,

I have been using TeXmacs for the past year and often find myself converting TeXmacs documents to LaTeX for collaborative purposes. However, I consistently encounter issues with the converted LaTeX source code that require manual adjustments.

For instance, consider the conversion of the expression shown below:

53

The conversion results in the following LaTeX code:

\underset{\begin{array}{c}
x \in A\
x > 5\
x < 6
\end{array}}{\max} x^2 & \text{if {…}} ;\
1 & \text{if } \cdots .
\end{array}\right. ]

However, I would prefer that the \begin{array}…\end{array} blocks be automatically converted to \begin{cases}…\end{cases}, and that the \underset{\begin{array}{c}…\end{array}}{\max} construct be changed to \max_{\substack{…}}.

Is there a way to customize the conversion rules or settings in TeXmacs to automatically generate the desired LaTeX syntax, thereby eliminating the need for manual adjustments?

Thank you for your assistance.

Best Regards,

Yeoi

Hi @yeoi, as far as I know there is no mechanism to customize the export in the way you describe.

There is a less flexible customization mechanism with the specific tag, which you can read about in the manual, section 16.6, and the Jolly Writer in sec. 7.6.2 (at a quick look, it is the same explanation). To me, it seems it would not work well for what you want to do, though.

I found also a thread on export customization, Is it possible to tweak how TeXmacs documents get converted to LaTex?, but this might not be what you want also.

1 Like

I agree that the conversion of the choice and substack construct from TeXmacs to LaTeX seems suboptimal. It might be useful to file a bug. One can argue that the proper conversion is with the choice and substack construct of amsmath.

2 Likes