Boxed latex command not working in texmacs

When Importing a latex file in Texmacs the \boxed command is not recognised and is left as is in the picture
image

The latex code snippet:

    
\documentclass[a4paper,11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath,amsfonts,amssymb}
\usepackage{mathtools}
\usepackage{geometry}
\usepackage[italian]{babel}
\usepackage{hyperref}
\geometry{margin=2.5cm}

\newcommand{\ds}{\displaystyle}

\Longrightarrow                   
\;C_1=\dfrac13,\;                 
C_2=-\dfrac32,\;                  
C_3=\dfrac{46}{15}.               
\]                                
                                  
\[                                
\boxed{\;y[k]=\frac13-\frac32(-3)^k+\frac{46}{15}(-2)^k+\frac1{10}3^{\,k}\;}
\]

La risposta forzata (condizioni iniziali nulle) coincide con
il solo termine particolare:
\[
\boxed{\;y_f[k]=\frac1{10}\,3^{\,k}\;}
\]

\bigskip
\subsection*{Soluzione Esercizio 3}

Hi @Gli_acopossum and welcome to the forum.

A brutal solution (I hope that someone else can improve it) is to open the imported TeXmacs file with a text editor and substitute <boxed| with <ornament| throughout.

If this is still too far away from what you’d like to have, we can investigate more (or maybe someone else in the meantime will have written a more sensible way of doing).

Thank you very much for the quick response! A brutal solution does it for me. Though I hope that it does get fixed in the future.

Is there no way to apply <ornament| via TeXmacs?

I don’t recall of a way of customizing TeXmacs LaTex import so that one can import LaTeX’s environments with given TeXmacs tags (in this case LaTeX’s boxed as TeXmacs’s ornament) and I did not figure out how to replace tags within TeXmacs (does anyone know?).

It’s hard-coded in src/Data/Convert/Tex/fromtex.cpp. To make the boxed captured, just add to somewhere around line 2000:

if (is_tuple (t, "\\boxed", 1)) return tree (ORNAMENT, l2e(t[1]));

and recompile you texmacs.

3 Likes

Hey that’s an impressively specific answer :flushed:, thank you lots!

It’s a solved problem in Liii STEM.

And it will be solved in the upcoming Mogan STEM v2025.1.0.

1 Like

@Gli_acopossum This issue has been resolved in r14759, thanks to @sharkc’s fix. Much appreciated!

3 Likes

@darcy It seems the sync to Github is broken. This commit is not showing up.

Just sync the new commits to the github main branch now!

The commit messages will be the preferred language of the author. Since the LLM can translate it very well. We encourage the developers to use their preferred language.