Customizing the section type with color blocks

Many of us want to customizing our own style. As still a beginner, I hope to see more examples of customizing the TeXmacs. Recently, I find this style of section and subsection in LaTeX forum:

In LaTeX we can use \box or similar box commands to generate those colored blocks, but how should we make those in TeXmacs? Could anybody show me the approach?

I made a rapid try and came up with something like:


to be added to the preamble. I used a table to make the colored box, maybe one will have to adjust paddings and centering but does not seems impossible. I suggest you experiment with the formatting on a text and then when you are satisfyed with the paddings, color and centering copy the TeXmacs code into the above macro.

1 Like

I see. But do you have any suggestions for the colored underline? It seems both wide-underlined and wide-std-underlined have no color or thickness options.
p.s. Box seems to be more flexible than table. Isn’t it? Do think TeXmacs should have box like in LaTeX?

What features you cannot implement with tables? In my experience tables are really useful to obtain graphic effects and organize text on the page. There is also the ornamented environment if you need some decoration.
Again for underline you can use a table and the associated borders I think.


    <with|color|pastel blue|<\wide-tabular>


Would it be sensible to turn your solution into a small package?

I think this should need a nice interface, I still do not know how to create macros which allow to customize parameters via the focus bar. Some suggestions?