Great theorems: How do I include something before content but after the title?

I have a definition like this:


I want the colon to always be before the content in the first line. The current implementation is

#let definition = mathblock(
  blocktitle: "Definition", 
  counter: mathcounter,
  titlix: title => [*(#title):*],
  bodyfmt: body => [ \
    #body
  ],
  stroke: 1pt, 
  inset: 0.7em
)

This works fine as long as there is a title. If there is no title, then the colon disappears, which makes sense. I this case I would want to add a line prefix: (count) => [*Definition #count:*], but this is bad, if there is a title, because then the colon is before the title.

The current solution is to write:

#let definition = mathblock(
  blocktitle: "Definition", 
  counter: mathcounter,
  titlix: title => [*(#title)*],
  bodyfmt: body =>[#h(-0.35em)*:* \
    #body
  ],
  stroke: 1pt, 
  inset: 0.7em
)

The #h(-0.35em) is necessary, because otherwise the distance between the colon and the title would be too big. This solution seems suboptimal. Is there a better way to do this?

Good question.

Unfortunately, right now there is not. That’s because the theorem structure in great-theorems fundamentally is:

  1. prefix (will include a separator)
  2. title (if present)
  3. body

In particular there is no way to have a separator after the title. The other variant (the one you want) is

  1. prefix (won’t include a separator)
  2. title (if present)
  3. separator
  4. body

I thought about this for some time when I created the package. I thought that method 1 is “better” and went for it, and I hoped no one is gonna complain that they can’t do a design like yours.

Well, now only a few days after the package was released someone complained… so I guess I will implement a way to employ your design. Here is a tracking issue:

Let me know if you have any thoughts about how the interface should be.