0

I would like to create a custom shaded box environment with a title box --- but with the title at the bottom of the environment instead of the top. Additionally, I would like the title to be right-aligned and protruding a specified amount from the body of the environment (and with potentially different color).

Can mdframed be coaxed into creating something like that? Or if not, how about tcolorbox?

UPDATE: I changed the question to specify that the title box should protrude from the body box.

1 Answer 1

1

You get the manual of tcolorbox probably by typing texdoc tcolorbox on the command line.

On p. 179 you'll find, what you need. Example:

\documentclass{article}

\usepackage[most]{tcolorbox}

\begin{document}
\begin{tcolorbox}[enhanced,title=My title,
attach boxed title to bottom right]
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\end{document}

pic of compilation

2
  • Thank you for your response. It is amazingly simple with tcolorbox. But now I further specified what I meant by "different margins" in my original question. I actually want the title box to protrude from the body box.
    – ltcomdata
    Commented Apr 9 at 13:01
  • 1
    @ltcomdata Well, I have given you an idea how to start.
    – Keks Dose
    Commented Apr 9 at 13:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .