How to emphasize an equation with color box?

Does TeXMAcs have an analog of package empheq in Latex? I usually use in Latex code the packages \usepackage{empheq} and \usepackage[most]{tcolorbox} to emphaasize equations. For example,
\begin{empheq}[box=\tcbhighmath]{equation}
\Pi^{00} + \Pi^{tr} =0.
\end{empheq}
But TeXMacs can not import this example.

I use TeXmacs because I never wanted to learn (La)TeX. Please describe what you intend to achieve with that LaTeX package (do not expect all TeXmacs users to be TeX experts :relaxed:…).

1 Like

Above my code produces this formula
ex
Is it possible to make something like this?

You can get something similar in a displayed formula by using the “decorated” tag. Select the equation and click Insert→Presentation tag→Decorated. Then set the shape to rounded, the color to yellow and in the style parameters, set the ornament sunny & shadow colors to red.
You probably can get it to look closer to what you have by adding padding.

Thank you. Yes, it works in theme Plain. But the color is not changed in my theme Ridged paper. Export to Latex gives strange operator \decorated and the tex file is compiled with error because there is no definition for this operation. Therefore, this decoration works inside TeXMacs only. :frowning:

You might be able to define a macro for emphasizing equations, select not to have user-defined macros expanded (see http://www.texmacs.org/tmdoc/main/convert/latex/man-tm2latex.en.html) and define a LaTeX macro of the same name.

As for me it is much simple define operator \decorated in the converted Latex file. The definition below in preambula
\usepackage{tcolorbox}
\newcommand{\decorated}[1]{\tcbox[colback=yellow,colframe=red,nobeforeafter]{( #1 )}}
But this works in TeXMacs -> Latex, only.

1 Like

For complex markup I think the best way indeed is to write by hand an equivalente macro both on TeXmacs and on LaTeX. I never tried however to see if I can make it work back and forth. If you find a strategy would be nice to share. Also you might want to look at the markup which is expanded conditionally on the kind of export you are doing, i.e. you can tell TeXmacs that something is relevant only in LaTeX or HTML export.

I think it is good idea, but there is single problem - I’m a physicist and do not know scheme language. I have no problem to make (or find in internet) macros in Latex file but here I’m stupid lamer :slight_smile:

I was not thinking to scheme. I meant the following: you use in the TeXmacs file a markup like \my-decoration, then on the TeXmacs file you also define a macro for it. And on the LaTeX file you add by hand a corresponding macro which more or less do what is equivalent for you.This would partially solve the problem of the fact that TeXmacs do not know how to convert some non-trivial macro back and forth.

Really, I have no idea how to realize it. In macros, we have to describe all actions. I made decoration as suggested above and in the tm file appears only a single operator - decoration. Without any parameters. I think that without scheme it can not be realized. May be asked van Hoeven?