Different colors for definitions and theorem/proposition

Thank you… It’s working fine now.

One more question. I have a definition which looks like


can we modify the definition in texmacs to make the definition looks like this?
(Also same for theorem and maybe example)

I have been able to do this for the definition:

<assign|centered-def|<\macro|title|body>
  <\surround|<next-definition>|>
    <with|ornament-shape|rounded|ornament-title-style|top
    center|ornament-border|1.5ln|<\ornamented-titled>
      <arg|body>
    </ornamented-titled|<theorem-name|<compound|definition-numbered|<compound|definition-text>|<compound|the-definition>>:
    <arg|title>>>>
  </surround>
</macro>>

I am not able to set dashed borders. A dash-style environment variable does not do it.
When the definition is generated, the border of the definition is visible beneath the title; after a while (typing the title and scrolling did it) it disappears.

1 Like

Thanks…
one more thing, can we like replace definition with theorem, can we make the same for theorem? Also, can we number definition and theorem independently ?

That is the “European numbering style”, that you can select in the context menu when inside one of the enunciation environments.

Let me show you how I do these things—I view the definition of environments with the help of the Macro editor (please let me know if you don’t know what that is), then I try and figure out how they work.

The definition of definition is

<assign|definition|<\macro|body>
  <surround|<compound|next-definition>||<compound|render-theorem|<compound|definition-numbered|<compound|definition-text>|<compound|the-definition>>|<arg|body>>>
</macro>>

while the definition of theorem is

<assign|theorem|<\macro|body>
  <surround|<compound|next-theorem>||<compound|render-theorem|<compound|theorem-numbered|<compound|theorem-text>|<compound|the-theorem>>|<arg|body>>>
</macro>>

They have in common the render-theorem macro; to make the theorem definition the same as the definition definition, <compound|next-definition> needs to be substituted with <compound|next-theorem>—same for <compound|definition-numbered|<compound|definition-text>|<compound|the-definition>.

So you have to do the same for turning the centered-def macro into a centered-thm macro.

1 Like

Thanks a lot!.. One more thing (really sorry) for only changing colour of the body what is the command?

Do you mean the body text?

The background of the text

That is the ornament-color environment variable. You can apply it by adding it to the list of environment variables contained in the with that wraps the ornamented-titled.

There is also a context menu for the ornamented environment which you can experiment with; the changes you make in that menu are registered inside an invisible section of the document (its name is collection); with a text editor you are able to see it, it is at the document end. In that you will see the names of the environment variables that correspond to the changes you made using the context menu. When you know the names, you can use them in a definition of an environment.

1 Like

By the way, if you want to see what happens for editing made through menus: first check the source code view. If the changes are not visible there, then look for the collection section with a text editor.

Hi,

thank you for this thread.

I’ll go with my question/wish/challenge : how to get definitions like this one, with a colour gradient in the title, with some kind of \dueto next to the Definition number but without parenthesis (that’s easy : remove them in the \dueto options), and a shadow at the bottom of frame like in the following picture ?
I tried different options from Texmacs menu but coulnd’t get : the /dueto next to definition, the colour in the frame of definition and the shadow at the bottom
Capture%20d%E2%80%99%C3%A9cran%20du%202024-11-11%2012-16-40|690x223

I think one needs to change the dueto-add Scheme function and possibly a few supporting functions. If you give me some time I might try (I do not promise that I try and I do not promise success).

I found it out looking for "Due to" in the progs directory of the TeXmacs installation using ack.

you might try under “Ornament extra color” in the wrench menu under “Gradient”. It might be possible to add custom gradients to the ones provided by the installation, but I did not try it out.